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

Transaction in BMP and CMP

 
Alex GeorgeAlex
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning Ladies and Gentlemen,
I am confused by the way BMP and CMP support transactions. Both BMP and CMP support transactions. But why is it that I have to have the code to manage transactions in BMP and not in CMP? Is it true that the container wouldn�t roll back the transaction if a system error thrown? My container let me choose any of the 6 the transaction attributes for BMP and CMP. Any help appreciated.
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BMP - As a Bean Programmer you have manage transaction.

CMP - Container will do the transaction, but you have to tell container which business methods you want conatiner to execute using DD.

Advantage of BMP is, you can have more flexbility than CMP.

DisAdvantage of BMP is, when you want to change the transaction behaviour you need modify the code.But in CMP, you just need to change the transaction attribute mentioned in DD.

HTH,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic