jQuery in Action, 3rd edition
The moose likes EJB and other Java EE Technologies and the fly likes JPA Transaction management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JPA Transaction management" Watch "JPA Transaction management" New topic

JPA Transaction management

sachin y deshpande

Joined: May 12, 2004
Posts: 20
We are developing an Application Managed JPA application.

The structure of the application is
Business Components which have business logic.
Tool generated DAO layer (JPA Managers and JPA Entities)

The usage would be like

Note: JPA Managers do invoke any transaction related APIs.

1) Is this valid code? i.e. would the update happen in a single transaction even if the EntityManagers obtained by all the classes (BusinessComponent, JPAEntity2Mgr, JPAEntity1Mgr) are different?
2) Is there a need to invoke the em.joinTransaction() api in the JPA Managers?
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

"sachin yd " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.

|Asking Good Questions|
sachin y deshpande

Joined: May 12, 2004
Posts: 20
Just updating the code (missed adding the objects to be persisted in the BusinessComponent code...)
I agree. Here's the link: http://aspose.com/file-tools
subject: JPA Transaction management
It's not a secret anymore!