-
Improvement
-
Resolution: Fixed
-
Minor
-
2.7
-
MOODLE_27_STABLE
-
MOODLE_28_STABLE
-
wip_
MDL-45941_m28_message -
The problem here is that we do not want to send messages to external systems while transaction is in progress because the actual message might get rolled back later. At the moment Moodle just stops in message_send() with $DB->transactions_forbidden().
Solution is to add buffer in between $DB->insert_record('message', $savemessage) and $processors[$procname]>object>send_message($eventdata). This would allow us to return messageid from the message_send() for full backwards compatibility.
The implementation would use the same trick as \core\event\manager::database_transaction_rolledback() and \core\event\manager::database_transaction_commited() in the moodle_database class.
Later we can abstract the transaction notification callbacks to be configurable.
- caused a regression
-
MDL-48083 message and event transaction buffers not cleared during forced rollback
- Closed
- has a non-specific relationship to
-
MDL-46021 Backport MDL-45941: allow message sending when DB transaction active
- Closed
- is duplicated by
-
MDL-30029 Add support for transactions when in message_send
- Closed