log.info("Simulating connection error with two handles");
try
{
InitialContext ctx = new InitialContext();
ConnectionFactory cf = (ConnectionFactory) ctx.lookup("java:/JBossTestCFByTx");
TestConnection c1 = (TestConnection) cf.getConnection();
TestConnection c2 = (TestConnection) cf.getConnection();
try
{
c2.simulateConnectionError();
}
finally
{
try
{
c1.close();
}
catch (Throwable ignored)
{
}
try
{
c2.close();
}
catch (Throwable ignored)
{
}
}