session.endOperationProfile(SessionProfiler.SqlPrepare, null, SessionProfiler.ALL);
}
} catch (SQLException exception) {
//If this is a connection from an external pool then closeStatement will close the connection.
//we must test the connection before that happens.
DatabaseException exceptionToThrow = this.databaseAccessor.processExceptionForCommError(session, exception, null);
try {// Ensure that the statement is closed, but still ensure that the real exception is thrown.
this.databaseAccessor.closeStatement(statement, session, null);
} catch (SQLException closeException) {
}
if (exceptionToThrow == null){