/** * Destroys the underline physical connection to EIS. * * @param connectionObject connection Object. */ @Override void destroyPooledConnection(Object connectionObject) { try { ((ManagedConnection) connectionObject) .removeConnectionEventListener((ConnectionEventListener) connEventListner); ((ManagedConnection) connectionObject).destroy(); connectionObject = null; } catch (ResourceException rex) { if (logger.isTraceEnabled()) { logger.trace( "ManagedPoolcacheImpl::destroyPooledConnection:Exception in closing the connection.Ignoring it. The exeption is {}", rex.getMessage(), rex); } } } }
public void stop() { for (ManagedConnection conn : connections) { try { conn.destroy(); } catch (Throwable e) { } } } }
public void stop() { for (ManagedConnection conn : connections) { try { conn.destroy(); } catch (Throwable e) { } } } }
public void connectionErrorOccurred(final ManagedConnection mc) throws ResourceException { mc.destroy(); }
/** * {@inheritDoc} */ public void closeConnections(List connList) { for (Object obj : connList) { try { ManagedConnection con = (ManagedConnection)obj; con.destroy(); } catch (Exception ex) { _logger.log(Level.WARNING, "recovery.jdbc-resource.destroy-error", ex); } } }
protected void internalDestroy() { synchronized (pool) { for (ManagedConnection managedConnection : pool.keySet()) { try { managedConnection.destroy(); } catch (ResourceException ignore) { } } pool.clear(); } }
/** * {@inheritDoc} */ public void closeConnections(List connList) { for (Object obj : connList) { try { ((ManagedConnection) obj).destroy(); } catch (Exception ex) { // Since closing error has been advised to be ignored // so we are not logging the message as an exception // but treating the same as a debug message // Santanu De, Sun Microsystems, 2002. _logger.log(Level.WARNING, "Connector Resource could not be closed", ex); } } }
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"); } }
private void closeQuietly(javax.resource.spi.ManagedConnection closeable) { if (closeable != null) { try { closeable.cleanup(); } catch (Exception ex) { logger.debug(ex.getMessage()); } try { closeable.destroy(); } catch (Exception ex) { logger.debug(ex.getMessage()); } } }
private void closeQuietly(javax.resource.spi.ManagedConnection closeable) { if (closeable != null) { try { closeable.cleanup(); } catch (Exception ex) { logger.debug(ex.getMessage()); } try { closeable.destroy(); } catch (Exception ex) { logger.debug(ex.getMessage()); } } }
protected void internalDestroy() { synchronized (pool) { while (!pool.isEmpty()) { ManagedConnection mc = pool.remove(pool.size() - 1).getManagedConnection(); if (mc != null) { try { mc.destroy(); } catch (ResourceException re) { //ignore } } } } }
private void closeQuietly(javax.resource.spi.ManagedConnection closeable) { if (closeable != null) { try { closeable.cleanup(); } catch (Exception ex) { logger.debug(ex.getMessage()); } try { closeable.destroy(); } catch (Exception ex) { logger.debug(ex.getMessage()); } } }
public void destroyResource(ResourceHandle resource) throws PoolingException { try { ManagedConnection mc = (ManagedConnection) resource.getResource(); mc.destroy(); } catch (Exception ex) { throw new PoolingException(ex); } }
public void returnConnection( ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction) { ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo(); ManagedConnection mc = mci.getManagedConnection(); try { mc.destroy(); } catch (ResourceException e) { //log and forget } catch (Error e) { throw e; } catch (Throwable t) { //log and forget } }
public void release(final ManagedConnection mc) throws ResourceException { mc.removeConnectionEventListener(listener); mc.destroy(); if (logger.isDebugEnabled()) { logger.log("DJCA1004", new Object[] { mc }); } }
public void destroyResource(ResourceHandle resource) throws PoolingException { try { closeUserConnection(resource); } catch (Exception ex) { // ignore error } try { ManagedConnection mc = (ManagedConnection) resource.getResource(); mc.destroy(); } catch (Exception ex) { throw new PoolingException(ex); } }
public void destroyResource(ResourceHandle resource) throws PoolingException { try { ManagedConnection mc = (ManagedConnection) resource.getResource(); ConnectorXAResource.freeListener(mc); XAResource xares = resource.getXAResource(); forceTransactionCompletion(xares); mc.destroy(); if (_logger.isLoggable(Level.FINEST)) { _logger.finest("destroyResource for LocalTxConnectorAllocator done"); } } catch (Exception ex) { throw new PoolingException(ex); } }
@Test public void testConnectionCredentialsFail() throws Exception { resourceAdapter = newResourceAdapter(); MyBootstrapContext ctx = new MyBootstrapContext(); resourceAdapter.start(ctx); ActiveMQRAManagedConnectionFactory mcf = new ActiveMQRAManagedConnectionFactory(); mcf.setResourceAdapter(resourceAdapter); ActiveMQRAConnectionFactory qraConnectionFactory = new ActiveMQRAConnectionFactoryImpl(mcf, qraConnectionManager); QueueConnection queueConnection = qraConnectionFactory.createQueueConnection(); QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); ManagedConnection mc = ((ActiveMQRASession) session).getManagedConnection(); queueConnection.close(); mc.destroy(); try { queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testwrongpassword"); queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).close(); fail("should throw esxception"); } catch (JMSException e) { //pass } }