| com.versant.core.storagemanager.StorageManager
All known Subclasses: com.versant.core.jdbc.JdbcStorageManager, com.versant.core.storagemanager.logging.LoggingStorageManager,
StorageManager | public interface StorageManager (Code) | | This keeps track of server side transaction and other information for a
application level session (e.g. a PersistenceManager for JDO) and provides
persistence services for
State instances.
These methods are designed to be used from an application API layer
(e.g. JDO PersistenceManager) that may be in a different tier.
All calls from the application API layer go through this interface. For
example there are methods to return results from queries that could have
been implemented via a separate "server side query result" interface.
The query related methods need a lot more refactoring but one thing at
a time ...
|
Method Summary | |
public void | begin(boolean optimistic) Begin a tx using the optimistic or datastore transation model. | public void | closeQuery(RunningQuery runningQuery) Close the query. | public void | commit() Commit the tx. | public CompiledQuery | compileQuery(QueryDetails query) Compile a query into a form for the datastore (e.g. | public OID | createOID(ClassMetaData cmd) Create a real OID for a new instance. | public void | destroy() Destroy cleaning up all resources. | public ExecuteQueryReturn | executeQuery(ApplicationContext context, QueryDetails query, CompiledQuery compiledQuery, Object[] params) Execute a query. | public QueryResultContainer | executeQueryAll(ApplicationContext context, QueryDetails query, CompiledQuery compiledQuery, Object[] params) Prepare and execute the query, returning all results in the supplied
container. | public int | executeQueryCount(QueryDetails query, CompiledQuery compiledQuery, Object[] params) Prepare and execute the query and return the number of results
using count(*) or something similar. | public StatesReturned | fetch(ApplicationContext context, OID oid, State current, FetchGroup fetchGroup, FieldMetaData triggerField) Get the State for an OID. | public StatesReturned | fetch(ApplicationContext context, OIDArray oids, FieldMetaData triggerField) Get the States for a batch of OIDs. | public QueryResultContainer | fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, int skipAmount) Return the next batch of results for the query. | public QueryResultContainer | fetchRandomAccessQueryResult(ApplicationContext context, RunningQuery runningQuery, int index, int fetchAmount) This is used by random access queries to return absolute results. | public Object | getDatastoreConnection() Get the underlying datastore connection. | public StorageManager | getInnerStorageManager() If we are decorating another SM then return it. | public int | getLockingPolicy() Get the locking policy. | public VersantQueryPlan | getQueryPlan(QueryDetails query, CompiledQuery compiledQuery, Object[] params) Get the datastore specific query plan for the query (e.g. | public int | getRandomAccessQueryCount(ApplicationContext context, RunningQuery runningQuery) This is used by random access queries to return the number of results. | public Map | getStatus() Get internal status information in the form of property -> value pairs. | public boolean | hasDatastoreConnection() | public boolean | isNotifyDirty() | public void | logEvent(int level, String description, int ms) Log an event to our event log. | public void | notifyDirty(OID oid) The object for the oid is about to become dirty or deleted. | public void | reset() Restore to an initial inactive state. | public void | rollback() Rollback a tx. | public void | setConnectionPolicy(int policy) Control pinning of datastore connections. | public void | setLockingPolicy(int policy) Control locking of objects in datastore transactions. | public void | setUserObject(Object o) Set a userObject on this SM. | public StatesReturned | store(StatesToStore toStore, DeletePacket toDelete, boolean returnFieldsUpdatedBySM, int storeOption, boolean evictClasses) Persist a graph of State's (insert, update and delete). |
CON_POLICY_PIN | final public static int CON_POLICY_PIN(Code) | | Pin the datastore connection indefinitely (even between tx's).
|
CON_POLICY_PIN_FOR_TX | final public static int CON_POLICY_PIN_FOR_TX(Code) | | Pin the datastore connection for the duration of the tx.
|
CON_POLICY_RELEASE | final public static int CON_POLICY_RELEASE(Code) | | Release the datastore connection as quickly as possible.
|
EVENT_ALL | final public static int EVENT_ALL(Code) | | |
EVENT_ERRORS | final public static int EVENT_ERRORS(Code) | | |
EVENT_NORMAL | final public static int EVENT_NORMAL(Code) | | |
EVENT_VERBOSE | final public static int EVENT_VERBOSE(Code) | | |
LOCK_POLICY_ALL | final public static int LOCK_POLICY_ALL(Code) | | Lock all objects in datastore tx.
|
LOCK_POLICY_FIRST | final public static int LOCK_POLICY_FIRST(Code) | | Lock only the first object navigated or fetched in datastore tx.
|
LOCK_POLICY_NONE | final public static int LOCK_POLICY_NONE(Code) | | Do not lock any objects in datastore tx.
|
STORE_OPTION_COMMIT | final public static int STORE_OPTION_COMMIT(Code) | | Call commit after store.
|
STORE_OPTION_FLUSH | final public static int STORE_OPTION_FLUSH(Code) | | Send changes to the datastore and do not commit.
|
STORE_OPTION_PREPARE | final public static int STORE_OPTION_PREPARE(Code) | | Call prepareForCommit after store.
|
begin | public void begin(boolean optimistic)(Code) | | Begin a tx using the optimistic or datastore transation model.
|
createOID | public OID createOID(ClassMetaData cmd)(Code) | | Create a real OID for a new instance. This is called prior to commit
when the real OID is required. If it is not possible to create the
OID (e.g. an IDENTITY column in JDBC) then an exception must be
thrown. For these classes a flush must be done instead.
|
destroy | public void destroy()(Code) | | Destroy cleaning up all resources. No methods should be invoked on a
destroyed StorageManager but the StorageManager is not required to
enforce this.
|
executeQuery | public ExecuteQueryReturn executeQuery(ApplicationContext context, QueryDetails query, CompiledQuery compiledQuery, Object[] params)(Code) | | Execute a query. If compiledQuery is not null then query is ignored
and may be null. If compiledQuery is null then query is used to compile
the query. The compiledQuery is accessable through the returned
ExecuteQueryReturn instance for reuse in future calls.
|
executeQueryCount | public int executeQueryCount(QueryDetails query, CompiledQuery compiledQuery, Object[] params)(Code) | | Prepare and execute the query and return the number of results
using count(*) or something similar.
|
getDatastoreConnection | public Object getDatastoreConnection()(Code) | | Get the underlying datastore connection. If no connection is associated
with this StorageManager then one is allocated and pinned. The returned
object must be a proxy for the real connection that is returned when
its "close" method is called.
|
getInnerStorageManager | public StorageManager getInnerStorageManager()(Code) | | If we are decorating another SM then return it. Otherwise return null.
|
getLockingPolicy | public int getLockingPolicy()(Code) | | Get the locking policy.
|
getRandomAccessQueryCount | public int getRandomAccessQueryCount(ApplicationContext context, RunningQuery runningQuery)(Code) | | This is used by random access queries to return the number of results.
|
getStatus | public Map getStatus()(Code) | | Get internal status information in the form of property -> value pairs.
|
hasDatastoreConnection | public boolean hasDatastoreConnection()(Code) | | Are we holding a datastore connection?
|
logEvent | public void logEvent(int level, String description, int ms)(Code) | | Log an event to our event log.
|
reset | public void reset()(Code) | | Restore to an initial inactive state.
|
rollback | public void rollback()(Code) | | Rollback a tx.
|
setUserObject | public void setUserObject(Object o)(Code) | | Set a userObject on this SM.
|
store | public StatesReturned store(StatesToStore toStore, DeletePacket toDelete, boolean returnFieldsUpdatedBySM, int storeOption, boolean evictClasses)(Code) | | Persist a graph of State's (insert, update and delete). For some states
persisting them will change some of their fields (e.g. autoset fields)
and the new values of these fields must be returned if
returnFieldsUpdatedBySM is true.
Parameters: returnFieldsUpdatedBySM - Return States containing any fieldsupdated by us (i.e. instead of using the value in the incomingState, if any) in returned. Parameters: storeOption - Option to prepare or commit the tx after the storeoperation (StorageManager.STORE_OPTION_PREPARE,StorageManager.STORE_OPTION_COMMIT, StorageManager.STORE_OPTION_FLUSH). Parameters: evictClasses - If this is true then classes with instancesmodified in the transaction are evicted instead of the instances |
|
|