Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Ejb Transactions  RSS feed

 
Robin Ranga
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Difference between Bean Managed transactions and container managed transactions.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One type is managed by the Bean, the other by the container. I'll leave you to guess which is which. Simple as that.
 
Ali Aman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the Entity bean has some abstract functions in the EJBObject interface...

Example create, remove etc...

By simply providing the primary key as an argument i.e.
create(primary_key) the container automaticaly inserts a record in a table.. similarly there is another function remove thru which one can simply call the function like this... remove(primary_key) and the container would remove the record in the table...

However if the developer wishes to perfrom these transactions by running sql scripts he uses bean managed transactions and codes it thus called Bean Managed Trasactions.
 
Sri Ram
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Ali Aman

I think the definition what u gave is for the difference between CMP(and BMP beans

CMP == Container Managed Persistence

BMP == Bean Managed Persistence

Transaction is something similar to the Database transaction,if u wanna write any transaction code in your bean using the services of JTS or JTA you go for Bean Managed Transaction

and when u allow the container to manage the same its called Container managed Transaction

The transaction attribute of the bean is defined in the transaction type tag in the ejb-jar.xml (Deployment descriptor)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!