tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: How do deal with occasional "Failed to validate a newly established connection."
Date Thu, 19 Jan 2017 08:52:52 GMT
Hi

maybe try setting LogValidationErrors to true or activate debug log, you
will see the cause


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-01-19 2:01 GMT+01:00 KARR, DAVID <dk068x@att.com>:

> 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?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message