Add DatabaseConfig.autoPersistUpdates for experimental "transparent persistence"

This commit is contained in:
Robin Bygrave
2021-04-01 22:57:34 +13:00
parent 0527f45f5a
commit 6bcf5c6881
4 changed files with 37 additions and 5 deletions
@@ -211,11 +211,12 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
this.batchOnCascadeMode = false;
this.onQueryOnly = OnQueryOnly.ROLLBACK;
} else {
this.transparentPersistence = explicit && manager.isAutoPersistUpdates();
this.logSql = manager.isLogSql();
this.logSummary = manager.isLogSummary();
this.skipCacheAfterWrite = manager.isSkipCacheAfterWrite();
this.batchMode = manager.getPersistBatch();
this.batchOnCascadeMode = manager.getPersistBatchOnCascade();
this.batchMode = manager.isPersistBatch();
this.batchOnCascadeMode = manager.isPersistBatchOnCascade();
this.onQueryOnly = manager.getOnQueryOnly();
}
@@ -104,6 +104,8 @@ public class TransactionManager implements SpiTransactionManager {
*/
final DocStoreUpdateProcessor docStoreUpdateProcessor;
private final boolean autoPersistUpdates;
private final boolean persistBatch;
private final boolean persistBatchOnCascade;
@@ -165,6 +167,7 @@ public class TransactionManager implements SpiTransactionManager {
this.supportsSavepointId = databasePlatform.isSupportsSavepointId();
this.skipCacheAfterWrite = options.config.isSkipCacheAfterWrite();
this.notifyL2CacheInForeground = options.notifyL2CacheInForeground;
this.autoPersistUpdates = options.config.isAutoPersistUpdates();
this.persistBatch = PersistBatch.ALL == options.config.getPersistBatch();
this.persistBatchOnCascade = PersistBatch.ALL == options.config.appliedPersistBatchOnCascade();
this.rollbackOnChecked = options.config.isTransactionRollbackOnChecked();
@@ -283,11 +286,15 @@ public class TransactionManager implements SpiTransactionManager {
return bulkEventListenerMap;
}
boolean getPersistBatch() {
boolean isAutoPersistUpdates() {
return autoPersistUpdates;
}
boolean isPersistBatch() {
return persistBatch;
}
public boolean getPersistBatchOnCascade() {
boolean isPersistBatchOnCascade() {
return persistBatchOnCascade;
}