|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface implemented by Kodo persistence managers.
Field Summary | |
static int |
CONN_RETAIN_DEMAND
Constant indicating that connections will be obtained as needed. |
static int |
CONN_RETAIN_PM
Constant indicating that each persistence manager will retain a single connection that it will use for its lifespan. |
static int |
CONN_RETAIN_TRANS
Constant indicating that connections will be retained for the life of each transaction. |
static int |
DETACH_ALL
Mode to detach all fields. |
static int |
DETACH_FGS
Mode to detach all fields in the current fetch groups. |
static int |
DETACH_LOADED
Mode to detach all currently-loaded fields. |
static int |
LOCK_NONE
No lock. |
static int |
LOCK_READ
Generic read lock level. |
static int |
LOCK_WRITE
Generic write lock level. |
static int |
LOOKUP_CHECK
Mode to check that oids with no corresponding cached instance represent records in the database for calls to PersistenceManager.getObjectById(java.lang.Object, boolean) when the validate parameter is
false. |
static int |
LOOKUP_HOLLOW
Mode to return hollow objects from PersistenceManager.getObjectById(java.lang.Object, boolean) when the validate parameter
is false. |
Method Summary | |
void |
addInstanceLifecycleListener(InstanceLifecycleListener listener,
Class[] classes)
JDO 2.0 Preview. |
Object |
attach(Object pc)
JDO 2.0 Preview. |
Collection |
attachAll(Collection pcs)
JDO 2.0 Preview. |
Object[] |
attachAll(Object[] pcs)
JDO 2.0 Preview. |
boolean |
cancelAll()
Cancel all pending data store statements. |
void |
checkConsistency()
JDO 2.0 Preview. |
void |
commitAndResume()
Issue a commit and then start a new transaction. |
Object |
detach(Object pc)
JDO 2.0 Preview. |
Collection |
detachAll(Collection pcs)
JDO 2.0 Preview. |
Object[] |
detachAll(Object[] pcs)
JDO 2.0 Preview. |
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 . |
void |
flush()
JDO 2.0 Preview. |
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 persistence manager factory. |
JDOConfiguration |
getConfiguration()
Return the configuration associated with this persistence manager. |
Object |
getConnection()
Return the connection in use by the persistence manager, or a new connection if none. |
String |
getConnectionPassword()
Return the connection password. |
int |
getConnectionRetainMode()
Return the connection retain mode for this persistence manager. |
String |
getConnectionUserName()
Return the connection user name. |
int |
getDetachFields()
Detach mode constant to determine which fields are part of the detached graph. |
boolean |
getDetachOnClose()
Whether to detach all persistent managed objects when the persistence manager closes. |
Collection |
getDirtyClasses()
Return the set of classes that have been made dirty in the current transaction. |
FetchConfiguration |
getFetchConfiguration()
Return the (mutable) fetch configuration for loading objects from this persistence manager. |
Collection |
getManagedObjects()
Return a list of all managed instances. |
ManagedRuntime |
getManagedRuntime()
Return the managed runtime in use. |
Object |
getObjectById(Class cls,
Object val)
JDO 2.0 Preview. |
int |
getObjectLookupMode()
Whether to return hollow objects from PersistenceManager.getObjectById(java.lang.Object, boolean) when the validate parameter
is false. |
Object[] |
getObjectsById(Object[] oids,
boolean validate)
JDO 2.0 Preview. |
boolean |
getRetainValuesInOptimistic()
Per-persistence manager configuration of whether to retain values when entering an optimistic transaction. |
boolean |
getRollbackOnly()
JDO 2.0 Preview. |
KodoStateManager |
getState(Object oid)
Deprecated. replaced by KodoPersistenceManagerSPI.getStateManager(java.lang.Object) |
KodoStateManager |
getStateManager(Object pc)
Deprecated. replaced by KodoPersistenceManagerSPI.getStateManager(java.lang.Object) |
StoreManager |
getStoreManager(boolean unwrap)
Deprecated. replaced by KodoPersistenceManagerSPI.getStoreManager(boolean) |
Collection |
getTransactionalObjects()
Return a list of current transaction instances. |
Object |
getUserObject(Object key)
JDO 2.0 Preview. |
boolean |
isManaged()
Whether this persistence manager is using managed transactions. |
void |
lockPersistent(Object pc)
Ensure that the given instance is locked at the current lock level, as set in the FetchConfiguration 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 FetchConfiguration 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 FetchConfiguration 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. |
Query |
newNamedQuery(Class cls,
String name)
JDO 2.0 Preview. |
Object |
newObjectIdInstance(Class cls,
Object val)
JDO 2.0 Preview. |
void |
preFlush()
Run pre-flush actions on transactional objects, including persistence-by-reachability, inverse relationship management, deletion of dependent instances, and instance callbacks. |
Object |
putUserObject(Object key,
Object val)
JDO 2.0 Preview. |
void |
refreshAll(JDOException excep)
JDO 2.0 Preview. |
void |
registerListener(TransactionListener tl)
Register a listener for transaction-related events. |
void |
removeInstanceLifecycleListener(InstanceLifecycleListener listener)
JDO 2.0 Preview. |
boolean |
removeListener(TransactionListener tl)
Remove a listener for transaction-related events. |
Object |
removeUserObject(Object key)
JDO 2.0 Preview. |
void |
retrieve(Object pc,
boolean dfgOnly)
Immediately load the given object's persistent fields. |
void |
rollbackAndResume()
Issue a rollback and then start a new transaction. |
void |
setDetachFields(int mode)
Detach mode constant to determine which fields are part of the detached graph. |
void |
setDetachOnClose(boolean detach)
Whether to detach all persistent managed objects when the persistence manager closes. |
void |
setObjectLookupMode(int mode)
Whether to return hollow objects from PersistenceManager.getObjectById(java.lang.Object, boolean) when the validate parameter
is false. |
void |
setRetainValuesInOptimistic(boolean retain)
Per-persistence manager configuration of whether to retain values when entering an optimistic transaction. |
void |
setRollbackOnly()
JDO 2.0 Preview. |
Methods inherited from interface javax.jdo.Transaction |
begin, commit, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManager, getRestoreValues, getRetainValues, getSynchronization, isActive, rollback, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setRestoreValues, setRetainValues, setSynchronization |
Methods inherited from interface javax.transaction.Synchronization |
afterCompletion, beforeCompletion |
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 com.solarmetric.util.Closeable |
close |
Methods inherited from interface com.solarmetric.profile.ProfilingAgentProvider |
getProfilingAgent |
Field Detail |
public static final int LOOKUP_CHECK
PersistenceManager.getObjectById(java.lang.Object, boolean)
when the validate parameter is
false.public static final int LOOKUP_HOLLOW
PersistenceManager.getObjectById(java.lang.Object, boolean)
when the validate parameter
is false.public static final int CONN_RETAIN_DEMAND
public static final int CONN_RETAIN_TRANS
public static final int CONN_RETAIN_PM
public static final int LOCK_NONE
FetchConfiguration
.public static final int LOCK_READ
FetchConfiguration
.public static final int LOCK_WRITE
FetchConfiguration
.public static final int DETACH_FGS
public static final int DETACH_LOADED
public static final int DETACH_ALL
Method Detail |
public JDOConfiguration getConfiguration()
public boolean getRetainValuesInOptimistic()
public void setRetainValuesInOptimistic(boolean retain)
public int getObjectLookupMode()
PersistenceManager.getObjectById(java.lang.Object, boolean)
when the validate parameter
is false.public void setObjectLookupMode(int mode)
PersistenceManager.getObjectById(java.lang.Object, boolean)
when the validate parameter
is false.public FetchConfiguration getFetchConfiguration()
public int getConnectionRetainMode()
public Object getConnection()
pm.currentTransaction().getOptimistic() == false
).
When finished with this connection, you should close it as appropriate.public boolean isManaged()
public ManagedRuntime getManagedRuntime()
public ClassLoader getClassLoader()
public String getConnectionUserName()
public String getConnectionPassword()
public void registerListener(TransactionListener tl)
public boolean removeListener(TransactionListener tl)
public void commitAndResume()
pm.currentTransaction ().commit (); pm.currentTransaction ().begin ();except that the PersistenceManager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
Transaction.commit()
,
Transaction.begin()
public void rollbackAndResume()
pm.currentTransaction ().rollback (); pm.currentTransaction ().begin ();except that the PersistenceManager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
Transaction.rollback()
,
Transaction.begin()
public void setRollbackOnly()
Transaction
.public boolean getRollbackOnly()
Transaction
.public void flush()
JDOFatalException
.public void checkConsistency()
flush()
. In an
optimistic transaction that has not yet begun a datastore-level
transaction, however, it will only report exceptions that would occur
on flush, without retaining any datastore resources.public Query newNamedQuery(Class cls, String name)
cls
- if not null, the candidate class to queryname
- the name of the query to lookupQuery
instance based on the information
defined in the metadatapublic Object getObjectById(Class cls, Object val)
cls
- the class of the matching objectval
- either an oid instance, the string version of the oid, or
the primary key valuepublic Object[] getObjectsById(Object[] oids, boolean validate)
oids
- the oids of the objects to returnvalidate
- if true, the existance of the objects in
the datastore will be validated.PersistenceManager.getObjectById(Object,boolean)
public Object newObjectIdInstance(Class cls, Object val)
cls
- the persitent class that uses this identity valueval
- an object id instance, stringified object id, or primary
key valuepublic Object getCachedObjectById(Object oid)
oid
- the object's idpublic void preFlush()
public void refreshAll(JDOException excep)
JDOException
or nested exceptions.public void evictAll(Class cls)
public void evictAll(Extent extent)
Extent
.public boolean getDetachOnClose()
public void setDetachOnClose(boolean detach)
public int getDetachFields()
DETACH_FGS
.public void setDetachFields(int mode)
DETACH_FGS
.public Object detach(Object pc)
pc
- the instance to detachdetachAll(Object[])
public Collection detachAll(Collection pcs)
pcs
- the instances to detachdetachAll(Object[])
public Object[] detachAll(Object[] pcs)
attachAll(Object[])
. The detached
instances will be unmanaged copies of the specified parameters,
and are suitable for serialization and manipulation outside
of a Kodo environment. When detaching instances, only fields
in the current FetchConfiguration
will be traversed. Thus,
to detach a graph of objects, relations to other persistent
instances must either be in the default-fetch-group
,
or in the current custom FetchConfiguration
.pcs
- the instances to detachJDOUserException
- if any of the instances do not
have the detachable
metadata extension.attachAll(Object[])
,
KodoHelper.getDetachedObjectId(java.lang.Object)
,
KodoHelper.getDetachedState(java.lang.Object)
,
getFetchConfiguration()
public Object attach(Object pc)
pc
- instance to importattachAll(Object[])
public Collection attachAll(Collection pcs)
pcs
- Collection of instances to importattachAll(Object[])
public Object[] attachAll(Object[] pcs)
pcs
- array of instances to importJDOUserException
- if any of the instances are not detachable,
or if there is not a current active transaction.JDOOptimisticVerificationException
- when attempting to
attaching instance that has been deleted in
the data store, or when attaching an instance into
a PersistenceManager that currently has cached
an earlier version of that instance.detachAll(Object[])
public void retrieve(Object pc, boolean dfgOnly)
pc
- the instance whose fields should be retrieveddfgOnly
- indicator as to whether to retrieve only fields
in the current fetch groups, or all fieldsPersistenceManager.retrieveAll(Collection,boolean)
public 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 limitpublic void lockPersistent(Object pc)
FetchConfiguration
for the persistence manager.public 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 limitpublic void lockPersistentAll(Collection pcs)
FetchConfiguration
for the persistence manager.public 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 limitpublic void lockPersistentAll(Object[] pcs)
FetchConfiguration
for the persistence manager.public boolean cancelAll()
public StoreManager getStoreManager(boolean unwrap)
KodoPersistenceManagerSPI.getStoreManager(boolean)
unwrap
- if true, the native store manager will be returned;
otherwise, the store manager used by this
persistence manager, which may be a decorator
around the native store manager, will be returnedpublic void addInstanceLifecycleListener(InstanceLifecycleListener listener, Class[] classes)
public void removeInstanceLifecycleListener(InstanceLifecycleListener listener)
public KodoStateManager getState(Object oid)
KodoPersistenceManagerSPI.getStateManager(java.lang.Object)
public KodoStateManager getStateManager(Object pc)
KodoPersistenceManagerSPI.getStateManager(java.lang.Object)
public Collection getManagedObjects()
public Collection getTransactionalObjects()
public void makeClassDirty(Class cls)
public Collection getDirtyClasses()
makeClassDirty(java.lang.Class)
.public Object putUserObject(Object key, Object val)
public Object getUserObject(Object key)
public Object removeUserObject(Object key)
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |