mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add DatabaseConfig.autoPersistUpdates for experimental "transparent persistence"
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
+9
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user