c3p0连接池错误 - Oracle RAC

时间:2015-12-22 06:31:27

标签: connection-pooling c3p0

在一个节点关闭的2节点集群上,可以看到以下c3p0错误:

2015-11-10 10:00:25,655 | WARN  | scheduler-1          | org.apache.log4j.Category | Exception on close of inner statement.
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.needLine(PhysicalConnection.java:5416)
    at oracle.jdbc.driver.OracleStatement.closeOrCache(OracleStatement.java:1585)
    at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:1570)
    at oracle.jdbc.driver.OracleStatementWrapper.close(OracleStatementWrapper.java:94)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.close(OraclePreparedStatementWrapper.java:82)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.close(NewProxyPreparedStatement.java:1811)

上面的警告后面是:

2015-11-10 10:00:25,668 | WARN  | DefaultQuartzScheduler_Worker-10 | org.apache.log4j.Category | [c3p0] Another error has occurred [ java.sql.SQLRecoverableException: Closed Connection ] which will not be reported to listeners!
    java.sql.SQLRecoverableException: Closed Connection
        at oracle.jdbc.driver.PhysicalConnection.needLine(PhysicalConnection.java:5416)
        at oracle.jdbc.driver.OracleStatement.closeOrCache(OracleStatement.java:1585)
        at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:1570)
        at oracle.jdbc.driver.OracleStatementWrapper.close(OracleStatementWrapper.java:94)

根据Steve Swaldman对c3p0 github page的评论,这些警告与无效/陈旧的连接相关联。

因此,在一个实例关闭的oracle RAC环境中,当节点启动并运行时已经获得的连接会发生什么?在大多数情况下,数据库操作在节点关闭后工作正常。只有少数插入失败,抛出上面的警告。 c3p0连接池是否适合在RAC环境中使用?

有关警告的更多信息:http://sourceforge.net/p/c3p0/mailman/message/18310863/

1 个答案:

答案 0 :(得分:1)

上面显示的警告看起来不是问题。 c3p0试图清理父Connection已经关闭()编辑的语句。

通常,c3p0将在常见配置下从数据库输出中正常恢复。但是你可能会看到一些警告和异常,因为测试开始失败,然后尝试清理的东西也失败了。

c3p0应该可以与Oracle RAC一起使用。但是,Oracle的Universal Connection Pool提供了c3p0未提供的special support for RAC-specific features