• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot activate my Stateful Session Bean after it was passivated  RSS feed

 
Oliver Meiser
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Stateful Session Bean cant be activated after passivation.
Using Jboss 3.2.6

--------------------------------------------
Session Bean is instantiated perfectly:
BerichtBean setSessionContext called for bean=session.BerichtBean@1868e75
BerichtBean ejbCreate called for bean=session.BerichtBean@1868e75

its handle is:
berichtHandleId=org.jboss.proxy.ejb.handle.StatefulHandleImpl@1bda1e0

passivation after rougly 12 minutes:
ejbPassivate() called by container

when I want to use the Passivated Bean Instance again with the handle (StatefulHandleImpl@1bda1e0) i used before passivation I see following strange things happening on the console:
BerichtBean setSessionContext called for bean=session.BerichtBean@122152b
BerichtBean setSessionContext called for bean=session.BerichtBean@7fb878
BerichtBean ejbActivate called for bean=de.steria.ignis3web.ejb.session.BerichtBean@7fb878
----------------------------------------------


Instead of a simple ejbAcivate() for bean BerichtBean@1868e75
the container calls twice setSessionContext for non existant Beans
(BerichtBean@122152b and BerichtBean@7fb878) and then activates one
of them!!! And that Bean is the Bean where my handle points to from
now on!!!

Any ideas what the container is doing there?
Happy for any ideas ...

Cheers and Best Regards,
Oliver
 
Jesus Angeles
Ranch Hand
Posts: 2069
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When passivating, the container will save your state somewhere. That instance can be used by other processes.

When activation comes for your passivated thingy, the container finds an available instance, and restores your state, in that instance, which may or may not be the same instance you had before. Regardless, at your point of view, you are dealing with same thingy.
 
Oliver Meiser
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fantastic - then i just worry about the fact that the container is running twice setSessionContext() ...

---------------
BerichtBean setSessionContext called for bean=session.BerichtBean@122152b
BerichtBean setSessionContext called for bean=session.BerichtBean@7fb878
---------------

... because a enduser like me could think that one call of setSessionContext() would be enough for the container when creating a new instance with the serialized sessionbean. so why is there a call call on ..
BerichtBean setSessionContext called for bean=session.BerichtBean@7fb878 ... is it a temporary session bean used by the container?

thanks
oliver
 
Oliver Meiser
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The biggest problem I forgot about is that a member-variable in my passivated session bean equals null after reinstanciating it. What do I have to do, to have the session bean in the exact same state as before passivation? Remember - I am not receiving any exceptions at passivation time - so it seems that serialization works (all variables can be serialized)!?

thanks heaps
oliver
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!