users@glassfish.java.net

Re: Stateless EJB not "destroyed" at Glassfish shutdown

From: <glassfish_at_javadesktop.org>
Date: Thu, 15 Apr 2010 07:16:05 PDT

Hi Dominik,

This is a subtle distinction but the spec doesn't actually mandate that @PreDestroy for a stateless session bean be called upon server shutdown. It's up to the container when to destroy a stateless session bean instance. @PreDestroy only ensures that when the container *does* destroy a bean instance, the application is notified.

Having said that, from an implementation perspective it's certainly desirable for the container to neatly clean up all resources on server shutdown and undeployment. This was a bug in V2 which has been fixed in V3.

 --ken
[Message sent by forum member 'ksak']

http://forums.java.net/jive/thread.jspa?messageID=397153