> -----Original Message----- > From: Romain Manni-Bucau [mailto:[email protected]] > Sent: Thursday, January 19, 2017 12:53 AM > To: [email protected] > Subject: Re: How do deal with occasional "Failed to validate a newly > established connection." > > Hi > > maybe try setting LogValidationErrors to true or activate debug log, you > will see the cause
How do I turn on LogValidationErrors? I found info on that flag, but it's buried within a lot of other stuff, and I don't see a clear way to manipulate these settings. > 2017-01-19 2:01 GMT+01:00 KARR, DAVID <[email protected]>: > > > 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? > >
