JdbcConnectionProxyHelper.setIsolationLevel ( connection , getDefaultIsolationLevel() );
return AtomikosConnectionProxy.newInstance ( connection , sessionHandleState , hmsg );
}
protected void testUnderlyingConnection() throws CreateConnectionException {
if ( isErroneous() ) throw new CreateConnectionException ( this + ": connection is erroneous" );
String testQuery = getTestQuery();
if (testQuery != null) {
if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": testing connection with query [" + testQuery + "]" );
Statement stmt = null;
try {
stmt = connection.createStatement();
//use execute instead of executeQuery - cf case 58830
stmt.execute(testQuery);
stmt.close();
} catch ( Exception e) {
//catch any Exception - cf case 22198
throw new CreateConnectionException ( "Error executing testQuery" , e );
}
if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": connection tested OK" );
}
else {
if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": no test query, skipping test" );