public void connectionClosed(ConnectionEvent evt) { Object connectionHandle = evt.getConnectionHandle(); ResourceHandle handle = resource; if (associatedHandles.containsKey(connectionHandle)) { handle = (ResourceHandle) associatedHandles.get(connectionHandle); } poolMgr.resourceClosed(handle); }
/** * Resource adapters will signal that the connection being closed is bad. * @param evt ConnectionEvent */ public void badConnectionClosed(ConnectionEvent evt){ Object connectionHandle = evt.getConnectionHandle(); ResourceHandle handle = resource; if (associatedHandles.containsKey(connectionHandle)) { handle = (ResourceHandle) associatedHandles.get(connectionHandle); } ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.badResourceClosed(handle); }
public void connectionClosed(ConnectionEvent ce) { try { getCcm().unregisterConnection(NoTxConnectionManager.this, ce.getConnectionHandle()); } catch (Throwable t) { log.info("Throwable from unregisterConnection", t); } unregisterAssociation(this, ce.getConnectionHandle()); if (isManagedConnectionFree()) { returnManagedConnection(this, false); } }
public void connectionClosed(ConnectionEvent connectionEvent) { if (connectionEvent.getSource() != managedConnectionInfo.getManagedConnection()) { throw new IllegalArgumentException( "ConnectionClosed event received from wrong ManagedConnection. Expected " + managedConnectionInfo.getManagedConnection() + ", actual " + connectionEvent.getSource()); } if (log.isTraceEnabled()) { log.trace("connectionClosed called with " + connectionEvent.getConnectionHandle() + " for MCI: " + managedConnectionInfo + " and MC: " + managedConnectionInfo.getManagedConnection()); } ConnectionInfo ci = new ConnectionInfo(managedConnectionInfo); ci.setConnectionHandle(connectionEvent.getConnectionHandle()); try { stack.returnConnection(ci, ConnectionReturnAction.RETURN_HANDLE); } catch (Throwable e) { if (log.isTraceEnabled()) { log.trace("connectionClosed failed with " + connectionEvent.getConnectionHandle() + " for MCI: " + managedConnectionInfo + " and MC: " + managedConnectionInfo.getManagedConnection(), e); } if (e instanceof Error) { throw (Error)e; } } }
public void connectionErrorOccurred(ConnectionEvent connectionEvent) { if (connectionEvent.getSource() != managedConnectionInfo.getManagedConnection()) { throw new IllegalArgumentException( "ConnectionError event received from wrong ManagedConnection. Expected " + managedConnectionInfo.getManagedConnection() + ", actual " + connectionEvent.getSource()); } log.warn("connectionErrorOccurred called with " + connectionEvent.getConnectionHandle(), connectionEvent.getException()); boolean errorOccurred = this.errorOccurred; this.errorOccurred = true; if (!errorOccurred) { ConnectionInfo ci = new ConnectionInfo(managedConnectionInfo); ci.setConnectionHandle(connectionEvent.getConnectionHandle()); stack.returnConnection(ci, ConnectionReturnAction.DESTROY); } }
try getCcm().unregisterConnection(TxConnectionManager.this, ce.getConnectionHandle()); if (wasFreed(ce.getConnectionHandle()))
/** * {@inheritDoc} */ public void connectionClosed(ConnectionEvent ce) { if (getCachedConnectionManager() != null) { try { getCachedConnectionManager().unregisterConnection(getConnectionManager(), this, ce.getConnectionHandle()); } catch (Throwable t) { log.debug("Throwable from unregisterConnection", t); } } getConnectionManager().unregisterAssociation(this, ce.getConnectionHandle()); if (isManagedConnectionFree()) { getConnectionManager().returnManagedConnection(this, false); } } }
public void connectionClosed(ConnectionEvent event) Object handle = event.getConnectionHandle();
ce.getConnectionHandle()); if (wasFreed(ce.getConnectionHandle()))