File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
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: 2848

"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:
subject: JPA Transaction management
It's not a secret anymore!