Thank for your reply Pete.

I tried nested conversation without success. The problem is that you get the 
same persistence context even if you use two components. 

I didn't find a solution with JTA as well :
- Start a transaction with entity manager 1
- Persist the parent

- Start a transaction with entity manager 2
- merge the parent in the new persistence context
- create a child
- add it to the parent
- persist the child
- commit the transaction
- close entity manager 2

- rollback transaction (EM 1)
=> parent is rolled back but the child is in the database because of the commit 
in the nested transaction.

Do you mean something different by "roll back changes on cancel" ?

How can you use detached entities to solve this problem ?


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052819
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to