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

CMT for Stateless beans - EJB 3 In Action

 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB 3 In Action wrote:If you are using a stateful session bean and need to maintain a transaction across method calls, BMT is your only option.


Does this mean that we cannot use use CMT for stateful beans?
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can.
But for CMT, a transaction will start before a method is invoked, and end after the method is executed.
So (please read your quote).
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But why stateful ?
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because in stateless bean/mdb , you could maintain state across method call.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jim li wrote:because in stateless bean/mdb , you could maintain state across method call.

Are you sure? I don't think so. Or you want to say the opposite?

For Stateless session bean as the name suggested, it's "stateless", there is no state maintained across several methods.
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya , it is opposite, i should double check my post, sry...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic