Win a copy of Spark in Action this week in the Open Source Projects forum!

William Parker

+ Follow
since Apr 26, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by William Parker

As regards q42, an Unspecified Transaction Context is different from no transaction context. setSessionContext() and afterCompletion() methods have no transaction context, whereas ejbCreate will run in a UTC.

p499 of HFEJB states all methods which will run in a UTC. If you look at the spec, Section 17.6.5, page 363 this gives more detail on what a method in an unspecified transaction can do. You can still access Resource Managers and other beans from within an unspecified transaction context.

I think you are definitely right with q49, though I must confess I never noticed it myself!
Thanks guys - Kathy's explanation helps to make sense of this!

I am studying for the SCBCD exam and I would appreciate if someone is able to shed some light on a puzzling aspect of the specification....

According to HFEJB and the spec, within the ejbCreate method of a stateless session bean, you should be able to get a reference to your EJBObject through the SessionContext. How is this possible?

It seems to contradict the lifecycle of a stateless session, which states that the constructor, setSessionContext and ejbCreate are called by the container at a completely independent time from a call by the client, and are taken from the pool only to service a business method call, then put back immediatly after. This would seem to indicate that the bean is only connetced to an EJBOBject at the time the client calls a business method, and could be linked to a different EJBObject each time it is pulled from the pool.

So, as the ejbCreate method is only called once, at bean creation, (unlike entity beans), I can't understand how the SessionContext can have a reference to an EJBObject???

Me is very confused.....can anyone help?