Ah, so what you ask is not "how can a SSB get a reference to it EJBObject during ejbCreate?" but "how can a SSB know which instance of the EJBObject it belongs to, during ejbCreate?".
Easier to discuss if discussion is not limited to ejbCreate, since I cannot think of a good reason I'd want to, but rather to anywhere in the bean - you might want to call another business method in another transaction context, so you cannot call it directly in the bean.
Since all stateless session beans are identical (isIdentical is always true for beans of the same class) it doesn't matter which instance of the bean you are directed to. (Unless you intend to modify a global variable, in which case your code needs to be redesigned )
So I guess the answer would be - it doesn't matter which instance of the EJBObject you use, so you can use any, on the containers discretion.
Did this answer your question? [ October 19, 2006: Message edited by: �dne Brunborg ]
Say for example the container creates a stateless session bean and put it in the pool and invoked ejbCreate(). If no client ever came along and called EJBHome.create() then no EJBObject would ever be created. In which case how could a stateless session bean ever refer to an EJBObject if one has never been created.
The client does not actually create the EJBObject by calling the EJBHome.create(), but rather asks for a reference to an instance of the EJBObject. If the container already has a session bean of this type available, then a reference to this is passed, if not a new one is created.
Only the container creates EJBObjects. [ October 19, 2006: Message edited by: �dne Brunborg ]
Entia non sunt multiplicanda praeter necessitatem
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop