[jboss-jira] [JBoss JIRA] Commented: (JBAS-5948) UserTransactionSessionImpl is not thread safe

Galder Zamarreno (JIRA) jira-events at lists.jboss.org
Thu Sep 11 07:40:38 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBAS-5948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12429079#action_12429079 ] 

Galder Zamarreno commented on JBAS-5948:
----------------------------------------

Note that you can get a similar exception if you do a rollback() of
a user transaction whose begin() failed. In this case though, throwing 
a "java.lang.IllegalStateException: No transaction." is legitimate and 
it shows that you're using incorrect pattern of user transactions, see:
http://wiki.jboss.org/auth/wiki/WhatIsTheCorrectPatternForUserTransactions

To retiterate, the bug refers to "java.lang.IllegalStateException: No transaction."
being thrown when you're calling commit() as a result of a successful transaction 
or callling rollback() as a result of an exception except an exception in begin().

> UserTransactionSessionImpl is not thread safe
> ---------------------------------------------
>
>                 Key: JBAS-5948
>                 URL: https://jira.jboss.org/jira/browse/JBAS-5948
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Transaction Manager (JBossTM)
>    Affects Versions: JBossAS-5.0.0.CR1, JBossAS-4.2.3.GA
>            Reporter: Galder Zamarreno
>            Assignee: Galder Zamarreno
>             Fix For: JBossAS-5.0.0.CR2, JBossAS-4.2.4.GA
>
>
> First of all, static TransactionManager check and assignment is not synchronised.
> Secondly, WeakValueHashMap activeTx underneath is a HashMap and hence not thread safe. 
> During load testing, seems like transactions were disappearing from activeTx for the same 
> reason that transactions were dissapearing from txFailoverAuthorization map which is due to 
> lack of synchronisation. This map will now become a Collections.synchronizedMap(new WeakValueHashMap());
> Finally, in spite of making activeTx map a synchronised map, we still need to synchronise on 
> activeTx in unreferenced() method as a putIfAbsent type of operation if executed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list