Refine search
XAResource xar = conn.getXAResource(); txn.enlistResource(xar); java.util.List resList = (List) xalistThreadLocal.get(); ex); return conn.getConnection(subject, reqInfo);
/** * 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); } } } }
/** * Creates a new connection for the managed connection pool. * * @return the managed connection from the EIS as ManagedConnection object. */ @Override public Object getNewPoolConnection() throws PoolException { ManagedConnection manConn = null; try { manConn = connFactory.createManagedConnection(sub, connReqInfo); } catch (ResourceException rex) { rex.printStackTrace(); throw new PoolException( "ManagedPoolCacheImpl::getNewConnection: Exception in creating new Managed PooledConnection", rex); } manConn .addConnectionEventListener((javax.resource.spi.ConnectionEventListener) connEventListner); return manConn; }
@Override public Object allocateConnection(ManagedConnectionFactory managedConnectionFactory, ConnectionRequestInfo connectionRequestInfo) throws ResourceException { // connectionRequestInfo unused ManagedConnection managedConnection = managedConnectionFactory.createManagedConnection(null, null); return managedConnection.getConnection(null, null); } }
ManagedConnection mConn = mcf.createManagedConnection(subject, null); XAResource xa = mConn.getXAResource(); log.log(Level.FINER, e.toString(), e); } finally { mConn.destroy(); return mcf.createConnectionFactory(this);
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("allocateConnection cxRequestInfo = " + cxRequestInfo); } ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo); mc.addConnectionEventListener(this); return mc.getConnection(null, cxRequestInfo); }
ManagedConnection managedConnection = connectionFactory.createManagedConnection(null, null); javax.resource.cci.Connection connection = null; try { connection = (javax.resource.cci.Connection) managedConnection.getConnection(null, null); XAResource xares = managedConnection.getXAResource(); logger.warn(ex.getMessage(), ex); XAResource xares = managedConnection.getXAResource();
/** * Returns the user connection. */ Object allocateConnection() throws ResourceException { Object conn = _mConn.getConnection(_subject, _requestInfo); return conn; }
public void stop() { for (ManagedConnection conn : connections) { try { conn.destroy(); } catch (Throwable e) { } } } }
XAResource xaResource = conn.getXAResource(); _localTransaction = conn.getLocalTransaction(); } catch (NotSupportedException e) { _cm.setLocalTransaction(false); _mConn.addConnectionEventListener(this);
if (mc.getMetaData() != null) eisProductName = mc.getMetaData().getEISProductName(); eisProductVersion = mc.getMetaData().getEISProductVersion(); log.trace("Generating XAResourceWrapper for TxConnectionManager" + this); xaResource = new XAResourceWrapperImpl(mc.getXAResource(), padXid, isSameRMOverrideValue, eisProductName, eisProductVersion); xaResource = mc.getXAResource(); mc.addConnectionEventListener(cli); return cli;
public void rollback(Xid xid) throws XAException{ try{ m_xacon.getXAResource().rollback(xid); }catch(ResourceException e){ //a bad xa connection given... throw new XAException(sm.getString("transaction.sybase_xa_wrapper_connection_failed",e)); // throw new XAException("sybase XA resource wrapper :Could not connect : sqlexception was "+e); } } }
/** * {@inheritDoc} */ public void start(Xid xid, int flags) throws XAException { try { cl.getManagedConnection().getLocalTransaction().begin(); } catch (ResourceException re) { throw new LocalXAException("start", XAException.XAER_RMERR, re); } }
public void cleanup(ResourceHandle h) throws PoolingException { try { ManagedConnection mc = (ManagedConnection) h.getResource(); mc.cleanup(); } catch (Exception ex) { _logger.log(Level.WARNING, "managed_con.cleanup-failed", ex); throw new PoolingException(ex.toString(), ex); } }
public ConnectionListener createConnectionListener(ManagedConnection mc, Object context) { ConnectionListener cli = new NoTxConnectionEventListener(mc, poolingStrategy, context, log); mc.addConnectionEventListener(cli); return cli; }
/** * 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); }
/** * No pooling is done for non-managed connections, just get a new MC and * connection to the database. * */ public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo info) throws ResourceException { ManagedConnection mc = mcf.createManagedConnection(null, info); return mc.getConnection(null, info); } }
ManagedConnection mc = mcf.createManagedConnection(defaultSubject, null); mc.addConnectionEventListener(new UnpooledConnectionEventListener()); return returnConnectionHandle ? mc.getConnection(defaultSubject, null) : mc;