Add ability to specify SQLite synchronous mode and cache_size in the config. fix #817
We should allow the following states :
@frankTheTank72 the value of the properties are retreived in the functions getSynchronousMode() and getCacheSize():
String synchronous = propertyService.getString(Props.DB_SQLITE_SYNCHRONOUS).toUpperCase();
and
int cacheSize = propertyService.getInt(Props.DB_SQLITE_CACHE_SIZE);
and is then used to set the properties in the DB session (the same way journal_mode is set) with the function:
config.addDataSourceProperty("synchronous", getSynchronousMode());
config.addDataSourceProperty("cache_size", getCacheSize());
I can prove it by running the node with a config that has these properties in it:
DB.SqliteSynchronous = OFF DB.SqliteCacheSize = -4000
Then I get this output:
showing that the properties were set correctly. When running without the properties in the config I get the default values: 2 and -2000.
This custom output was gotten by adding these lines at the start of onStartupImpl():
Db.useDSLContext(ctx -> {
logger.info(ctx.fetch("PRAGMA journal_mode").formatJSON());
logger.info(ctx.fetch("PRAGMA synchronous").formatJSON());
logger.info(ctx.fetch("PRAGMA cache_size").formatJSON());
});