On 21/03/18 13:50, Christopher Schultz wrote: <snip/>
> Hmm, I'll take a look at that. > > This Listener predates a lot of Tomcat's more recent capabilities. I > know that there is a tension between the officially-documented > behavior of JNDI DataSources (you always get a new DataSource) and > what webapps usually do (always go to JNDI to get the DataSource) and > so Tomcat has options by default that re-issue the same DataSource to > code. > > It used to be that failing to dispose of the DataSource left it > hanging around. That seemed unclean to me, so I wrote the > ServletContextListener to shut it down cleanly. I'm sure that was the case a while ago. Probably far enough back that it was before all the work on memory leak detection and prevention. > My JDBC library is in Tomcat's lib/ directory for a handful of reasons > (not the least of which is that Connector/J team can't seem to figure > out how to let client code shut down the Threads it creates -- > stupidly I might add). Does that impact whether or not Tomcat will > auto-close the DataSource? That should make no difference. > The <Resource> itself is defined in the application's > META-INF/context.xml file and nowhere else. How does that impact things? That is a requirement. It has to be defined in the app to be stopped when the app stops. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org