diff --git a/interfaces/innerkits/distributeddata/include/types.h b/interfaces/innerkits/distributeddata/include/types.h index e0db34c2b58d16191e1d11243c6e090101c9d11d..5047c2670cfe21ae2c278ae8d83d7f8fe59dedfc 100644 --- a/interfaces/innerkits/distributeddata/include/types.h +++ b/interfaces/innerkits/distributeddata/include/types.h @@ -207,7 +207,7 @@ enum class DeviceFilterStrategy { struct Options { bool createIfMissing = true; bool encrypt = false; - bool persistent = false; + bool persistent = true; bool backup = true; bool autoSync = true; int securityLevel = SecurityLevel::NO_LABEL; diff --git a/services/distributeddataservice/app/src/kvstore_app_manager.cpp b/services/distributeddataservice/app/src/kvstore_app_manager.cpp index c8c9af74d9ffea29161b23fe980df17177cfcef5..35ae7d0006e9db829ffd25b64767631512c280e9 100644 --- a/services/distributeddataservice/app/src/kvstore_app_manager.cpp +++ b/services/distributeddataservice/app/src/kvstore_app_manager.cpp @@ -394,6 +394,7 @@ Status KvStoreAppManager::InitNbDbOption(const Options &options, const std::vect dbOption.syncDualTupleMode = true; // tuple of (appid+storeid) dbOption.createIfNecessary = options.createIfMissing; + dbOption.isMemoryDb = (!options.persistent); dbOption.isEncryptedDb = options.encrypt; if (options.encrypt) { dbOption.cipher = DistributedDB::CipherType::AES_256_GCM;