[jboss-user] [JCA/JBoss] - Re: shouldn't local-tx-datasource have auto-commit = false?

weston.price@jboss.com do-not-reply at jboss.com
Sun Jan 21 11:13:32 EST 2007


Whoops, sorry, I just saw it ;-)

Ok, there are two real choices you have here: 

1) Leverage typical JDBC transactions with Hibernate. 
    By default, Hibernate, if not told otherwise, will use JDBC tranasactions. Being that no CMT is being started in this case, the underlying connection will have it's autoCommit value set to true (as per the JCA specification), regardless of the type of datasource being used. Note, Hibernate may turn this off/on but JBossJCA will not. 

2) Use CMT or UserTransactions to begin a transaction and have Hibernate participate in this scheme by correctly configuring Hibernate to use a different TransactionStrategy/Lookup. 
    Once you do this, JBossJCA will correctly set the autocommit flag on the underlying connection to participate in the global transaction. 

Again, I need some more information as to what context are you using Hibernate. Are you doing this from a Servlet, from an EJB etc? 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4004554#4004554

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4004554



More information about the jboss-user mailing list