Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BMT inside BMP

 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can i have a bean managed transaction inside a entity bean of bean managed persistence ?
I havent tried this. If any one knows about this or worked on this, pls help
Hari
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean a JTA transaction instead of JTS( container-provided) transaction?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Entity beans are container managed and u cannot use bean managed Tx.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could, however propagate an explicit JTA transaction to an enity bean.
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
So if iam using BMT i can use only inside my session beans ?
Pls correct me if iam wrong
Hari
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Section 17.3.1 of the EJB 2.0 Specification:
A Session or Message-driven Bean can be designed with bean-managed transaction demarcation or with container-managed transaction demarcation. (But it cannot be both at the same time.)
An Entity Bean must always be designed with container-managed transaction demarcation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic