[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - dangerous transaction

javatwo do-not-reply at jboss.com
Fri Feb 1 21:25:45 EST 2008


I use JBoss 4.0.5 GA. JSF web application

create a thread local userTransaction 

userTransaction.begin()   // in JSF before invoke application phase 

em.persist(entity1)     //create entity in session bean using entity manager
...
do something that throw exception
cought the exception and indicate the transaction need to rollback
 
userTransaction.rollback()  //  in JSF after invoke application phase 

but entity1 is created in database.

I debugged the code, the rollback was called.

Thanks for help.
Dave




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

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



More information about the jboss-user mailing list