Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA Transaction management

 
sachin y deshpande
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sachin yd " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
sachin y deshpande
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just updating the code (missed adding the objects to be persisted in the BusinessComponent code...)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic