[jboss-jira] [JBoss JIRA] Closed: (JBAS-6394) CachedConnectionManager start transaction for all connection in cache.

Adrian Brock (JIRA) jira-events at lists.jboss.org
Mon Jan 19 07:12:04 EST 2009


     [ https://jira.jboss.org/jira/browse/JBAS-6394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Brock closed JBAS-6394.
------------------------------

    Resolution: Rejected


This is not a bug.

You are creating transaction boundaries that the appserver/JCA layer does not know about.
It's not very suprising you have confused it.

What you (really Spring) are doing is technically illegal according to the JavaEE specs
and is not portable (though it will work in simple cases).

You shouldn't be suspending transactions using the TransactionManager directly
(it is not a user api) and nested UserTransasctions are not allowed.

The correct fix for Spring (JBoss AppServer only) is for their transaction demarcation
interceptor to also notify the JBoss CachedConnectionManager (CCM) of the new transactional
context using code similar to the valve or interceptor.

Your "workaround" totally disables the CCM so other features won't work, such as:
http://www.jboss.org/community/docs/DOC-11248

If you want to discuss this further use the forums.

> CachedConnectionManager start transaction for all connection in cache.
> ----------------------------------------------------------------------
>
>                 Key: JBAS-6394
>                 URL: https://jira.jboss.org/jira/browse/JBAS-6394
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JCA service
>         Environment: JBossAS-4.2.2.GA, jdk1.5_14, windows XP SP2, spring framework 2.5.1
>            Reporter: Nattapong Triammeerit
>
> I use spring to implement database dao leyer and transaction management. I got a error "Trying to start a new tx when old is not complete! ..." when I try to create the transaction after directly getting database connection from datasource.
> The scenario is
> 1. Firstly get database connection from datasource. The connection is added to CachedConnectionManager.
> 2. Start the transaction, the connection in CachedConnectionManager is started.
> 3. Get database connection from datasource again. It throw "org.jboss.resource.connectionmanager.JBossLocalXAException: Trying to start a new tx when old is not complete! ..."
> I think, It raise an error becuase it start the first connection in CachedConnectionManager but JBoss transaction manager unknown it and cannot suspense it before inner transaction started. Does it is correct to start transaction to all connection of CachedConnectionManager?
> Thanks

-- 
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