[jboss-user] [Datasource Configuration] - JBoss 5.0 behavior of non-tx-datasource committed or NOT?

Thunder Lei do-not-reply at jboss.com
Thu Sep 9 07:30:49 EDT 2010


Thunder Lei [http://community.jboss.org/people/Thunder.Farmer] created the discussion

"JBoss 5.0 behavior of non-tx-datasource committed or NOT?"

To view the discussion, visit: http://community.jboss.org/message/560360#560360

--------------------------------------------------------------
Hi there,

When I look at the JBoss documents, there is a definition for non-tx-datasource, it said:" This element is used to specify the (org.jboss.resource.connectionmanager)NoTxConnectionManager service configuration. NoTxConnectionManager is a JCA connection manager with no transaction support. ".

As my understanding to this definition, any changes made by using non-tx-datasource should NOT be committed into the underlying database, but according my investigation, that's NOT it. If non-tx-datasource works with xa-datasource, the both will commit or rollback.

Could you guys pls give some clarification on this?

What I did to verify non-tx-datasource behavior is: I have two session beans, ReadOnlyBean and XABean, which in turn refer to two JPA entity managers, and the entity managers refer to two datasouce, one is non-tx-datasource and xa-datasource.
These two datasources are connecting different databases.
I double checked the JDBC drivers used by these two datasources, one is xa and another is non xa.

Then I have the third session bean FacadeBean. In one method of  this facade bean, I call ReadOnlyBean and XABean to update database.
All the methods are given the transaction attribute as @TransactionAttribute(TransactionAttributeType.REQUIRED).
I call ReadOnlyBean first, then call the XABean.

If I throw EJBException in the XABean, seems both transactions are rolled back.
If there is no EJBException, both changes are committed into underlying database.

any comments are appreciated.

Thanks&Regards,
Thunder
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/560360#560360]

Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100909/131553e5/attachment-0001.html 


More information about the jboss-user mailing list