This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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?
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.