ENTITY bean with CMT: one limitation: When a method is executing, it can be associated with either a single transaction or no transaction at all.
This means that in the case of other Transaction mechanism say BMT (session beans), a method can be associated with more than one transaction?
I really don't understand this limitation. Can anyone explain?
Thanks, Guru
Gurumurthy Ramamurthy
Ranch Hand
Joined: Feb 13, 2003
Posts: 272
posted
0
any answers guys?
Valentin Tanase
Ranch Hand
Joined: Feb 17, 2005
Posts: 704
posted
0
Hi Guru,
This means that in the case of other Transaction mechanism say BMT (session beans), a method can be associated with more than one transaction?
If a method runs within a transaction, then the whole bean (not only one single method) is reserved by that transaction. No other transactions can access the same bean and therefore the bean cannot be associated with two different transactions. Now the question is can the same client start another transaction within the first one (nested transaction) having the bean associated with two different transactions? You might notice though that this is not quite possible because J2EE doesn�t support nested transactions. However there is one way to overcome this limitation, if the underlying database supports nested transactions and the db vendor provides a jdbc driver with the same capability. Then using BMT and JDBC transaction you�ll be able (at least in theory) to associate the bean with more than one transaction. Regards.