Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SessionSynchronization interface ?? PlS help

 
Dilip Gamage
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we using session Syn.. Interface in CMT stateful session beans

How do we implement ?? Is that implimented by container ?

Let say "afterBegin()" method. Is that call inside a method ? Or we need to code explicitly.

Please my idea about like this Tell is that correct or not ?

Inside CMT bean
.. someMethod(){
.....
........
ss.afterBegin();
this.method1(); <-- metod 1 & 2 are in Transaction context
this.method2(); <--

ss.beforCompleation();
ss.afterCompleation(true);
}



Or PLEASE LET ME SHOW VERY SIMPLE CODE
 
M Murthy
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

SessionSynchronization interface can be optionally implemented by a CMT Stateful Session bean. The 3 methods of this interface are container callback methods, meaning that the container will call these methods at the appropriate time during a transaction and execute any code you have written in them. These methods can be used to know the transaction boundaries for a CMT bean.

Below is an outline:


What functionality can be put into these 3 methods can be found in the spec on page 74. Also in HFE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic