public void connectionErrorOccurred(ConnectionEvent ce) { if (state == NORMAL) { if (ce != null) { Throwable t = ce.getException(); if (t == null) t = new Exception("No exception was reported"); log.warn("Connection error occured: " + this, t); } else { Throwable t = new Exception("No exception was reported"); log.warn("Unknown Connection error occured: " + this, t); } } try { unregisterConnections(); } catch (Throwable t) { //ignore, it wasn't checked out. } if (ce != null && ce.getSource() != getManagedConnection()) log.warn("Notified of error on a different managed connection?"); returnManagedConnection(this, true); }
/** * <code>javax.resource.spi.ConnectionEventListener</code> callback for * when a Local Transaction was rolled back within the context of a * <code>ManagedConnection</code>. * * @param ce contains information about the connection */ public void connectionErrorOccurred(ConnectionEvent ce) { if (log!=null) log.debug("ConnectionErrorOccurred, ", ce.getException()); try { ((FBManagedConnection)ce.getSource()).destroy(); } catch (ResourceException e) { if (log!=null) log.debug("further problems destroying connection: ", e); } }
/** * <code>javax.resource.spi.ConnectionEventListener</code> callback for * when a Local Transaction was rolled back within the context of a * <code>ManagedConnection</code>. * * @param ce contains information about the connection */ public void connectionErrorOccurred(ConnectionEvent ce) { if (log!=null) log.debug("ConnectionErrorOccurred, ", ce.getException()); try { ((FBManagedConnection)ce.getSource()).destroy(); } catch (ResourceException e) { if (log!=null) log.debug("further problems destroying connection: ", 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); } }
Exception cause = event.getException(); if (cause == null)