Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem when using ejbPassivate() and ejbActivate()

Status
Not open for further replies.

jameslu

Programmer
Nov 21, 2002
8
GB
Hi,

I'm trying to use a simple Java client to make calls to an EJB which is made available via a WebLogic server.

I've got the whole thing setup so it's working fine - except when I try to test the passivation and activation functionalities.

I've setup the WebLogic deployment descriptor for the container running the bean so the caching configurations are as follows:

<max-beans-in-cache>4</max-beans-in-cache>
<idle_timeout-seconds>5</idle_timeout-seconds>
<cache-type>LRU</cache-type>

I've hard-coded the output so I can see when ejbPassivate() and ejbActivate() are called etc. Passivation has started to work since my Java client runs five threads and it seems to call five beans in succession (each thread has a five second interval between each invocation):

<ejbPassivate() called>
<ejbPassivate() called>
<ejbPassivate() called>
<ejbPassivate() called>
<ejbPassivate() called>

However, say when I run the Java client straight after it has finished in an attempt to try and get the beans which have passivated to try and activate, it just outputs:

<ejbPassivate() called>
<ejbPassivate() called>
<ejbPassivate() called>
<ejbPassivate() called>
<ejbPassivate() called>

In conclusion, I cannot seem to ever get the caching facility to call ejbActivate()??!!

Please help as I'm really out of things to try!

Many thanks,

James
 
I think you should create a entity bean with your Java client, then ejbActivate() with be called. ejbPassivate() is a method that called by app server after an entity bean has been activated.
I have learned how to use weblogic but i need to learn websphere because the market of weblogic is very small here.
Tell me if i am wrong.
 
Aren't these methods usually only useful for Stateful Session Beans?

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
Yes - due to certain constraints, I can only create stateful session beans.

Please help!!

Thanks,

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top