Have you set strictMaximumSize to true in the container pool conf. Otherwise the container will create a new instance if the pool is empty. Check the AbstractInstancePool code
Thanks nraghuram first!
Can you give me the detail steps of how to setup the options if we want to see the passivation?
Since I want to limit the pool size to 2, I think I can see the ejbPassivate() is called when I create the third bean, but I see the following message in the message window:
08:46:51,941 INFO [STDOUT] call ejbCreate();
08:46:52,121 INFO [STDOUT] call count();
08:46:52,652 INFO [STDOUT] call ejbCreate();
08:46:52,692 INFO [STDOUT] call count();
08:46:53,202 INFO [STDOUT] call ejbCreate();
08:46:53,233 INFO [STDOUT] call count();
You might see that no passivate functions are called.
Can you tell me what I should do if I want to test the passivation and activation ?
You can log the container activities.
look for log4j.xml in the conf folder of the server and trace org.jboss.ejb.plugins . then you should see the container passivating, activating etc
I have done as you tell me, but I see the passivation and activation in the log file.
I add the "System.out.println("call ejbPassivate()");" in the function ejbPassivate, but no message is given in the console window.
Do you mind giving me an example which includes the configuration file and jar file?
My email is firstname.lastname@example.org!
I am sorry, I want to see I can not see the passivation and activation message in the log file.
You can try adding this to your log4j.xml. It should create a file called ejb.log in your server's log folder
Passivation happens in a separate thread. Its part of the cache policy. You could try to set the overager period in cache policy to a small value to make the container passivate quickly.
Sorry for bothering you again.
I failed once and again. Could you give me an example which you use to test the passivation and activation of stateful session bean?
Please help me and I am crazy because of that.
You can try this config.
As i said earlier, passivation happens in a separate thread and depends on when the bean was last accessed, which is controlled by the max-bean-age attribute. the overager attribute defines what is the time interval betwee two runs of the overager task.
I still get the same result!
Have you tested the passivation and activation of stateful session bean in this version of JBoss? Could you help me test it and send your example to me ?
I havent tested on rc4. Its difficult for me to send the session bean because its part of a large deployment. If you post your example I can try and run it on my setup and see if it works
I am ready for the email.
Do you mind telling me your email?
I have sent an email to you, please help me.