Question

I'm new in EJB. I've read that one of the side effects of bean-managed transactions (BMT) is that transaction doesn't propagates if we call method of another BMT bean. But due to the third ACID property (isolating) does it mean that the second method (inner) won't see the changes that were made in the first methods (outer)?

Was it helpful?

Solution

Bean-managed transactions only means that you code the transaction boundaries in your bean yourself.

Whereas Container-managed transactions means that you let the container (i.e. the application server) do the dirty work of opening, closing, rollbacking, ... your transactions for you.

In both cases, usually some central TransactionManager is used to access the current transaction or create a new one.

does it mean that the second method (inner) won't see the changes that were made in the first methods (outer)

If you use the same TransactionManager (and the same Transaction) in both methods, the inner method should see the changes of the outer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top