| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I am porting an application to container-managed JPA. In my EJB, I now have a function that does something like this: function CreateAccount() { Person p = new Person(); Address a = new Address(); .... em.persist(p); em.persist(a) .... } In my Web page that uses the EJB, I have added a transaction manager like this: InitialContext context = new InitialContext(); UserTransaction tx = (UserTransaction) context.lookup("java:comp/UserTransaction"); tx.begin(); myEjb.CreateAccount(); tx.commit(); my question is, if the call to em.persist(a) fails, will the persistence of p roll back? I'm going to test it out. Feel free to comment. Thanks, Eric -- View this message in context: http://n2.nabble.com/Transaction-que...1p1095461.html Sent from the OpenJPA Users mailing list archive at Nabble.com. |
|
#2
| |||
| |||
| > if the call to em.persist(a) fails, will the persistence of p roll back? Yes. -- View this message in context: http://n2.nabble.com/Transaction-que...1p1096608.html Sent from the OpenJPA Users mailing list archive at Nabble.com. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.