/** * Callback for Connection Closed. * * @param event ConnectionEvent Object. */ @Override public void connectionClosed(ConnectionEvent event) { if (isActive) { ManagedConnection conn = (ManagedConnection) event.getSource(); XAResource xar = null; if (xaResourcesMap.get(conn) != null) xar = (XAResource) xaResourcesMap.get(conn); xaResourcesMap.remove(conn); try { Transaction txn = transManager.getTransaction(); if (txn != null && xar != null) { txn.delistResource(xar, XAResource.TMSUCCESS); } } catch (Exception se) { String exception = "JCAConnectionManagerImpl::connectionClosed: Exception occurred due to " + se; if (logger.isDebugEnabled()) { logger.debug(exception, se); } } mannPoolCache.returnPooledConnectionToPool(conn); } }
/** * Callback for Connection Closed. * * @param event ConnectionEvent Object. */ @Override public void connectionClosed(ConnectionEvent event) { if (isActive) { ManagedConnection conn = (ManagedConnection) event.getSource(); TransactionManagerImpl transManager = TransactionManagerImpl.getTransactionManager(); try { Transaction txn = transManager.getTransaction(); if (txn == null) { mannPoolCache.returnPooledConnectionToPool(conn); } } catch (Exception se) { String exception = "FacetsJCAConnectionManagerImpl::connectionClosed: Exception occurred due to " + se.getMessage(); if (logger.isDebugEnabled()) { logger.debug(exception, se); } } } }
if (isActive) { ManagedConnection conn = (ManagedConnection) event.getSource();
if (isActive) { ManagedConnection conn = (ManagedConnection) event.getSource(); XAResource xar = (XAResource) xaResourcesMap.get(conn); xaResourcesMap.remove(conn);
public void connectionClosed(ConnectionEvent event) { try { ((ManagedConnection)event.getSource()).destroy(); } catch (ResourceException e) { LOG.log(Level.SEVERE, "Failed to destroy connection.", e); } }
public void connectionErrorOccurred(ConnectionEvent event) { try { ((ManagedConnection)event.getSource()).destroy(); } catch (ResourceException e) { LOG.log(Level.SEVERE, "Failed to destroy connection.", e); } }
public void connectionClosed(ConnectionEvent evt) { ManagedConnection mc = (ManagedConnection) evt.getSource(); try { mc.destroy(); } catch (Throwable re) { if (_logger.isLoggable(Level.FINE)) { _logger.fine("error while destroying Unpooled Managed Connection"); } } if (_logger.isLoggable(Level.FINE)) { _logger.fine("UnpooledConnectionEventListener: Connection closed"); } }
/** * Resource adapters will signal that the connection being closed is bad. * @param evt ConnectionEvent */ public void badConnectionClosed(ConnectionEvent evt){ ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); connectionClosed(evt); }
/** * Resource adapters will signal that the connection being closed is bad. * * @param evt ConnectionEvent */ public void badConnectionClosed(ConnectionEvent evt) { ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.badResourceClosed(resource); }
/** * <code>javax.resource.spi.ConnectionEventListener</code> callback for * when a <code>ManagedConnection</code> is closed. * * @param ce contains information about the connection that has be closed */ public void connectionClosed(ConnectionEvent ce) { try { ((FBManagedConnection)ce.getSource()).destroy(); } catch (ResourceException e) { if (log!=null) log.debug("Exception closing unmanaged connection: ", e); } }
/** * 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); }
/** * <code>javax.resource.spi.ConnectionEventListener</code> callback for * when a <code>ManagedConnection</code> is closed. * * @param ce contains information about the connection that has be closed */ public void connectionClosed(ConnectionEvent ce) { try { ((FBManagedConnection)ce.getSource()).destroy(); } catch (ResourceException e) { if (log!=null) log.debug("Exception closing unmanaged connection: ", e); } }
/** * Resource adapters will signal that the connection is being aborted. * * @param evt ConnectionEvent */ public void connectionAbortOccurred(ConnectionEvent evt) { resource.setConnectionErrorOccurred(); ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.resourceAbortOccurred(resource); }
public void connectionErrorOccurred(final ConnectionEvent event) { try { final ManagedConnection mc = (ManagedConnection) event.getSource(); logger.log("EJCA1005", new Object[] { mc }); policy.connectionErrorOccurred(mc); } catch (final Exception e) { logger.log("EJCA0000", null, e); } }
public void connectionErrorOccurred(ConnectionEvent evt) { resource.setConnectionErrorOccurred(); ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.resourceErrorOccurred( resource ); /* try { mc.destroy(); } catch (Exception ex) { // ignore exception } */ }
public void connectionErrorOccurred(ConnectionEvent evt) { resource.setConnectionErrorOccurred(); ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.resourceErrorOccurred(resource); /* try { mc.destroy(); } catch (Exception ex) { // ignore exception } */ }
public void connectionErrorOccurred(ConnectionEvent evt) { ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.putbackResourceToPool(resource, true); /* try { mc.destroy(); } catch (Exception ex) { // ignore exception } */ //GJCINT resource.setConnectionErrorOccurred(); }
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); } }
public void connectionClosed(final ConnectionEvent event) { try { final ManagedConnection mc = (ManagedConnection) event.getSource(); if (logger.isDebugEnabled()) { logger.log("DJCA1002", new Object[] { mc }); } policy.release(mc); } catch (final Exception e) { logger.log("EJCA0000", null, e); } }
/** * Resource adapters will signal that the connection being closed is bad. * * @param evt ConnectionEvent */ public void badConnectionClosed(ConnectionEvent evt) { if (resource.hasConnectionErrorOccurred()) { return; } resource.decrementCount(); if (resource.getShareCount() == 0) { ManagedConnection mc = (ManagedConnection) evt.getSource(); mc.removeConnectionEventListener(this); poolMgr.badResourceClosed(resource); } }