Hi,

I am using the below configuration for creating a datasource in Tomcat
7.0.42. And the backend database is Oracle 10g.

<Resource name="jdbc/crd"
  auth="Container"
  type="javax.sql.DataSource"
  factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
  driverClassName="oracle.jdbc.driver.OracleDriver"
  username="xxxx"
  password="xxxx"
  url="jdbc:oracle:thin:@xxxx:xxxx:xxxx"
  initialSize="10"
  minIdle="20"
  maxIdle="40"
  maxActive="100"
  maxWait="60000"
  validationQuery="SELECT 1 FROM DUAL"
  validationInterval="300000"
  testOnBorrow="true"
  testOnReturn="true"
  testWhileIdle="true"
  minEvictableIdleTimeMillis="1800000"
  timeBetweenEvictionRunsMillis="60000"
  removeAbandoned="true"
  removeAbandonedTimeout="600"
  logAbandoned="true"
  jmxEnabled="true"
  jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;
org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx(threshold=10000)">
</Resource>

Now the problem is whenever I try to get a connection from pool, it is
creating a new connection and returning back.
minIdle connections are not maintained in the pool and when I call
con.close(), the connections are getting closed instead of returning to the
pool (closing the connection in finally block by passing con object to a
different method)

Getting connection is taking considerable amount of time in my application,
so I need the tomcat server to maintain the idle connections at any point
of time.
Kindly help me resolve the issue.

Thanks
Srikanth

Reply via email to