XAStatefulHolder xaStatefulHolder = availablePool.poll(remainingTimeMs, TimeUnit.MILLISECONDS);
if (xaStatefulHolder == null) {
if (TransactionManagerServices.isTransactionManagerRunning())
TransactionManagerServices.getTransactionManager().dumpTransactionContexts();
throw new BitronixRuntimeException("XA pool of resource " + bean.getUniqueName() + " still empty after " + bean.getAcquisitionTimeout() + "s wait time");
}
if (expireStatefulHolder(xaStatefulHolder, false)) {
return getInPool(remainingTimeMs);
}
return xaStatefulHolder;
} catch (InterruptedException e) {
throw new BitronixRuntimeException("Interrupted while waiting for IN_POOL connection.");
}
}