Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The EJB specification says that we cannot use Bean Managed Transaction in Entity Beans. Why?

0
Posted

The EJB specification says that we cannot use Bean Managed Transaction in Entity Beans. Why?

0

– The short, practical answer is� because it makes your entity beans useless as a reusable component. Also, transaction management is best left to the application server – that�s what they�re there for. It�s all about atomic operations on your data. If an operation updates more than one entity then you want the whole thing to succeed or the whole thing to fail, nothing in between. If you put commits in the entity beans then it�s very difficult to rollback if an error occurs at some point late in the operation.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123