Differences
This shows you the differences between two versions of the page.
|
soloistconfigurationapi [2011/06/28 17:54] predrag.radenkovic created |
soloistconfigurationapi [2011/06/28 18:00] (current) predrag.radenkovic |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| While all of the things described in [[configuration|Configuration]] section could be done without using SoloistConfiguration class, it provides the operations to configure SOLoist with some commonly used configurations/modes. | While all of the things described in [[configuration|Configuration]] section could be done without using SoloistConfiguration class, it provides the operations to configure SOLoist with some commonly used configurations/modes. | ||
| - | ==== useDatabase(boolean) ==== | + | ===== useDatabase(boolean) ===== |
| Specifies whether a "dummy" (false) or a "real" (true) database access adapter (ORM) will be used. | 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). | Dummy ORM does not write to database, and does not permit reading from database (current implementation: DummyObject2RelationalMapper). | ||
| Line 8: | Line 8: | ||
| ===== useHybridO2RMapper(boolean, File) ===== | ===== 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). | 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: | ||
| + | <code java> | ||
| + | public void enterSOLoistFastMode() throws ConfigException { | ||
| + | useSharedCache(true); | ||
| + | useDatabase(false); | ||
| + | useUpdateRequestsForCommit(false); | ||
| + | } | ||
| + | public void leaveSOLoistFastMode() throws ConfigException { | ||
| + | useSharedCache(true); | ||
| + | useDatabase(true); | ||
| + | useUpdateRequestsForCommit(true); | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ===== 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. | ||
| + | |||
| + | |||