}
}
protected void dropTemporaryTableIfNecessary(final Queryable persister, final SessionImplementor session) {
if ( getFactory().getDialect().dropTemporaryTableAfterUse() ) {
IsolatedWork work = new IsolatedWork() {
public void doWork(Connection connection) throws HibernateException {
Statement stmnt = null;
try {
final String command = session.getFactory()
.getSettings().getDialect()
.getDropTemporaryTableString()
+ " " + persister.getTemporaryIdTableName();
stmnt = connection.createStatement();
stmnt.executeUpdate(command);
}
catch( Throwable t ) {
log.warn( "unable to drop temporary id table after use [" + t.getMessage() + "]" );
}
finally {
if ( stmnt != null ) {
try {
stmnt.close();
}
catch( Throwable ignore ) {
// ignore
}
}
}
}
};
if ( shouldIsolateTemporaryTableDDL() ) {
if ( getFactory().getSettings().isDataDefinitionInTransactionSupported() ) {
Isolater.doIsolatedWork( work, session );
}
else {
Isolater.doNonTransactedWork( work, session );
}
}
else {
work.doWork( session.getJDBCContext().getConnectionManager().getConnection() );
session.getJDBCContext().getConnectionManager().afterStatement();
}
}
else {
// at the very least cleanup the data :)