aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Why not usertransaction instead of SessionSynchronization in SessionBean 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 "Why not usertransaction instead of SessionSynchronization in SessionBean" Watch "Why not usertransaction instead of SessionSynchronization in SessionBean" New topic
Author

Why not usertransaction instead of SessionSynchronization in SessionBean

Sanju
Ranch Hand

Joined: Jul 15, 2002
Posts: 53
Hi,
In Session Bean we can use SessionSynchronization. Why not usertransaction instead of SessionSynchronization? what is the major advantages SessionSynchroniation interface?

Regards,
Sanju.


Thank you,<br />Sanju
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Sanju,

The SessionSynchronization interface is used with BMT and allows you to synchronize the instance variables with their corresponding values in the database. UaserTransaction interface on the other hand, is used with BMT and gives you the control over the transaction boundaries. You can have multiple (linear not nested) transactions starting and ending within the same method if you want, etc. This type of granularity you cannot achieve with BMT.
Regards.


I think, therefore I exist -- Rene Descartes
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Please correct this:

The SessionSynchronization interface is used with BMT

With:
The SessionSynchronization interface is used with CMT
Sorry...
 
jQuery in Action, 2nd edition
 
subject: Why not usertransaction instead of SessionSynchronization in SessionBean