File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Stateful Session Beans and transactions 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 "Stateful Session Beans and transactions" Watch "Stateful Session Beans and transactions" New topic
Author

Stateful Session Beans and transactions

Rowan Mayfair
Greenhorn

Joined: Sep 24, 2007
Posts: 1
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

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stateful Session Beans and transactions