Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

shutdown hook for JNDI custom resource factories???

Jacob Kjome

2004-01-27



I have implemented a custom JNDI resource factory according to the
documentation here...
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html#Adding%20Custom%20Resource%20Factories

The Object that gets returned from this factory uses the
JDOHelper.getPersistentManagerFactory() to return a JDO Persistence Manager
Factory object (PMF). The PMF is supposed to be closed and I found that
when I was creating storing the PMF in a servlet context listener and
creating it on startup, if I didn't shut it down upon application shutdown,
upon application reload I would get a java.lang.ThreadDeath.

Am I going to have to grab the object from JNDI in the shutdown() method
and then do myobj.pmf().close()? Is there a better way to do this without
having to use a servlet context listener? Maybe configurable through the
JNDI configuration?


Jake


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.