Kodo 4.2.0. (DEPRECATED)

kodo.jdo
Interface KodoPersistenceManager

All Superinterfaces:
AutoClear, CallbackModes, Closeable, Connection, ConnectionRetainModes, LocalTransaction, LockLevels, PersistenceManager, Transaction

public interface KodoPersistenceManager
extends PersistenceManager, Transaction, Connection, LocalTransaction, LocalTransaction, Closeable, ConnectionRetainModes, LockLevels, AutoClear, CallbackModes

Interface implemented by Kodo persistence managers.

Since:
3.0

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.PersistenceManager
addInstanceLifecycleListener, checkConsistency, close, currentTransaction, deletePersistent, deletePersistentAll, deletePersistentAll, detachCopy, detachCopyAll, detachCopyAll, evict, evictAll, evictAll, evictAll, flush, getDataStoreConnection, getDetachAllOnCommit, getExtent, getExtent, getFetchPlan, getIgnoreCache, getMultithreaded, getObjectById, getObjectById, getObjectById, getObjectId, getObjectIdClass, getObjectsById, getObjectsById, getObjectsById, getObjectsById, getPersistenceManagerFactory, getSequence, getTransactionalObjectId, getUserObject, getUserObject, isClosed, makeNontransactional, makeNontransactionalAll, makeNontransactionalAll, makePersistent, makePersistentAll, makePersistentAll, makeTransactional, makeTransactionalAll, makeTransactionalAll, makeTransient, makeTransient, makeTransientAll, makeTransientAll, makeTransientAll, makeTransientAll, newInstance, newNamedQuery, newObjectIdInstance, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, putUserObject, refresh, refreshAll, refreshAll, refreshAll, refreshAll, removeInstanceLifecycleListener, removeUserObject, retrieve, retrieveAll, retrieveAll, retrieveAll, retrieveAll, setDetachAllOnCommit, setIgnoreCache, setMultithreaded, setUserObject
 
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

getConfiguration

OpenJPAConfiguration getConfiguration()
Return the configuration associated with this persistence manager.


getConnectionRetainMode

int getConnectionRetainMode()
Return the connection retain mode for this persistence manager.

See Also:
ConnectionRetainModes

isManaged

boolean isManaged()
Whether this persistence manager is using managed transactions.


getManagedRuntime

ManagedRuntime getManagedRuntime()
Return the managed runtime in use.


getSyncWithManagedTransactions

boolean getSyncWithManagedTransactions()
Whether to check for a global transaction upon every managed, non-transactional operation. Defaults to false.


setSyncWithManagedTransactions

void setSyncWithManagedTransactions(boolean resync)
Whether to check for a global transaction upon every managed, non-transactional operation. Defaults to false.


getClassLoader

ClassLoader getClassLoader()
Return the current thread's class loader at the time this persistence manager was obtained from the factory.


getConnectionUserName

String getConnectionUserName()
Return the connection user name.


getConnectionPassword

String getConnectionPassword()
Return the connection password.


getRestoreMutableValues

boolean getRestoreMutableValues()
Whether to restore mutable fields on rollback.


setRestoreMutableValues

void setRestoreMutableValues(boolean restore)
Whether to restore mutable fields on rollback.


getDetachAllOnRollback

boolean getDetachAllOnRollback()
Whether to detach all instances on rollback / commit failure.


setDetachAllOnRollback

void setDetachAllOnRollback(boolean detach)
Whether to detach all instances on rollback / commit failure.


getDetachAllOnClose

boolean getDetachAllOnClose()
Whether to detach all instances on close.


setDetachAllOnClose

void setDetachAllOnClose(boolean detach)
Whether to detach all instances on close.


getDetachAllOnNontransactionalRead

boolean getDetachAllOnNontransactionalRead()
Whether to detach all instances after a nontransactional read.


setDetachAllOnNontransactionalRead

void setDetachAllOnNontransactionalRead(boolean detach)
Whether to detach all instances after a nontransactional read.


getAutoClear

int getAutoClear()
Whether to clear state when entering transactions.

See Also:
AutoClear

setAutoClear

void setAutoClear(int clear)
Whether to clear state when entering transactions.

See Also:
AutoClear

getEvictFromDataStoreCache

boolean getEvictFromDataStoreCache()
Whether to also evict an object from the data cache when it is evicted through this persistence manager.


setEvictFromDataStoreCache

void setEvictFromDataStoreCache(boolean evict)
Whether to also evict an object from the data cache when it is evicted through this persistence manager.


getPopulateDataStoreCache

boolean getPopulateDataStoreCache()
Whether objects accessed during this transaction will be added to the store cache. Defaults to true.

Since:
3.4

setPopulateDataStoreCache

void setPopulateDataStoreCache(boolean cache)
Whether to populate the store cache with objects used by this transaction. Defaults to true.

Since:
3.4

isLargeTransaction

boolean isLargeTransaction()
Whether memory usage is reduced during this transaction at the expense of possibly more aggressive data cache evictions.

Since:
3.4

setLargeTransaction

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.

Since:
3.4

getInstanceLifecycleListenerCallbackMode

int getInstanceLifecycleListenerCallbackMode()
The CallbackModes flags for handling lifecycle listener exceptions.

Since:
4.1

setInstanceLifecycleListenerCallbackMode

void setInstanceLifecycleListenerCallbackMode(int callbackMode)
The CallbackModes flags for handling lifecycle listener exceptions.

Since:
4.1

addTransactionListener

void addTransactionListener(Object listener)
Register a listener for transaction-related events.

Since:
2.5

removeTransactionListener

void removeTransactionListener(Object listener)
Remove a listener for transaction-related events.

Since:
2.5

getTransactionListenerCallbackMode

int getTransactionListenerCallbackMode()
The CallbackModes flags for handling transaction listener exceptions.

Since:
4.1

setTransactionListenerCallbackMode

void setTransactionListenerCallbackMode(int callbackMode)
The CallbackModes flags for handling transaction listener exceptions.

Since:
4.1

getCachedObjectById

Object getCachedObjectById(Object oid)
Return the cached instance for the given oid/object, or null if not cached.

Parameters:
oid - the object's id
Returns:
the cached object, or null if not cached

isStoreActive

boolean isStoreActive()
Return true if the store has an active transaction (as opposed to Transaction.isActive() which works at the logical transaction level.


beginStore

void beginStore()
Begins a store transaction if one isn't already started. The persistence manager must already be in a logical transaction.


commitAndResume

void commitAndResume()
Issue a commit and then start a new transaction. This is identical to:
 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.

Since:
2.4
See Also:
Transaction.commit(), Transaction.begin()

rollbackAndResume

void rollbackAndResume()
Issue a rollback and then start a new transaction. This is identical to:
        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.

Since:
2.4
See Also:
Transaction.rollback(), Transaction.begin()

setSavepoint

void setSavepoint(String name)
Set a transactional savepoint where operations after this savepoint will be rolled back.


rollbackToSavepoint

void rollbackToSavepoint()
Rollback the current transaction to the last savepoint. Savepoints set after this one will become invalid.


rollbackToSavepoint

void rollbackToSavepoint(String name)
Rollback the current transaction to the given savepoint name. Savepoints set after this one will become invalid.


releaseSavepoint

void releaseSavepoint()
Release the last set savepoint and any resources associated with it. The given savepoint and any set after it will become invalid.


releaseSavepoint

void releaseSavepoint(String name)
Release the savepoint and any resources associated with it. The given savepoint and any set after it will become invalid.


preFlush

void preFlush()
Run pre-flush actions on transactional objects, including persistence-by-reachability, inverse relationship management, deletion of dependent instances, and instance callbacks. Transaction listeners are not invoked.

Since:
3.3

retrieve

void retrieve(Object pc,
              boolean dfgOnly)
Retrieve the persistent state of the given object.

Specified by:
retrieve in interface PersistenceManager
Parameters:
dfgOnly - indicator as to whether to retrieve only fields in the current fetch groups, or all fields

evictAll

void evictAll(Class cls)
Evict all persistent-clean and persistent-nontransactional instances in the extent of the given class (including subclasses).


evictAll

void evictAll(Extent extent)
Evict all persistent-clean and persistent-nontransactional instances in the given Extent.


detachAll

void detachAll()
Detach all managed instances in place following current detach configuration.

See Also:
getManagedObjects()

attachCopy

Object attachCopy(Object pc,
                  boolean transactional)
Attach. Unlike PersistenceManager.makePersistent(java.lang.Object), this method copies new instances.


attachCopyAll

Collection attachCopyAll(Collection pcs,
                         boolean transactional)
Attach. Unlike PersistenceManager.makePersistent(java.lang.Object), this method copies new instances.


attachCopyAll

Object[] attachCopyAll(Object[] pcs,
                       boolean transactional)
Attach. Unlike PersistenceManager.makePersistent(java.lang.Object), this method copies new instances.


lockPersistent

void lockPersistent(Object pc,
                    int level,
                    int timeout)
Ensure that the given instance is locked at the given lock level.

Parameters:
pc - the object to lock
level - the lock level to use
timeout - the number of milliseconds to wait for the lock before giving up, or -1 for no limit
Since:
3.1

lockPersistent

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.

Since:
3.1

lockPersistentAll

void lockPersistentAll(Collection pcs,
                       int level,
                       int timeout)
Ensure that the given instances are locked at the given lock level.

Parameters:
pcs - the objects to lock
level - the lock level to use
timeout - the number of milliseconds to wait for the lock before giving up, or -1 for no limit
Since:
3.1

lockPersistentAll

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.

Since:
3.1

lockPersistentAll

void lockPersistentAll(Object[] pcs,
                       int level,
                       int timeout)
Ensure that the given instances are locked at the given lock level.

Parameters:
pcs - the objects to lock
level - the lock level to use
timeout - the number of milliseconds to wait for the lock before giving up, or -1 for no limit
Since:
3.1

lockPersistentAll

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.

Since:
3.1

cancelAll

boolean cancelAll()
Cancel all pending data store statements. If statements are cancelled while a flush is in progress, the transaction rollback only flag will be set.

Returns:
true if any statements were cancelled, false otherwise
Since:
3.1

getIdentitySequence

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.


getFieldSequence

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.


getManagedObjects

Collection getManagedObjects()
Return a set of all managed instances.


getTransactionalObjects

Collection getTransactionalObjects()
Return a set of current transaction instances.


getPendingTransactionalObjects

Collection getPendingTransactionalObjects()
Return a set of instances which will become transactional upon] the next transaction.


getDirtyObjects

Collection getDirtyObjects()
Return a set of current dirty instances.


getOrderDirtyObjects

boolean getOrderDirtyObjects()
Whether dirty objects will be returned in the order they were dirtied. Default is determined by the store manager.


setOrderDirtyObjects

void setOrderDirtyObjects(boolean order)
Whether dirty objects will be returned in the order they were dirtied. Default is determined by the store manager.


makeClassDirty

void makeClassDirty(Class cls)
Mark the given class as dirty within the current transaction.

Since:
3.0

getDirtyClasses

Collection getDirtyClasses()
Return the set of classes that have been made dirty in the current transaction. Classes are made dirty automatically when an instance becomes dirty, or through explicit calls to makeClassDirty(java.lang.Class).

Since:
3.0

getAddedClasses

Collection getAddedClasses()
Return the set of classes that have been made persistent in the current transaction.

Since:
3.4

getDeletedClasses

Collection getDeletedClasses()
Return the set of classes that have been deleted in the current transaction.

Since:
3.4

getUpdatedClasses

Collection getUpdatedClasses()
Return the set of classes for objects that have been modified in the current transaction.

Since:
3.4

Kodo 4.2.0. (DEPRECATED)

Copyright 2011 Oracle, Inc. All Rights Reserved.

This documentation is deprecated and will be removed in the next release of WebLogic Server.


Oracle Fusion Middleware Oracle Kodo 4.2.0 API Reference (DEPRECATED)
11g Release 1 (10.3.6)
Part Number E13950-02