*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes PrePassivate and PostActivate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "PrePassivate and PostActivate" Watch "PrePassivate and PostActivate" New topic
Author

PrePassivate and PostActivate

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Where and how does the container knows that it has to Passivate a bean?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The spec leaves the container provider free to deal with this. It may depend on a timeout (bean not being used) , or on some resources getting low. I think that some container will let you configure some of it.


[My Blog]
All roads lead to JavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Or it could be configurable in the DD?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

No. I think it will be configured in the container's own descriptor file.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Still not convinced. Anyways thanks for the help Christophe.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Still not convinced.

For example, look at JBoss. These kind of settings can be done in jboss.xml.
Rajesh So
Ranch Hand

Joined: Oct 08, 2002
Posts: 136
Hi Christophe,

Could you please help me on the container settings in Glassfish, so that the @prePassivate can be invoked.

Regards,
Raj
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Go to the Admin Console (http://localhost:4848/). Go to Configuration/EJB Container. You can change the value for Cache Idle Timeout. (It defaults to 600 seconds)
 
 
subject: PrePassivate and PostActivate