tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mean_bcp <gosw...@versatilets.com>
Subject JDBC connection pool: Closed connections
Date Mon, 03 Oct 2016 17:42:20 GMT
Using the default connection pooling, with test on borrow set to true. Why
would a connection sometimes be closed right after I get it from the data
source? Any suggestions to optimize my config?

resources.xml:

<resources>
	<Resource id="dolleeDb" type="DataSource">
		JdbcDriver oracle.jdbc.OracleDriver
		JtaManaged false
		UserName dollapp
		Password dollapp
		ConnectionProperties oracle.jdbc.ReadTimeout=5000;
		ValidationQuery select 1 from dual
		TestOnBorrow true
		InitialSize 20
	</Resource>
</resources>

java:

conn = ds.getConnection();

(datasource initialized here:)

Context initCtx = new InitialContext();
String dsName = props.getProperty("db.datasource")
String s = "openejb:Resource/" + dsName;
DataSource ds = (javax.sql.DataSource) initCtx.lookup(s);

Stacktrace:

java.sql.SQLRecoverableException: Closed Connection
        at
oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:5216)
        at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
        at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
        at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:80)
        at com.sun.proxy.$Proxy65.getMetaData(Unknown Source)
        at
com.comcast.dollee.common.GenericDAO.initConnection(GenericDAO.java:76)
        ...



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JDBC-connection-pool-Closed-connections-tp4680278.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message