Howdy, AFAIK there's no explicit lifecycle support around these resource factories. I would suggest adding a finalizer to the PMF class, but that's a 3rd party class outside your control. I think grabbing it from JNDI in the shutdown method is what's left. I'm not happy with it because it's too heavyweight an operation for shutdown, but...
Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Jacob Kjome [mailto:[EMAIL PROTECTED] >Sent: Tuesday, January 27, 2004 12:48 AM >To: 'Tomcat Users List' >Subject: shutdown hook for JNDI custom resource factories??? > > >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: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
