public interface PersistenceManager extends PersistenceManager
Modifier and Type | Method and Description |
---|---|
void |
acquireCacheLock()
Lock cache for getObjectById and result processing synchronization.
|
void |
acquireExclusiveLock()
Acquires an exclusive lock from the persistence manager.
|
void |
acquireFieldUpdateLock()
Serialize field updates
|
void |
acquireShareLock()
Acquires a share lock from the persistence manager.
|
void |
afterCompletion(int status)
Called by Transaction commit() or rollback()
cleans up transactional cache
|
void |
beforeCompletion()
Called by Transaction commit()
Loops through transactional cache and calls PersistentStore.updatePersistent()
on each instance
|
void |
clearFields(Object pc) |
void |
deregisterInstance(Object oid)
Deregister an instance.
|
void |
deregisterInstance(Object oid,
StateManager sm)
Deregister an instance with this object Id, only if it holds the same instance.
|
StateManager |
findOrCreateStateManager(Object oid,
Class pcClass)
Returns StateManager instance for this Object Id.
|
void |
forceClose()
Force to close the persistence manager.
|
PersistenceManagerWrapper |
getCurrentWrapper() |
Object |
getField(Object pc,
int fieldNumber) |
byte |
getFlags(Object pc) |
RetrieveDesc |
getRetrieveDesc(Class classType)
Return a RetrieveDesc given a Class object.
|
RetrieveDesc |
getRetrieveDesc(String fieldName,
Class classType)
Return a RetrieveDesc for a foreign field (relationship) given the
Class object for the parent class.
|
StateManager |
getStateManager(Object pc) |
boolean |
initializeFromVersionConsistencyCache(StateManager sm)
Looks up the given instance in the Version Consistency cache and
if found, populates it from the cached values.
|
void |
internalFlush()
Called by Query in pessimistic transaction
to flush changes to the database
|
boolean |
isActiveTransaction()
Returns true if associated transaction is active
|
boolean |
isNontransactionalRead()
Returns true if nontransactionalRead flag is set to true.
|
boolean |
isOptimisticTransaction()
Returns true if associated transaction is optimistic
|
Object |
newCollectionInstanceInternal(Class type,
Object owner,
String fieldName,
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
|
Object |
newInstance(StateManager sm) |
Object |
newSCOInstanceInternal(Class type,
Object owner,
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,
|
void |
notifyNontransactionalRead(boolean nontransactionalRead)
For Transaction to notify PersistenceManager that
optimistic flag is changed
|
void |
notifyOptimistic(boolean optimistic)
For Transaction to notify PersistenceManager that
optimistic flag is changed
|
void |
notifyStatusChange(boolean isActive)
For Transaction to notify PersistenceManager that
status is changed
|
void |
registerInstance(StateManager sm,
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.
|
void |
registerInstance(StateManager sm,
Object oid,
boolean throwDuplicateException,
boolean forceRegister)
Called by StateManager to register new instance.
|
void |
releaseCacheLock()
Release cache lock.
|
void |
releaseExclusiveLock()
Release the exclusive lock and notify any thread waiting to get an exclusive or
share lock.
|
void |
releaseFieldUpdateLock()
Allow other threads to update fields
|
void |
releaseShareLock()
Releases the share lock and notify any thread waiting to get an exclusive lock.
|
Object |
retrieve(RetrieveDesc action)
Executes the given retrieve descriptor.
|
Object |
retrieve(RetrieveDesc action,
ValueFetcher parameters)
Executes the given retrieve descriptor.
|
void |
setField(Object pc,
int fieldNumber,
Object value) |
void |
setFlags(Object pc,
byte flags) |
void |
setStateManager(Object pc,
StateManager sm) |
close, currentTransaction, deletePersistent, deletePersistent, deletePersistent, getExtent, getObjectById, getObjectById, getObjectId, getObjectIdClass, getPersistenceManagerFactory, getProperties, getRequireCopyObjectId, getRequireTrackedSCO, getSupersedeDeletedInstance, getTransactionalInstance, getUserObject, isClosed, makePersistent, makePersistent, makePersistent, newCollectionInstance, newQuery, newQuery, newQuery, newQuery, newQuery, newQuery, newSCOInstance, setRequireCopyObjectId, setRequireTrackedSCO, setSupersedeDeletedInstance, setUserObject
PersistenceManagerWrapper getCurrentWrapper()
Object newInstance(StateManager sm)
void setStateManager(Object pc, StateManager sm)
void setFlags(Object pc, byte flags)
byte getFlags(Object pc)
StateManager getStateManager(Object pc)
void clearFields(Object pc)
Object retrieve(RetrieveDesc action, ValueFetcher parameters)
action
- The retrieve descriptor.parameters
- The input parameters for the query.Object retrieve(RetrieveDesc action)
action
- The retrieve descriptor.RetrieveDesc getRetrieveDesc(Class classType)
RetrieveDesc getRetrieveDesc(String fieldName, Class classType)
void afterCompletion(int status)
status
- javax.transaction.Statusvoid beforeCompletion()
void internalFlush()
void registerInstance(StateManager sm, Object oid, boolean throwDuplicateException, boolean forceRegister)
void registerInstance(StateManager sm, Object oid)
void deregisterInstance(Object oid)
void deregisterInstance(Object oid, StateManager sm)
void notifyStatusChange(boolean isActive)
void notifyOptimistic(boolean optimistic)
boolean isOptimisticTransaction()
void notifyNontransactionalRead(boolean nontransactionalRead)
boolean isNontransactionalRead()
boolean isActiveTransaction()
Object newSCOInstanceInternal(Class type, Object owner, String fieldName)
type
- Class of the new SCO instanceowner
- the owner to notify upon changesfieldName
- the field to notify upon changesObject newCollectionInstanceInternal(Class type, Object owner, String fieldName, Class elementType, boolean allowNulls, int initialSize)
type
- Class of the new SCO instanceowner
- the owner to notify upon changesfieldName
- the field to notify upon changeselementType
- the element types allowedallowNulls
- true if allowedinitialSize
- initial size of the Collectionvoid acquireFieldUpdateLock()
void releaseFieldUpdateLock()
void acquireShareLock()
void releaseShareLock()
void acquireExclusiveLock()
void releaseExclusiveLock()
void forceClose()
StateManager findOrCreateStateManager(Object oid, Class pcClass)
oid
- the ObjectId to look up.pcClass
- the expected Class type of the new PC instance.void acquireCacheLock()
void releaseCacheLock()
boolean initializeFromVersionConsistencyCache(StateManager sm)
sm
- Instance to be looked up in the version consistency cache.
If found, it is populated with values from the cache.sm
was found and populated, false
otherwise.Copyright © 2019. All rights reserved.