SPIs provide the persistence and query support into a variety of persistence mechanism. This version of Castor is bundled with an SQL 92 and LDAP persistence SPIs. Additional SPIs can be added, for example, alternative engines streamlined for Oracle, Sybase, DB2 and other databases. This document will describe the persistence mechanism API and SPI to allow for those interested in adding new top level APIs or service providers. The persistence mechanism is responsible for object caching and rollback, locking and deadlock detection, transaction integrity and two phase commit.
All data access goes through the persistence mechanism.
The persistence API is defined in the package org.exolab.castor.persist . The persistence mechanism implements the org.exolab.castor.persist.PersistenceEngine interface, which allows objects to be loaded, created, deleted and locked in the context of a transaction. The actual implementation is obtained from org.exolab.castor.persist.PersistenceEngineFactory . All operations are performed through the context of a transaction. Persistence operations are performed through the org.exolab.castor.persist.TransactionContext interface.