Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16857

Possible issue with transactions in relation with ezmultiplexer, ezoracle and content object states

    Details

      Description

      This issue has been created as a task because for now there are no steps to reproduce it on a standard eZ Publish installation. However, perhaps somebody can have a quick look on it.

      The steps so far:

      1. There is a custom event, in which the status of content objects is changed
      2. The event is configured in a custom workflow that only contains exactly that single event
      3. There is another custom workflow which contains two ezmultiplexer default events. The last event triggers the workflow mentioned in 2.
      4. The workflow in 3. is connected to the content publish after trigger and is executed always (no limitations)

      What happens now is the following:

      I. A content object is edited and published afterwards
      II. The event mentioned in 1. tries to set the object state to the same one, that content object already has
      III. In the debug output on can see the error "No transaction in progress"
      IV. The content object is not published but there is no message or something that would inform an editor that something failed. The only way to figure that out is to edit the content object again and face the dialog showing a warning about an existing draft.

      When having a look at the code in assignState() of ezcontentobject.php one can see:

      $db = eZDB::instance();
      $db->begin();

      $currentStateIDArray = $this->stateIDArray( true );
      $currentStateID = $currentStateIDArray[$groupID];

      if ( $currentStateID == $stateID )

      { $db->rollback(); return false; }

      ...

      The is a begin() and directly afterwards a rollback() if the state did not change. Afaiu there are no write operations to the database in between, so why encapsulate that in a transaction?
      However, this should in general be no problem and it just looks like a transaction has started and directly ended without anything happening in between. But the error message indicates that there has been another transaction with a begin() before which is committed or rolled back by this operation.
      Could this be an issue with the transaction handling in the oracle database driver?
      Is is in general possible to have nested transactions (with oracle / ez)?

      ----------

      since we can not use nested transactions, we should review the usage of transactions in this class, also in relation to how it is used with workflows. (this is not limited to Oracle).

      Steps to reproduce

      eZ Publish 4.2
      eZ Oracle 2.0.2

        Activity

        Hide
        Gaetano Giunta added a comment -

        I think the transaction on assigning object state is:

        • useless: it does not need a transaction if it does not change 2 things at a time
        • harmful: it does a rollback in cases that are not errors
        Show
        Gaetano Giunta added a comment - I think the transaction on assigning object state is: useless: it does not need a transaction if it does not change 2 things at a time harmful: it does a rollback in cases that are not errors
        Show
        Patrick Allaert added a comment - Fixed in: master (4.5): https://github.com/ezsystems/ezpublish/commit/5ac07a3693ca95e432b54623fd0ea1f1f274bc5f stable-4.4: https://github.com/ezsystems/ezpublish/commit/36a5f5318d8cc300bec049638bf94a6d46a4665a stable-4.3: https://github.com/ezsystems/ezpublish/commit/ed59059d768bfe64582aeea3495dbca4a8764d01
        Hide
        Geir Arne Waaler added a comment -

        The issue is fixed. I move it to Closed.

        Geir Arne Waaler
        eZ Documentation

        Show
        Geir Arne Waaler added a comment - The issue is fixed. I move it to Closed. Geir Arne Waaler eZ Documentation

          People

          • Assignee:
            Patrick Allaert
            Reporter:
            Jostein- Knudsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: