I've got a small app running in Tomee.  It runs a couple of Oracle db queries 
every two minutes.  I'm getting errors like this every once in a while:
---------------
Caused by: java.sql.SQLException: Failed to validate a newly established 
connection.
        at 
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:822)
        at 
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:633)
        at 
org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:187)
        at 
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:132)
        at 
org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.newConnection(ManagedConnection.java:180)
        at 
org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(ManagedConnection.java:109)
        at com.sun.proxy.$Proxy73.createStatement(Unknown Source)
        at 
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:402)
        ... 51 more
------------------

The datasource in tomee.xml is defined like this:
--------
  <Resource id="tst36" type="DataSource">
        testOnBorrow = true
        testOnReturn = true
        testWhileIdle = true
        validationQuery = "select 1 from dual"
        JdbcDriver = oracle.jdbc.OracleDriver
        MaxActive = 10
        MinIdle = 2
        MaxIdle = 2 
        MaxWait = 10000
        JdbcUrl = jdbc:oracle:thin:...
        UserName = ...
        Password = ...
  </Resource>
------------

Can I tweak these settings to avoid that error?

Reply via email to