Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3682

Better Exception Handling in TransactionContext to handle unchecked exceptions

    XMLWordPrintableJSON

Details

    Description

      If we get a unexpected exception from the jdbc driver the VersioningLock from the versionMgr.getXAResourceEnd() XAResource will never be released so the repository is locked forever. We should catch every Exception in BundleDbPersistenceManager.readBundle() to prevent that situation.

      Following Stacktrace shows the problem ...
      Caused by: java.lang.ArrayIndexOutOfBoundsException
      at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readLongMSB(T4CSocketInputStreamWrapper.java:201)
      at oracle.jdbc.driver.T4CMAREngine.buffer2Value(T4CMAREngine.java:2374)
      at oracle.jdbc.driver.T4CMAREngine.unmarshalUB4(T4CMAREngine.java:1310)
      at oracle.jdbc.driver.T4CTTIoer.unmarshal(T4CTTIoer.java:257)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:447)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
      at oracle.jdbc.driver.T4C8TTILob.read(T4C8TTILob.java:146)
      at oracle.jdbc.driver.T4CConnection.getBytes(T4CConnection.java:2392)
      at oracle.sql.BLOB.getBytes(BLOB.java:348)
      at oracle.jdbc.driver.OracleBlobInputStream.needBytes(OracleBlobInputStream.java:181)
      at oracle.jdbc.driver.OracleBufferedStream.readInternal(OracleBufferedStream.java:174)
      at oracle.jdbc.driver.OracleBufferedStream.read(OracleBufferedStream.java:143)
      at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:75)
      at org.apache.commons.io.input.CountingInputStream.read(CountingInputStream.java:74)
      at java.io.DataInputStream.readFully(DataInputStream.java:189)
      at java.io.DataInputStream.readFully(DataInputStream.java:163)
      at org.apache.jackrabbit.core.persistence.util.BundleReader.readBytes(BundleReader.java:669)
      at org.apache.jackrabbit.core.persistence.util.BundleReader.readName(BundleReader.java:520)
      at org.apache.jackrabbit.core.persistence.util.BundleReader.readQName(BundleReader.java:469)
      at org.apache.jackrabbit.core.persistence.util.BundleReader.readBundleNew(BundleReader.java:194)
      at org.apache.jackrabbit.core.persistence.util.BundleReader.readBundle(BundleReader.java:145)
      at org.apache.jackrabbit.core.persistence.util.BundleBinding.readBundle(BundleBinding.java:152)
      at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.readBundle(BundleDbPersistenceManager.java:927)
      at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.loadBundle(BundleDbPersistenceManager.java:889)
      at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.getBundleCacheMiss(AbstractBundlePersistenceManager.java:766)
      at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.getBundle(AbstractBundlePersistenceManager.java:749)
      at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.storeInternal(AbstractBundlePersistenceManager.java:633)
      at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:590)
      at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:482)
      at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:788)
      at org.apache.jackrabbit.core.state.XAItemStateManager.commit(XAItemStateManager.java:181)
      at org.apache.jackrabbit.core.TransactionContext.commit(TransactionContext.java:195)
      at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:326)
      at org.apache.jackrabbit.jca.TransactionBoundXAResource.commit(TransactionBoundXAResource.java:49)
      at com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:490)

      Attachments

        1. JCR-3682.patch
          2 kB
          Claus Köll
        2. JCR-3682.patch
          0.7 kB
          Claus Köll

        Activity

          People

            c_koell Claus Köll
            c_koell Claus Köll
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: