Oracle UCP、v 12.1.0.2.0 を使用しているときに、「 The connection is closed: The connection is closed 」というエラーがランダムに表示されます。接続は oracle.ucp.jdbc.proxy.JDBCConnectionProxyFactory#invoke でクローズ済みとしてマークされているようです:
if(Clock.isBefore(this.creationTS, this.m_jdbcPooledConnection.getAvailableStartTime()) || Clock.isBefore(this.creationTS, this.m_jdbcPooledConnection.getBorrowedStartTime())) {
this.m_closed = Boolean.valueOf(true);
}
Clock.isBefore(this.creationTS, this.m_jdbcPooledConnection.getAvailableStartTime()) は true を返します。
誰かがこのチェックの目的を説明してもらえますか?
getAvailableStartTime は接続がプールに戻されるときに設定され、creationTS - JDBCConnectionProxyFactory が作成されるときに設定され、接続を放棄するときに作成されます。
isBefore は次のようになります。
public static boolean isBefore(long time1, long time2) {
return time1 < time2 - 1000L;
}
では、接続が戻ってきたのが 1 秒未満の場合が条件でしょうか。
PS:検証クエリ「select 1 from dual」を試しました-効果なし