[jboss-user] [JBoss Seam] - Re: Building parent and child in one page

mustaghattack do-not-reply at jboss.com
Sat Jun 9 11:51:44 EDT 2007


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



More information about the jboss-user mailing list