/** * Returns true if this connection has been closed. * * @return true if close was called */ @Override public boolean isClosed() throws SQLException { try { debugCodeCall("isClosed"); return session == null || session.isClosed(); } catch (Exception e) { throw logAndConvert(e); } }
/** * INTERNAL. Check if this connection is closed. The next operation is a * read request. * * @throws DbException if the connection or session is closed */ protected void checkClosed() { if (session == null) { throw DbException.get(ErrorCode.OBJECT_CLOSED); } if (session.isClosed()) { throw DbException.get(ErrorCode.DATABASE_CALLED_AT_SHUTDOWN); } }
/** * Returns true if this connection is still valid. * * @param timeout the number of seconds to wait for the database to respond * (ignored) * @return true if the connection is valid. */ @Override public synchronized boolean isValid(int timeout) { try { debugCodeCall("isValid", timeout); if (session == null || session.isClosed()) { return false; } // force a network round trip (if networked) getTransactionIsolation(); return true; } catch (Exception e) { // this method doesn't throw an exception, but it logs it logAndConvert(e); return false; } }
if (!session.isClosed()) { try { closePreparedCommands();