long getConnection = 0;
long returnConnection = 0;
long heldConnection = 0;
for (int j = 0; j < reps; j++)
{
ConnectionListener cl = null;
try
{
if (tm == null)
throw new SystemException("TM is null");
tm.begin();
long startGetConnection = System.currentTimeMillis();
cl = cm.getManagedConnection(subject, cri);
cl.enlist();
long endGetConnection = System.currentTimeMillis();
TxConnectionManagerStressTestCase.this.connectionCount.incrementAndGet();
Thread.sleep(sleepTime);
if (tm == null)
throw new SystemException("TM is null");
tm.commit();
long startReturnConnection = System.currentTimeMillis();
if (!trackByTx)
{
cl.delist();
cm.returnManagedConnection(cl, false);
}
cl = null;
long endReturnConnection = System.currentTimeMillis();