Moodle
  1. Moodle
  2. MDL-30029

Add support for transactions when in message_send

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: None
    • Component/s: Libraries, Messages
    • Labels:
      None
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      Comment in lib/messagelib.php->message_send():

      //TODO: we need to solve problems with database transactions here somehow, for now we just prevent transactions - sorry
      $DB->transactions_forbidden();

      This means that it's impossible to rollback a transaction if a message send fails.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Andrew Nicols added a comment -

            So perhaps this is a desired behaviour, perhaps not.

            If it is, the comment shouldn't be a TODO and should explain the reasoning.
            If not, then we should look at how bes to fix these issues.

            Show
            Andrew Nicols added a comment - So perhaps this is a desired behaviour, perhaps not. If it is, the comment shouldn't be a TODO and should explain the reasoning. If not, then we should look at how bes to fix these issues.
            Hide
            Petr Skoda added a comment -

            The problem with messaging here is that you can not revert it because it interacts with external system, that means messaging subsystem would have to queue the messages in db table when transaction is active...

            Show
            Petr Skoda added a comment - The problem with messaging here is that you can not revert it because it interacts with external system, that means messaging subsystem would have to queue the messages in db table when transaction is active...
            Hide
            Michael de Raadt added a comment -

            Thanks for reporting this issue.

            We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported.

            If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

            Michael d.

            TW9vZGxlDQo=

            Show
            Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
            Hide
            Yuliya Bozhko added a comment -

            Hi Michael,

            I believe it is still an issue in all versions, but I am not sure it's an easy one to solve...

            https://github.com/moodle/moodle/blob/master/lib/messagelib.php#L69

            Yuliya

            Show
            Yuliya Bozhko added a comment - Hi Michael, I believe it is still an issue in all versions, but I am not sure it's an easy one to solve... https://github.com/moodle/moodle/blob/master/lib/messagelib.php#L69 Yuliya
            Hide
            Michael de Raadt added a comment -

            Thanks, Yulia.

            Show
            Michael de Raadt added a comment - Thanks, Yulia.
            Hide
            Petr Skoda added a comment -

            It might be possible to solve if we used a buffer for messages the same way we do now in events. On the other hand it might be better to throw away the current messaging code and start something better with clear design.

            Show
            Petr Skoda added a comment - It might be possible to solve if we used a buffer for messages the same way we do now in events. On the other hand it might be better to throw away the current messaging code and start something better with clear design.
            Hide
            Petr Skoda added a comment -

            Ooops, I should have searched more for this issue before creating a new one. Sorry.

            Show
            Petr Skoda added a comment - Ooops, I should have searched more for this issue before creating a new one. Sorry.

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: