|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface KodoPersistenceManager
Interface implemented by Kodo persistence managers.
Field Summary |
---|
Fields inherited from interface org.apache.openjpa.kernel.ConnectionRetainModes |
---|
CONN_RETAIN_ALWAYS, CONN_RETAIN_DEMAND, CONN_RETAIN_TRANS |
Fields inherited from interface org.apache.openjpa.kernel.LockLevels |
---|
LOCK_NONE, LOCK_READ, LOCK_WRITE |
Fields inherited from interface org.apache.openjpa.kernel.AutoClear |
---|
CLEAR_ALL, CLEAR_DATASTORE |
Fields inherited from interface org.apache.openjpa.event.CallbackModes |
---|
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK |
Method Summary | |
---|---|
void |
addTransactionListener(Object listener)
Register a listener for transaction-related events. |
Object |
attachCopy(Object pc,
boolean transactional)
Attach. |
Collection |
attachCopyAll(Collection pcs,
boolean transactional)
Attach. |
Object[] |
attachCopyAll(Object[] pcs,
boolean transactional)
Attach. |
void |
beginStore()
Begins a store transaction if one isn't already started. |
boolean |
cancelAll()
Cancel all pending data store statements. |
void |
commitAndResume()
Issue a commit and then start a new transaction. |
void |
detachAll()
Detach all managed instances in place following current detach configuration. |
void |
evictAll(Class cls)
Evict all persistent-clean and persistent-nontransactional instances in the extent of the given class (including subclasses). |
void |
evictAll(Extent extent)
Evict all persistent-clean and persistent-nontransactional instances in the given Extent . |
Collection |
getAddedClasses()
Return the set of classes that have been made persistent in the current transaction. |
int |
getAutoClear()
Whether to clear state when entering transactions. |
Object |
getCachedObjectById(Object oid)
Return the cached instance for the given oid/object, or null if not cached. |
ClassLoader |
getClassLoader()
Return the current thread's class loader at the time this persistence manager was obtained from the factory. |
OpenJPAConfiguration |
getConfiguration()
Return the configuration associated with this persistence manager. |
String |
getConnectionPassword()
Return the connection password. |
int |
getConnectionRetainMode()
Return the connection retain mode for this persistence manager. |
String |
getConnectionUserName()
Return the connection user name. |
Collection |
getDeletedClasses()
Return the set of classes that have been deleted in the current transaction. |
boolean |
getDetachAllOnClose()
Whether to detach all instances on close. |
boolean |
getDetachAllOnNontransactionalRead()
Whether to detach all instances after a nontransactional read. |
boolean |
getDetachAllOnRollback()
Whether to detach all instances on rollback / commit failure. |
Collection |
getDirtyClasses()
Return the set of classes that have been made dirty in the current transaction. |
Collection |
getDirtyObjects()
Return a set of current dirty instances. |
boolean |
getEvictFromDataStoreCache()
Whether to also evict an object from the data cache when it is evicted through this persistence manager. |
Sequence |
getFieldSequence(Class forClass,
String fieldName)
Returns a Sequence for the generated values of the specified
type, or null if the field value is not generated. |
Sequence |
getIdentitySequence(Class forClass)
Returns a Sequence for the datastore identity values of the
specified type, or null if the type's identity cannot be represented
by a sequence. |
int |
getInstanceLifecycleListenerCallbackMode()
The CallbackModes flags for handling lifecycle listener
exceptions. |
Collection |
getManagedObjects()
Return a set of all managed instances. |
ManagedRuntime |
getManagedRuntime()
Return the managed runtime in use. |
boolean |
getOrderDirtyObjects()
Whether dirty objects will be returned in the order they were dirtied. |
Collection |
getPendingTransactionalObjects()
Return a set of instances which will become transactional upon] the next transaction. |
boolean |
getPopulateDataStoreCache()
Whether objects accessed during this transaction will be added to the store cache. |
boolean |
getRestoreMutableValues()
Whether to restore mutable fields on rollback. |
boolean |
getSyncWithManagedTransactions()
Whether to check for a global transaction upon every managed, non-transactional operation. |
Collection |
getTransactionalObjects()
Return a set of current transaction instances. |
int |
getTransactionListenerCallbackMode()
The CallbackModes flags for handling transaction listener
exceptions. |
Collection |
getUpdatedClasses()
Return the set of classes for objects that have been modified in the current transaction. |
boolean |
isLargeTransaction()
Whether memory usage is reduced during this transaction at the expense of possibly more aggressive data cache evictions. |
boolean |
isManaged()
Whether this persistence manager is using managed transactions. |
boolean |
isStoreActive()
Return true if the store has an active transaction (as opposed to Transaction.isActive() which works at the logical transaction
level. |
void |
lockPersistent(Object pc)
Ensure that the given instance is locked at the current lock level, as set in the fetch plan for the persistence manager. |
void |
lockPersistent(Object pc,
int level,
int timeout)
Ensure that the given instance is locked at the given lock level. |
void |
lockPersistentAll(Collection pcs)
Ensure that the given instances are locked at the current lock level, as set in the fetch plan for the persistence manager. |
void |
lockPersistentAll(Collection pcs,
int level,
int timeout)
Ensure that the given instances are locked at the given lock level. |
void |
lockPersistentAll(Object[] pcs)
Ensure that the given instances are locked at the current lock level, as set in the fetch plan for the persistence manager. |
void |
lockPersistentAll(Object[] pcs,
int level,
int timeout)
Ensure that the given instances are locked at the given lock level. |
void |
makeClassDirty(Class cls)
Mark the given class as dirty within the current transaction. |
void |
preFlush()
Run pre-flush actions on transactional objects, including persistence-by-reachability, inverse relationship management, deletion of dependent instances, and instance callbacks. |
void |
releaseSavepoint()
Release the last set savepoint and any resources associated with it. |
void |
releaseSavepoint(String name)
Release the savepoint and any resources associated with it. |
void |
removeTransactionListener(Object listener)
Remove a listener for transaction-related events. |
void |
retrieve(Object pc,
boolean dfgOnly)
Retrieve the persistent state of the given object. |
void |
rollbackAndResume()
Issue a rollback and then start a new transaction. |
void |
rollbackToSavepoint()
Rollback the current transaction to the last savepoint. |
void |
rollbackToSavepoint(String name)
Rollback the current transaction to the given savepoint name. |
void |
setAutoClear(int clear)
Whether to clear state when entering transactions. |
void |
setDetachAllOnClose(boolean detach)
Whether to detach all instances on close. |
void |
setDetachAllOnNontransactionalRead(boolean detach)
Whether to detach all instances after a nontransactional read. |
void |
setDetachAllOnRollback(boolean detach)
Whether to detach all instances on rollback / commit failure. |
void |
setEvictFromDataStoreCache(boolean evict)
Whether to also evict an object from the data cache when it is evicted through this persistence manager. |
void |
setInstanceLifecycleListenerCallbackMode(int callbackMode)
The CallbackModes flags for handling lifecycle listener
exceptions. |
void |
setLargeTransaction(boolean largeTransaction)
If a large number of objects will be created, modified, or deleted during this transaction setting this option to true will reduce memory usage if you perform periodic flushes. |
void |
setOrderDirtyObjects(boolean order)
Whether dirty objects will be returned in the order they were dirtied. |
void |
setPopulateDataStoreCache(boolean cache)
Whether to populate the store cache with objects used by this transaction. |
void |
setRestoreMutableValues(boolean restore)
Whether to restore mutable fields on rollback. |
void |
setSavepoint(String name)
Set a transactional savepoint where operations after this savepoint will be rolled back. |
void |
setSyncWithManagedTransactions(boolean resync)
Whether to check for a global transaction upon every managed, non-transactional operation. |
void |
setTransactionListenerCallbackMode(int callbackMode)
The CallbackModes flags for handling transaction listener
exceptions. |
Methods inherited from interface javax.jdo.Transaction |
---|
begin, commit, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManager, getRestoreValues, getRetainValues, getRollbackOnly, getSynchronization, isActive, rollback, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setRestoreValues, setRetainValues, setRollbackOnly, setSynchronization |
Methods inherited from interface javax.resource.cci.Connection |
---|
close, createInteraction, getLocalTransaction, getMetaData, getResultSetInfo |
Methods inherited from interface javax.resource.cci.LocalTransaction |
---|
begin, commit, rollback |
Methods inherited from interface javax.resource.spi.LocalTransaction |
---|
begin, commit, rollback |
Methods inherited from interface org.apache.openjpa.lib.util.Closeable |
---|
close |
Method Detail |
---|
OpenJPAConfiguration getConfiguration()
int getConnectionRetainMode()
ConnectionRetainModes
boolean isManaged()
ManagedRuntime getManagedRuntime()
boolean getSyncWithManagedTransactions()
void setSyncWithManagedTransactions(boolean resync)
ClassLoader getClassLoader()
String getConnectionUserName()
String getConnectionPassword()
boolean getRestoreMutableValues()
void setRestoreMutableValues(boolean restore)
boolean getDetachAllOnRollback()
void setDetachAllOnRollback(boolean detach)
boolean getDetachAllOnClose()
void setDetachAllOnClose(boolean detach)
boolean getDetachAllOnNontransactionalRead()
void setDetachAllOnNontransactionalRead(boolean detach)
int getAutoClear()
AutoClear
void setAutoClear(int clear)
AutoClear
boolean getEvictFromDataStoreCache()
void setEvictFromDataStoreCache(boolean evict)
boolean getPopulateDataStoreCache()
void setPopulateDataStoreCache(boolean cache)
boolean isLargeTransaction()
void setLargeTransaction(boolean largeTransaction)
int getInstanceLifecycleListenerCallbackMode()
CallbackModes
flags for handling lifecycle listener
exceptions.
void setInstanceLifecycleListenerCallbackMode(int callbackMode)
CallbackModes
flags for handling lifecycle listener
exceptions.
void addTransactionListener(Object listener)
void removeTransactionListener(Object listener)
int getTransactionListenerCallbackMode()
CallbackModes
flags for handling transaction listener
exceptions.
void setTransactionListenerCallbackMode(int callbackMode)
CallbackModes
flags for handling transaction listener
exceptions.
Object getCachedObjectById(Object oid)
oid
- the object's id
boolean isStoreActive()
Transaction.isActive()
which works at the logical transaction
level.
void beginStore()
void commitAndResume()
pm.commit (); pm.begin ();except that the persistence manager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
Transaction.commit()
,
Transaction.begin()
void rollbackAndResume()
pm.rollback (); pm.begin ();except that the persistence manager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
Transaction.rollback()
,
Transaction.begin()
void setSavepoint(String name)
void rollbackToSavepoint()
void rollbackToSavepoint(String name)
void releaseSavepoint()
void releaseSavepoint(String name)
void preFlush()
void retrieve(Object pc, boolean dfgOnly)
retrieve
in interface PersistenceManager
dfgOnly
- indicator as to whether to retrieve only fields
in the current fetch groups, or all fieldsvoid evictAll(Class cls)
void evictAll(Extent extent)
Extent
.
void detachAll()
getManagedObjects()
Object attachCopy(Object pc, boolean transactional)
PersistenceManager.makePersistent(java.lang.Object)
, this
method copies new instances.
Collection attachCopyAll(Collection pcs, boolean transactional)
PersistenceManager.makePersistent(java.lang.Object)
, this
method copies new instances.
Object[] attachCopyAll(Object[] pcs, boolean transactional)
PersistenceManager.makePersistent(java.lang.Object)
, this
method copies new instances.
void lockPersistent(Object pc, int level, int timeout)
pc
- the object to locklevel
- the lock level to usetimeout
- the number of milliseconds to wait for the lock before
giving up, or -1 for no limitvoid lockPersistent(Object pc)
void lockPersistentAll(Collection pcs, int level, int timeout)
pcs
- the objects to locklevel
- the lock level to usetimeout
- the number of milliseconds to wait for the lock before
giving up, or -1 for no limitvoid lockPersistentAll(Collection pcs)
void lockPersistentAll(Object[] pcs, int level, int timeout)
pcs
- the objects to locklevel
- the lock level to usetimeout
- the number of milliseconds to wait for the lock before
giving up, or -1 for no limitvoid lockPersistentAll(Object[] pcs)
boolean cancelAll()
Sequence getIdentitySequence(Class forClass)
Sequence
for the datastore identity values of the
specified type, or null if the type's identity cannot be represented
by a sequence.
Sequence getFieldSequence(Class forClass, String fieldName)
Sequence
for the generated values of the specified
type, or null if the field value is not generated.
Collection getManagedObjects()
Collection getTransactionalObjects()
Collection getPendingTransactionalObjects()
Collection getDirtyObjects()
boolean getOrderDirtyObjects()
void setOrderDirtyObjects(boolean order)
void makeClassDirty(Class cls)
Collection getDirtyClasses()
makeClassDirty(java.lang.Class)
.
Collection getAddedClasses()
Collection getDeletedClasses()
Collection getUpdatedClasses()
|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |