/** Deprecated. Please use getInternalConnection() instead. * * @return the raw connection */ @Deprecated public Connection getRawConnection() { return getInternalConnection(); }
/** Update counters and call hooks. * @param handle connection handle. */ protected void postDestroyConnection(ConnectionHandle handle){ ConnectionPartition partition = handle.getOriginatingPartition(); if (this.finalizableRefQueue != null && handle.getInternalConnection() != null){ //safety this.finalizableRefs.remove(handle.getInternalConnection()); // assert o != null : "Did not manage to remove connection from finalizable ref queue"; } partition.updateCreatedConnections(-1); partition.setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimization // "Destroying" for us means: don't put it back in the pool. if (handle.getConnectionHook() != null){ handle.getConnectionHook().onDestroy(handle); } }
/** * Update counters and call hooks. * * @param handle connection handle. */ protected void postDestroyConnection(ConnectionHandle handle) { ConnectionPartition partition = handle.getOriginatingPartition(); if (this.finalizableRefQueue != null && handle.getInternalConnection() != null) { //safety check this.finalizableRefs.remove(handle.getInternalConnection()); // o != null : "Did not manage to remove connection from finalizable ref queue"; } partition.updateCreatedConnections(-1); // we can create new ones now, this is an optimization partition.setUnableToCreateMoreTransactions(false); // "Destroying" for us means: don't put it back in the pool. if (handle.getConnectionHook() != null) { handle.getConnectionHook().onDestroy(handle); } }
if (!this.disableTracking){ Connection con = connectionHandle.getInternalConnection(); if (con != null && con instanceof Proxy && Proxy.getInvocationHandler(con) instanceof MemorizeTransactionProxy){ try {
/** * Adds a free connection. * * @param connectionHandle * @throws SQLException on error */ protected void addFreeConnection(ConnectionHandle connectionHandle) throws SQLException{ connectionHandle.setOriginatingPartition(this); // assume success to avoid racing where we insert an item in a queue and having that item immediately // taken and closed off thus decrementing the created connection count. updateCreatedConnections(1); if (!this.disableTracking){ trackConnectionFinalizer(connectionHandle); } // the instant the following line is executed, consumers can start making use of this // connection. if (!this.freeConnections.offer(connectionHandle)){ // we failed. rollback. updateCreatedConnections(-1); // compensate our createdConnection count. if (!this.disableTracking){ this.pool.getFinalizableRefs().remove(connectionHandle.getInternalConnection()); } // terminate the internal handle. connectionHandle.internalClose(); } }
try{ con.clearStatementCaches(true); con.getInternalConnection().close(); } catch(Throwable t){ replaceTarget.put(replay.getTarget(), con.getInternalConnection()); } else if (replay.getTarget() instanceof CallableStatement){ if (replaceTarget.get(replay.getTarget()) == null){
boolean tryAgain; Connection result; Connection oldRawConnection = connectionHandle.getInternalConnection(); String url = this.getConfig().getJdbcUrl();
boolean tryAgain = false; Connection result = null; Connection oldRawConnection = connectionHandle.getInternalConnection(); String url = this.getConfig().getJdbcUrl();