JBoss Community

Re: Is it possible to attach an object to active stateless session bean

created by Christian Groove in EJB3 - View the full discussion

Salut Ilya,

 

thanks for your immediate reply.

 

Maybe you misunderstood me or (possible) my description was not

clear enough. The obhect should only be accessible whiile the

session-ejb method is running. When the EJB invocation is finished

an the control flow will go back to the caller, the assigned object

gets invalid.

 

There is nothing to save between two call,. therefore the stateful session

bean would be a overcastet.

 

=>1)

The object might get assigned, when a request will call an EJB method.

Image your EJB-method saveContract has been invoked. In series some

other methods are called where one will try to get the assigned object

by calling.

     SessElm.getMyObject().

 

In other words: You may also abuse me, not to  pass a ctx handle as

a parameter for each subsequent method invocation !!!

 

=>2) Since the assigned objects lifetime is limited to the duration of

a EJB-sesssion-method, there is no demmand for a cluster safe solution.

 

3) It should run also on other app servers

Reply to this message by going to Community

Start a new discussion in EJB3 at Community