Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2813

DummyTransaction do not commit is last resource transaction is read-only

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Currently HEAD DummyTransaction.java has this code:
      ...
      for (XAResource res : resources) {
      try {
      int prepareStatus = res.prepare(xid);
      transaction.setPrepareStatus(prepareStatus);
      ...
      This means that transaction gets prepare status of the last resource (cache in case of infinispan) enlisted.
      Also it has next code:
      ...
      if (transaction.getPrepareStatus() == XAResource.XA_RDONLY)

      { log.debug("This is a read-only tx"); }

      else {
      ... Do commit ...
      ...
      This means that if last resource returned XA_RDONLY (e.g. when on last cache only get was performed) all other resources are not committed.

      For me this results in locks held indefinitely and transaction leak.

      Correct would be to remember prepare status per-resource and act accordinly.

              pruivo@redhat.com Pedro Ruivo
              tivv00_jira Vitalii Tymchyshyn (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: