Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fundamental issue in connection pooling of Tomcat

I am using Tomcat 7 connection pooling (as a Tomcat resource in server.xml and context.xml) in a web application and it works.
My question is: Is it possible to "tell"/"force" tomcat to dispose the connection pool after it is created?

The reason I ask is the following:
I am using H2 and run into some "racing" issue on shutdown.
H2 remains open as long as there is a connection open but Tomcat does not dispose the connection pool and so connections remain open. And as a result I have various issues on shutdown.

I found that I could issue an SQL SHUTDOWN command to close H2 but I want to explore all the alternatives for my case.

So is it possible to "tell"/"force" tomcat to dispose the connection pool (at least on shutdown)?

like image 621
Jim Avatar asked Apr 03 '12 06:04

Jim


1 Answers

I think you can try to put debug log on and check whether its issue with connection not released by application or something else like datasource configuration parameter in server.xml.

mostly it should be the case where application is not releasing connection.

like image 185
Vh24 Avatar answered Oct 05 '22 23:10

Vh24