private void returnHandle(ManagedConnectionInfo managedConnectionInfo) { ConnectionInfo connectionInfo = new ConnectionInfo(); connectionInfo.setManagedConnectionInfo(managedConnectionInfo); internalReturn(connectionInfo, ConnectionReturnAction.RETURN_HANDLE); }
mci.getConnectionRequestInfo()); if (matchedMC != null) { connectionInfo.setManagedConnectionInfo(pool.get(matchedMC)); pool.remove(matchedMC); if (log.isTraceEnabled()) {
public void getConnection(ConnectionInfo connectionInfo) throws ResourceException { if (connectionInfo.isUnshareable()) { next.getConnection(connectionInfo); return; } ManagedConnectionInfo managedConnectionInfo = connections.get(); if (managedConnectionInfo != null) { if (matchConnections) { ManagedConnectionInfo mciRequest = connectionInfo.getManagedConnectionInfo(); if (null != managedConnectionInfo.getManagedConnectionFactory().matchManagedConnections( Collections.singleton(managedConnectionInfo.getManagedConnection()), mciRequest.getSubject(), mciRequest.getConnectionRequestInfo() )) { connectionInfo.setManagedConnectionInfo(managedConnectionInfo); return; } else { //match failed, get a new cx after returning this one connections.set(null); next.returnConnection(connectionInfo, ConnectionReturnAction.RETURN_HANDLE); } } else { connectionInfo.setManagedConnectionInfo(managedConnectionInfo); return; } } //nothing for this thread or match failed next.getConnection(connectionInfo); connections.set(connectionInfo.getManagedConnectionInfo()); }
connectionInfo.setManagedConnectionInfo(newMCI); if (log.isTraceEnabled()) { log.trace("Supplying pooled connection without checking matching MCI: " + connectionInfo.getManagedConnectionInfo() + " MC: " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " from pool: " + this); returnCI.setManagedConnectionInfo(newMCI); returnConnection(returnCI, ConnectionReturnAction.DESTROY); throw e; connectionInfo.setManagedConnectionInfo(newMCI); if (log.isTraceEnabled()) { log.trace("Supplying pooled connection MCI: " + connectionInfo.getManagedConnectionInfo() + " from pool: " + this); returnCI.setManagedConnectionInfo(newMCI); returnConnection(returnCI, ConnectionReturnAction.RETURN_HANDLE); throw new ResourceException("The pooling strategy does not match the MatchManagedConnections implementation. Please investigate and reconfigure this pool");
connectionInfo.setManagedConnectionInfo(managedConnectionInfo);
returningConnectionInfo.setManagedConnectionInfo(originalManagedConnectionInfo); originalManagedConnectionInfo.getConnectionRequestInfo()); newManagedConnectionInfo.setSubject(currentSubject); connectionInfo.setManagedConnectionInfo(newManagedConnectionInfo); next.getConnection(connectionInfo);