While all of the things described in Configuration section could be done without using SoloistConfiguration class, it provides the operations to configure SOLoist with some commonly used configurations/modes.
useDatabase(boolean)
Specifies whether a “dummy” (false) or a “real” (true) database access adapter (ORM) will be used. Dummy ORM does not write to database, and does not permit reading from database (current implementation: DummyObject2RelationalMapper). Real ORM which will be used depends on prior calls to useHybridO2RMapper operation.
useHybridO2RMapper(boolean, File)
Specifies which ORM will be used: it can be either a database access adapter (currently: NORMObjectRelationalMapper, formerly: Object2RelationalMapper) or a hybrid CSV/database adapter that supports reading from database, and append-only writing to CSV files (current implementation: Object2RelationalMapper with NewCsvHybridPersistenceHandler – note: it is specific to Oracle).
useSharedCache(boolean)
Specifies whether a shared cache will be used, or thread caches will talk directly to whatever database adapter (ORM) has been set up by useDatabase and useHybridO2RMapper. The kind of shared cache that will be used depends on other operations.
enterSOLoistFastMode() vs. leaveSOLoistFastMode()
So-called “fast mode” is the (misleading) name for the following cache configuration: thread cache > shared cache > dummy ORM.
Therewith, all created objects will end up in the shared cache (no objects will be written to the database), and no objects can be read from the database. This is typically used during construction of GUI structure. These operations are equivalent to the following calls:
public void enterSOLoistFastMode() throws ConfigException { useSharedCache(true); useDatabase(false); useUpdateRequestsForCommit(false); } public void leaveSOLoistFastMode() throws ConfigException { useSharedCache(true); useDatabase(true); useUpdateRequestsForCommit(true); }
freezeSharedCache() vs. thawSharedCache()
“Freezing” shared cache means making the contents of the shared cache immutable. “Thawing” is the opposite. This is often used in combination with the “fast mode”. This is accomplished by replacing the implementation of shared cache. Currently, frozen one is an ImmutablePassThroughSharedCache and the “normal” one is a SharedCache.