Hi,
I am a newbie to EJB stuff. Can I call stateful/enity bean from a stateless session bean? I mean inside a method can we call it?
If yes, can anyone tell me in detail how this will work?
Thanks in advance!
Bhaskar
Knowledge shared is knowledge gained!
-
stateless session bean (3 messages)
- Posted by: Bhaskar Yallala
- Posted on: December 16 2002 09:24 EST
Threaded Messages (3)
- stateless session bean by Web Master on December 16 2002 09:40 EST
- stateless session bean by Bhaskar Yallala on December 16 2002 11:57 EST
- stateless session bean by Web Master on December 16 2002 12:28 EST
- stateless session bean by Bhaskar Yallala on December 16 2002 11:57 EST
-
stateless session bean[ Go to top ]
- Posted by: Web Master
- Posted on: December 16 2002 09:40 EST
- in response to Bhaskar Yallala
Yes of course you can...the Session Facade does exactly this. Your Session bean is a client to other beans in your system, just as any other client. You can also make use of local interfaces and resource references when invoking EJB's from other EJB's in the same container.
you can setup a resource reference to an EJB and then use java:comp/env/some-name to access it from aonther EJB in the same container. -
stateless session bean[ Go to top ]
- Posted by: Bhaskar Yallala
- Posted on: December 16 2002 11:57 EST
- in response to Web Master
Thanks for the reply. But how stateless bean will be managed in pool. Because, it has connection to stateful session bean?
Can you please clarify more?
Thanks
Bhaskar
Knowledge share dis knowledge gained! -
stateless session bean[ Go to top ]
- Posted by: Web Master
- Posted on: December 16 2002 12:28 EST
- in response to Bhaskar Yallala
Well, at first glance, it seems strange to have a Stateless bean hang onto a reference to a Stateful bean. The reverse of that makes sense but not what youve mentioned does not. I think you either want your clients to deal with a Stateless bean OR a Stateful bean (if you need to track state on subsequent calls). I dont see any benefit of using a Stateless bean as a facade to a Stateful bean...just go straight to the Stateful bean. In fact, you'll actually lose any state your trying to keep if your client code doesnt hang onto the Stateful bean's home or handle directly. Your client code will never actually know which Stateful bean is being used if its hidden behind a Stateless bean.
Does that make sense? If I have assumed to much about your app and you truly need to have Stateless bean use a Stateful bean, then its sounds tricky. Good luck ;)