Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.3, 2.5.1
-
None
-
JBoss AS7 7.1.1.Final
Description
The class XAAwareRWLock uses a HashMap readers_. The static function TransactionContext.getCurrentThreadId() is used to obtain an object currentId used as key in for the HashMap. When running under a transaction the currentId is set to Xid.getGlobalTransactionId which returns a byte[].
However, the class org.jboss.jca.core.spi.transaction.xa.XidWrapper.getGlobalTransactionId() returns globalTransactionId.clone() - it returns a new instance of byte[] on every invocation and the hashCode of the byte[] changes. Therefore, readers_.get(currentId) returns null for the second invocation in the same transaction and the result ist an IllegalStateTransaction:
java.lang.IllegalStateException
at org.apache.jackrabbit.core.version.VersioningLock$XAAwareRWLock.endRead(VersioningLock.java:167) [jackrabbit-core-2.4.3.jar:2.4.3]
...
I suggest using a wrapper for the globalTransactionId byte[] that computes the hashCode on the contents of the byte instead of the object identity.