FileDocCategorySizeDatePackage
PersistenceManager.javaAPI DocGlassfish v2 API10930Fri May 04 22:34:58 BST 2007com.sun.jdo.spi.persistence.support.sqlstore

PersistenceManager

public interface PersistenceManager implements com.sun.jdo.api.persistence.support.PersistenceManager

Fields Summary
Constructors Summary
Methods Summary
public voidacquireCacheLock()
Lock cache for getObjectById and result processing synchronization.

public voidacquireExclusiveLock()
Acquires an exclusive lock from the persistence manager. By acquiring an exclusive lock, a thread is guaranteed to have exclusive right to the persistence runtime meaning no other threads can perform any operation in the runtime.

public voidacquireFieldUpdateLock()
Serialize field updates

public voidacquireShareLock()
Acquires a share lock from the persistence manager. This method will put the calling thread to sleep if another thread is holding the exclusive lock.

public voidafterCompletion(int status)
Called by Transaction commit() or rollback() cleans up transactional cache

param
status javax.transaction.Status

public voidbeforeCompletion()
Called by Transaction commit() Loops through transactional cache and calls PersistentStore.updatePersistent() on each instance

public voidclearFields(java.lang.Object pc)

public voidderegisterInstance(java.lang.Object oid)
Deregister an instance.

public voidderegisterInstance(java.lang.Object oid, StateManager sm)
Deregister an instance with this object Id, only if it holds the same instance.

public StateManagerfindOrCreateStateManager(java.lang.Object oid, java.lang.Class pcClass)
Returns StateManager instance for this Object Id.

param
oid the ObjectId to look up.
param
pcClass the expected Class type of the new PC instance.

public voidforceClose()
Force to close the persistence manager. Called by TransactionImpl.afterCompletion in case of the CMT transaction and the status value passed to the method cannot be resolved.

public com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrappergetCurrentWrapper()

public java.lang.ObjectgetField(java.lang.Object pc, int fieldNumber)

public bytegetFlags(java.lang.Object pc)

public RetrieveDescgetRetrieveDesc(java.lang.Class classType)
Return a RetrieveDesc given a Class object.

public RetrieveDescgetRetrieveDesc(java.lang.String fieldName, java.lang.Class classType)
Return a RetrieveDesc for a foreign field (relationship) given the Class object for the parent class.

public StateManagergetStateManager(java.lang.Object pc)

public booleaninitializeFromVersionConsistencyCache(StateManager sm)
Looks up the given instance in the Version Consistency cache and if found, populates it from the cached values.

param
sm Instance to be looked up in the version consistency cache. If found, it is populated with values from the cache.
return
true if the sm was found and populated, false otherwise.

public voidinternalFlush()
Called by Query in pessimistic transaction to flush changes to the database

public booleanisActiveTransaction()
Returns true if associated transaction is active

public booleanisNontransactionalRead()
Returns true if nontransactionalRead flag is set to true.

public booleanisOptimisticTransaction()
Returns true if associated transaction is optimistic

public java.lang.ObjectnewCollectionInstanceInternal(java.lang.Class type, java.lang.Object owner, java.lang.String fieldName, java.lang.Class elementType, boolean allowNulls, int initialSize)
Called by newCollectionInstance from the public interface or internally by the runtime Will not result in marking field as dirty

param
type Class of the new SCO instance
param
owner the owner to notify upon changes
param
fieldName the field to notify upon changes
param
elementType the element types allowed
param
allowNulls true if allowed
param
initialSize initial size of the Collection
return
the object of the class type

public java.lang.ObjectnewInstance(StateManager sm)

public java.lang.ObjectnewSCOInstanceInternal(java.lang.Class type, java.lang.Object owner, java.lang.String fieldName)
Called by newSCOInstance from the public interface or internally by the runtime Will not result in marking field as dirty Returns a new Second Class Object instance of the type specified,

param
type Class of the new SCO instance
param
owner the owner to notify upon changes
param
fieldName the field to notify upon changes
return
the object of the class type

public voidnotifyNontransactionalRead(boolean nontransactionalRead)
For Transaction to notify PersistenceManager that optimistic flag is changed

public voidnotifyOptimistic(boolean optimistic)
For Transaction to notify PersistenceManager that optimistic flag is changed

public voidnotifyStatusChange(boolean isActive)
For Transaction to notify PersistenceManager that status is changed

public voidregisterInstance(StateManager sm, java.lang.Object oid, boolean throwDuplicateException, boolean forceRegister)
Called by StateManager to register new instance. This method will throw an JDOUserException if throwDuplicateException is true and the object being registered already exists in the pm cache.

public voidregisterInstance(StateManager sm, java.lang.Object oid)
Called by StateManager to register persistent instance at the rollback if it was removed from the global (weak) cache as the result of the replace operation.

public voidreleaseCacheLock()
Release cache lock.

public voidreleaseExclusiveLock()
Release the exclusive lock and notify any thread waiting to get an exclusive or share lock. Note that every releaseShareLock() call needs to be preceeded by an acquireExclusiveLock() call.

public voidreleaseFieldUpdateLock()
Allow other threads to update fields

public voidreleaseShareLock()
Releases the share lock and notify any thread waiting to get an exclusive lock. Note that every releaseShareLock() call needs to be preceeded by an acquireShareLock() call.

public java.lang.Objectretrieve(RetrieveDesc action, ValueFetcher parameters)
Executes the given retrieve descriptor. The result is a collection unless an aggregate query was specified. In most cases the query result is a collection of persistent objects. In case of a projection on a local field the collection holds objects of that type. For aggregate queries the result is a single object, which type was defined by the caller.

param
action The retrieve descriptor.
param
parameters The input parameters for the query.
return
A collection of (persistent) objects unless an aggregate query was specified.

public java.lang.Objectretrieve(RetrieveDesc action)
Executes the given retrieve descriptor. The result is a collection unless an aggregate query was specified. In most cases the query result is a collection of persistent objects. In case of a projection on a local field the collection holds objects of that type. For aggregate queries the result is a single object, which type was defined by the caller.

param
action The retrieve descriptor.
return
A collection of (persistent) objects unless an aggregate query was specified.

public voidsetField(java.lang.Object pc, int fieldNumber, java.lang.Object value)

public voidsetFlags(java.lang.Object pc, byte flags)

public voidsetStateManager(java.lang.Object pc, StateManager sm)