[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:07:38 EDT 2008


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

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

For your interest, you'd see this type of exceptions under load due to this bug:

787468 ERROR [load.generator.scenario.SimpleTestTask] (Thread-294:) [294] - Throwable Exception During User Transaction Commit (RollingBack)
java.lang.IllegalStateException: No transaction.
	at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:162)
	at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:122)
	at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
	at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:231)
	at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
	at $Proxy14.invoke(Unknown Source)
	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:866)
	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:608)
	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:420)
	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
	at org.jboss.remoting.Client.invoke(Client.java:1634)
	at org.jboss.remoting.Client.invoke(Client.java:548)
	at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:184)
	at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
	at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
	at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
	at $Proxy4.commit(Unknown Source)
	at org.jboss.tm.usertx.client.ClientUserTransaction.commit(ClientUserTransaction.java:148)
	at load.generator.scenario.SimpleTestTask.runScenario(SimpleTestTask.java:217)
	at load.generator.scenario.SimpleTestTask.run(SimpleTestTask.java:135)
	at load.generator.SynchronizedRunner.run(SynchronizedRunner.java:32)
	at java.lang.Thread.run(Thread.java:619)

> 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