Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why not usertransaction instead of SessionSynchronization in SessionBean

 
Sanju
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In Session Bean we can use SessionSynchronization. Why not usertransaction instead of SessionSynchronization? what is the major advantages SessionSynchroniation interface?

Regards,
Sanju.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please correct this:

The SessionSynchronization interface is used with BMT

With:
The SessionSynchronization interface is used with CMT
Sorry...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic