Cleanup c3p0 connection pools if used
Jetty and c3p0 leak all of the connections unless our own application
tells c3p0 to cleanup while Jetty is winding down the context in order
to load it again. There's some sort of disconnect in the standards,
or in the Jetty code, where the c3p0 DataSource pool doesn't get GC'd
automatically. In order to close the connections down we need to do
a destroy on the pool ourselves.
Since we don't want to make c3p0 a hard dependency we invoke destroy
via reflection.
Signed-off-by: Shawn O. Pearce <sop@google.com>
2 files changed