[jboss-user] [Beginner's Corner] - Re: Create stateless bean from stateful bean

jaikiran pai do-not-reply at jboss.com
Mon Jan 3 06:49:40 EST 2011


jaikiran pai [http://community.jboss.org/people/jaikiran] created the discussion

"Re: Create stateless bean from stateful bean"

To view the discussion, visit: http://community.jboss.org/message/578014#578014

--------------------------------------------------------------
I'm not quite sure I completely understand the question.

> piotrekde wrote:
> 
> 
> 
> I know, that if I obtain a reference by JNDI to the bean, then I've got proxy object, but behind it, actually might be 10 stateless beans doing its work.
Yes, you get a proxy and then when a method is invoked on that proxy, typically an instance of a SLSB is picked up from pool and the method is invoked on that instance.

> piotrekde wrote:
> 
> 
> But what if I am on the same virtual machine?
> 
> 

You mean same JVM? I would say it doesn't make any difference, but I haven't yet understood the question, so I might be missing something.

> piotrekde wrote:
> 
> Should I use @EJB annotation or maybe ordinary constructor?
Never instantiate EJBs (or any server managed components) via the constructor invocation. Doing so will strip off all the server provided services off those components (for example, the instances will no longer be having any transaction or security semantics).
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/578014#578014]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110103/f3291b9c/attachment-0001.html 


More information about the jboss-user mailing list