aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Entity Bean with CMT question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Entity Bean with CMT question" Watch "Entity Bean with CMT question" New topic
Author

Entity Bean with CMT question

Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 273
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: 273
any answers guys?
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
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.


I think, therefore I exist -- Rene Descartes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Entity Bean with CMT question