Tuesday, July 14, 2015

Occasional dropped JDBC connections with Integrated WLS in JDeveloper 11.1.1.6

Environment / assumptions for this post:

  • JDeveloper 11.1.1.6 and Integrated Weblogic Server
  • WLS Console application
  • JDBC Datasource configuration


I was getting an inconsistent error relating to configuration of a datasource on my local JDeveloper's Integrated Weblogic Server.

java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:dsname, props = {EmulateTwoPhaseCommit=false, connectionPoolID=dsname, jdbcTxDataSource=true, LoggingLastResource=false, dataSourceName=dsname}.
Nested Exception: java.lang.RuntimeException: Failed to setAutoCommit to true for pool connection.
at weblogic.jdbc.wrapper.PoolConnection.init(PoolConnection.java:47)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:252)
at weblogic.jdbc.pool.Driver.connect(Driver.java:163)

In the end, to make sure WLS new about the dead connections we configured two things in the Weblogic Datasource, under Advanced tab: the Test Connections on Reserve and also Seconds to Trust an Idle Pool Connection.

Weblogic Datasource configuration - Test Connections on Reserve, and
Seconds to Trust an Idle Pool Connection