HHH-7816 - DDL opertations will incorrectly commit current transaction on Oracle XA

(cherry picked from commit 5d2f21a01e)
This commit is contained in:
Steve Ebersole 2012-11-20 15:57:33 -06:00
parent e9405fe031
commit 94385b8656
1 changed files with 9 additions and 2 deletions

View File

@ -105,7 +105,7 @@ public class TemporaryTableBulkIdStrategy implements MultiTableBulkIdStrategy {
session.getTransactionCoordinator()
.getTransaction()
.createIsolationDelegate()
.delegateWork( work, session.getFactory().getSettings().isDataDefinitionInTransactionSupported() );
.delegateWork( work, shouldTransactIsolatedTemporaryTableDDL( session ) );
}
else {
final Connection connection = session.getTransactionCoordinator()
@ -127,7 +127,7 @@ public class TemporaryTableBulkIdStrategy implements MultiTableBulkIdStrategy {
session.getTransactionCoordinator()
.getTransaction()
.createIsolationDelegate()
.delegateWork( work, session.getFactory().getSettings().isDataDefinitionInTransactionSupported() );
.delegateWork( work, shouldTransactIsolatedTemporaryTableDDL( session ) );
}
else {
final Connection connection = session.getTransactionCoordinator()
@ -174,6 +174,13 @@ public class TemporaryTableBulkIdStrategy implements MultiTableBulkIdStrategy {
return session.getFactory().getSettings().isDataDefinitionImplicitCommit();
}
@SuppressWarnings({ "UnnecessaryUnboxing" })
protected boolean shouldTransactIsolatedTemporaryTableDDL(SessionImplementor session) {
// is there ever a time when it makes sense to do this?
// return session.getFactory().getSettings().isDataDefinitionInTransactionSupported();
return false;
}
private static class TemporaryTableCreationWork extends AbstractWork {
private final Queryable persister;