Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45941

allow message sending when DB transaction active

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8
    • 2.7
    • Messages

      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.

            skodak Petr Skoda
            skodak Petr Skoda
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Marina Glancy Marina Glancy
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.