Skip to content

Persistence Adapter

Jan Wiemer edited this page Jan 2, 2021 · 8 revisions

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.

The Persistence Adapter Extension Point

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 set at the object type specification and nothing is persisted at all.

The following methods have to be implemented to fulfill the JacisPersistenceAdapter interface:

void initializeStore(JacisStoreImpl<K, V, ?> store);

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 initStoreNonTransactional methods.

void onModification(K key, V oldValue, V newValue, JacisTransactionHandle tx);

Inherited from the JacisModificationListener interface. The method is called for each object cloned back from a TX-View to the committed objects (see chapter Modification Listener).

void prepareCommit();

Called after the prepare phase for the store has been executed.

void commit();

Called after the commit for the store has been executed.

void rollback();

Called after a rollback for the store has been executed.

Clone this wiki locally