Which of the following statements are true about a stateful session bean?
-
An ejbRemove() call from the container removes the bean instance and puts it out for the garbage collector.
-
An ejbCreate() call is made by the container only when a client invokes a create method.
-
You can get the security information about a client from inside the ejbCreate() method.
-
The container will call the setSessionContext() method only once.
-
All of the above.
Option A is incorrect because the container manages stateful session beans in a pool - ejbRemove() makes the instance eligible for pooling, not immediate garbage collection. Option B is incorrect because stateful session beans can be created through various means including dependency injection or lookups, not just explicit client create calls. Option C is incorrect because security context isn't available in ejbCreate() for stateless beans. Option D is correct - setSessionContext() is called exactly once per bean instance when it's first created.