Hi All,
I am creating a Database connection pool in my application(With Tomcat Server). I am using org.apache.tomcat.jdbc.pool. but my applications requirement is to configure databse connection pool properties in external xml file (I can not use server.xml or context.xml).I am configuring pool configuration in custom xml file and put it in tomcat/conf/appname/appname.xml file
I am doing it so that we can change data base configuration at runtime with out restarting the server.
I have created connection pool in contextInitialized() method. and using DataSource I am getting connections from this database pool.
But everytime if I make multiple requests to application. it sometimes give "
pool exhausted exception",
connection is already closed or Timeout: Pool empty. Unable to fetch a connection in x seconds, none available.
But if I use tomcat context.xml, it doesn't give any error and works well for multiple requests.
I am closing ResultSet, Statement and connection objects properly in the code.
Also I have read somewhere that I am closing proxy connections not real connection .
Please help me.