Enable disallowBatchOnCascade per DatabasePlatform (added for SQL Server)

This commit is contained in:
rbygrave
2014-12-17 00:31:29 +13:00
parent b0462bcda6
commit d1a40d5676
2 changed files with 13 additions and 1 deletions
@@ -1828,4 +1828,16 @@ public class ServerConfig {
}
return hitList;
}
/**
* Return the PersistBatch mode to use for 'batchOnCascade' taking into account if the database
* platform supports getGeneratedKeys in batch mode.
* <p>
* Used to effectively turn off batchOnCascade for SQL Server - still allows explicit batch mode.
* </p>
*/
public PersistBatch appliedPersistBatchOnCascade() {
return databasePlatform.isDisallowBatchOnCascade() ? PersistBatch.NONE : persistBatchOnCascade;
}
}
@@ -106,7 +106,7 @@ public class TransactionManager {
BeanDescriptorManager descMgr, BootupClasses bootupClasses) {
this.persistBatch = config.getPersistBatch();
this.persistBatchOnCascade = config.getPersistBatchOnCascade();
this.persistBatchOnCascade = config.appliedPersistBatchOnCascade();
this.beanDescriptorManager = descMgr;
this.clusterManager = clusterManager;
this.serverName = config.getName();