Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stateful Session Beans and transactions

 
Rowan Mayfair
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering that if say a container managed trasanction starts with StatelessSessionBean A -> which then calls StatefulSessionBean B create method. Later during the same transaction another method calls the create method on StatefulSessionBean B, will the same StatefulSessionBean with the same state be returned from the first call? Or will the second or any subsequent create calls within the same transaction to the StatefulSessionBean just create a brand new instance as if coming from a different client?

Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateful session beans are tied to a single session - one principal cannot have two instances of a specific bean. If a client makes a call to a SFSB and the same client makes another call before the method has returned (i.e. if the client is multithreaded) you will get an exception since concurrent calls to SFSBs is prohibeted by the spec.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic