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

    XMLWordPrintable

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

      Attachments

        Activity

          People

            e8318ba6-e4ae-477c-9116-36c073bd11a3@accounts.ibexa.co Patrick Allaert
            jkn jkn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: