private Exception doSilentClose( Object proxyConnection, boolean pooled_connection_is_dead, boolean known_resolved_txn) { if (activeConnection != null) { synchronized ( C3P0PooledConnection .this) // uh oh... this is a nested lock acq... is there a deadlock hazard here? { if (C3P0PooledConnection.this.exposedProxy == proxyConnection) { C3P0PooledConnection.this.exposedProxy = null; // System.err.println("Reset exposed proxy."); // DEBUG // origGet = null; } else // else case -- DEBUG only logger.warning( "(c3p0 issue) doSilentClose( ... ) called on a proxyConnection " + "other than the current exposed proxy for its PooledConnection. [exposedProxy: " + exposedProxy + ", proxyConnection: " + proxyConnection); // System.err.println("[DEBUG] WARNING: doSilentClose( ... ) called on a // proxyConnection " + // "other than the current exposed proxy for its PooledConnection. [exposedProxy: // " + // exposedProxy + ", proxyConnection: " + proxyConnection); } Exception out = null; Exception exc1 = null, exc2 = null, exc3 = null, exc4 = null; try { if (!pooled_connection_is_dead) C3P0PooledConnection.this.reset(known_resolved_txn); } catch (Exception e) { exc1 = e; // if (Debug.DEBUG) // { // System.err.print("exc1 -- "); // exc1.printStackTrace(); // } } exc2 = cleanupUncachedActiveStatements(); // if (Debug.DEBUG && exc2 != null) // { // System.err.print("exc2 -- "); // exc2.printStackTrace(); // } String errSource; if (doRawResultSets != null) { activeMetaDataResultSets.addAll(doRawResultSets); errSource = "DataBaseMetaData or raw Connection operation"; } else errSource = "DataBaseMetaData"; if (!closeAndRemoveResultSets(activeMetaDataResultSets)) exc3 = new SQLException("Failed to close some " + errSource + " Result Sets."); // if (Debug.DEBUG && exc3 != null) // { // System.err.print("exc3 -- "); // exc3.printStackTrace(); // } if (scache != null) { try { scache.checkinAll(physicalConnection); } catch (Exception e) { exc4 = e; } // if (Debug.DEBUG && exc4 != null) // { // System.err.print("exc4 -- "); // exc4.printStackTrace(); // } } if (exc1 != null) { handleMaybeFatalToPooledConnection(exc1, proxyConnection, true); out = exc1; } else if (exc2 != null) { handleMaybeFatalToPooledConnection(exc2, proxyConnection, true); out = exc2; } else if (exc3 != null) { handleMaybeFatalToPooledConnection(exc3, proxyConnection, true); out = exc3; } else if (exc4 != null) { handleMaybeFatalToPooledConnection(exc4, proxyConnection, true); out = exc4; } // if (out != null) // { // System.err.print("out -- "); // out.printStackTrace(); // } activeConnection = null; return out; } else return null; }