HHH-4486 : MySQL [DROP TEMPORARY TABLE] support
git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@17783 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
2d96fb581a
commit
f73f158b32
|
@ -1090,6 +1090,15 @@ public abstract class Dialect {
|
|||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Command used to drop a temporary table.
|
||||
*
|
||||
* @return The command used to drop a temporary table.
|
||||
*/
|
||||
public String getDropTemporaryTableString() {
|
||||
return "drop table";
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the dialect require that temporary table DDL statements occur in
|
||||
* isolation from other statements? This would be the case if the creation
|
||||
|
|
|
@ -255,6 +255,16 @@ public class MySQLDialect extends Dialect {
|
|||
return "create temporary table if not exists";
|
||||
}
|
||||
|
||||
public String getDropTemporaryTableString() {
|
||||
return "drop temporary table";
|
||||
}
|
||||
|
||||
public Boolean performTemporaryTableDDLInIsolation() {
|
||||
// because we [drop *temporary* table...] we do not
|
||||
// have to perform these in isolation.
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
public String getCastTypeName(int code) {
|
||||
if ( code==Types.INTEGER ) {
|
||||
return "signed";
|
||||
|
@ -298,10 +308,6 @@ public class MySQLDialect extends Dialect {
|
|||
return true;
|
||||
}
|
||||
|
||||
public Boolean performTemporaryTableDDLInIsolation() {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
|
||||
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -158,8 +158,10 @@ public abstract class AbstractStatementExecutor implements StatementExecutor {
|
|||
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( "drop table " + persister.getTemporaryIdTableName() );
|
||||
stmnt.executeUpdate( command );
|
||||
}
|
||||
catch( Throwable t ) {
|
||||
log.warn( "unable to drop temporary id table after use [" + t.getMessage() + "]" );
|
||||
|
|
Loading…
Reference in New Issue