-
Notifications
You must be signed in to change notification settings - Fork 3
Persistence Adapter
The default version of the JACIS does not focus on the durability (the D from the ACID transaction properties). However it is possible to extend the store with a durable persistent storage of the committed objects. For this purpose the JACIS provides an extension point where different persistence frameworks can be attached to the store.
An extension enabling the persistent storage of the objects is called persistence adapter and has to implement the JacisPersistenceAdapter
interface. The persistence adapter can be set at the JacisObjectTypeSpec
with method setPersistenceAdapter
. By default there is no persistence adapter and nothing is persisted at all.
The following methods have to be implemented to fulfill the JacisPersistenceAdapter
interface (some of them are optional):
|
Called after the creation of the store to initialize the objects in the store from the persistent storage.
The objects could be stored using the normal API in the store, but it is also possible to use the |
|
Inherited from the |
|
Called after the prepare phase for the store has been executed (optional). |
|
Called after the commit for the store has been executed (optional). |
|
Called after a rollback for the store has been executed (optional). |
|
Called after the commit for the JACIS container, after all stores have been committed (optional). |
|
Called after the rollback for the JACIS container, after all stores have been committed (optional). |
Furthermore other methods declared by the JacisTransactionListener
can be implemented to react on a certain event.
Usually a transaction adapter has to care about the following tasks:
-
When the store is created it has to initialize the store with the already persisted data. This happens in the
initializeStore
method. -
Each modification done by the store on the committed objects have to be tracked in the
onModification
method. -
The tracked modifications have finally be committed either in the after the commit for the single store (method
afterCommitForStore
) or after the global commit for the whole JACIS container (methodafterCommit
). -
If a transaction is rolled back the tracked modifications have to be discarded.
Next Chapter: MicroStream Persistence Adapter