private ConnectionListener getSimpleConnection(final Subject subject, final ConnectionRequestInfo cri,
final SubPoolContext subPoolContext)
throws ResourceException
{
ConnectionListener cl = null;
ManagedConnectionPool imcp = null;
try
{
//Find internal managed pool
imcp = subPoolContext.getSubPool();
//Get connection from imcp
cl = imcp.getConnection(subject, cri);
if (trace)
{
dump("Got connection from pool : " + cl);
}
return cl;
}
catch (ResourceException re)
{
if (re instanceof RetryableException)
{
if (log.isDebugEnabled())
log.debug("Got a RetryableException - trying to reinitialize the pool");
// The IMCP is down - retry
imcp = subPoolContext.getSubPool();
// Make sure that IMCP is running
if (!imcp.isRunning())
imcp.reenable();
//Getting connection from pool
cl = imcp.getConnection(subject, cri);
if (trace)
dump("Got connection from pool (retried) " + cl);
return cl;
}