You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Martin Centner (JIRA)" <ji...@apache.org> on 2012/09/12 14:21:07 UTC

[jira] [Created] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Martin Centner created JCR-3425:
-----------------------------------

             Summary: XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
                 Key: JCR-3425
                 URL: https://issues.apache.org/jira/browse/JCR-3425
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-jca
    Affects Versions: 2.4.3
         Environment: JBoss AS7 7.1.1.Final
            Reporter: Martin Centner


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462554#comment-13462554 ] 

Claus Köll commented on JCR-3425:
---------------------------------

backported to 2.4 in revision 1389754.
                
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>             Fix For: 2.4.4
>
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll reassigned JCR-3425:
-------------------------------

    Assignee: Claus Köll
    
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 2.4.3
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll updated JCR-3425:
----------------------------

    Status: Patch Available  (was: Open)
    
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.5.1, 2.4.3
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Unico Hommes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Unico Hommes updated JCR-3425:
------------------------------

    Fix Version/s: 2.5.3
    
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>             Fix For: 2.2.13, 2.4.4, 2.5.3
>
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Martin Centner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13454035#comment-13454035 ] 

Martin Centner commented on JCR-3425:
-------------------------------------

Thank you very much! Is there a roadmap for the release date of 2.4.4?
                
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13454033#comment-13454033 ] 

Claus Köll commented on JCR-3425:
---------------------------------

Ok after looking at the actual code i see that this bug is also in the trunk version where JCR-3392 is fixed.

                
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 2.4.3
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll updated JCR-3425:
----------------------------

    Attachment: JCR-3425.patch
    
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Unico Hommes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464660#comment-13464660 ] 

Unico Hommes commented on JCR-3425:
-----------------------------------

Backported to branch 2.2 in revision 1390964.
                
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>             Fix For: 2.2.13, 2.4.4, 2.5.3
>
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll updated JCR-3425:
----------------------------

          Component/s:     (was: jackrabbit-jca)
                       transactions
                       jackrabbit-core
    Affects Version/s: 2.5.1
    
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Unico Hommes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Unico Hommes updated JCR-3425:
------------------------------

    Fix Version/s: 2.2.13
    
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>             Fix For: 2.2.13, 2.4.4, 2.5.3
>
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Martin Centner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13454035#comment-13454035 ] 

Martin Centner edited comment on JCR-3425 at 9/13/12 1:50 AM:
--------------------------------------------------------------

Thank you very much! Is there a roadmap for the release of 2.4.4?
                
      was (Author: centner):
    Thank you very much! Is there a roadmap for the release date of 2.4.4?
                  
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13454024#comment-13454024 ] 

Claus Köll commented on JCR-3425:
---------------------------------

This is fixed in JCR-3392. I have forgot to backport this fix ...
I will see that we get this fixed in the next 2.4.4 release.
                
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jca
>    Affects Versions: 2.4.3
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-3425) XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Köll updated JCR-3425:
----------------------------

       Resolution: Fixed
    Fix Version/s: 2.4.4
           Status: Resolved  (was: Patch Available)

Patch committed in revision 1389741.
                
> XAAwareRWLock implementation fails with IllegalStateException on JBoss AS7
> --------------------------------------------------------------------------
>
>                 Key: JCR-3425
>                 URL: https://issues.apache.org/jira/browse/JCR-3425
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 2.4.3, 2.5.1
>         Environment: JBoss AS7 7.1.1.Final
>            Reporter: Martin Centner
>            Assignee: Claus Köll
>             Fix For: 2.4.4
>
>         Attachments: JCR-3425.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira