<p> <b>Purpose</b>: To allow object level transactions. <p> <b>Description</b>: The unit of work is a session that implements all of the normal protocol of an EclipseLink session. It can be spawned from any other session including another unit of work. Objects can be brought into the unit of work through reading them or through registering them. The unit of work will operate on its own object space, that is the objects within the unit of work will be clones of the original objects. When the unit of work is committed, all changes to any objects registered within the unit of work will be committed to the database. A minimal commit/update will be performed and any foreign keys/circular reference/referential integrity will be resolved. If the commit to the database is successful the changed objects will be merged back into the unit of work parent session. <p> <b>Responsibilities</b>: <ul> <li> Allow parallel transactions against a session's objects. <li> Allow nested transactions. <li> Not require the application to write objects that is changes, automatically determine what has changed. <li> Perform a minimal commit/update of all changes that occurred. <li> Resolve foreign keys for newly created objects and maintain referential integrity. <li> Allow for the object transaction to use its own object space. </ul>
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| protected Map | allClones
This member variable contains a copy of all of the clones for this particular UOW |
| protected Map | batchQueries
When in transaction batch read objects must use query local to the unit of work. |
| public static final int | |
| protected Set | cascadeDeleteObjects
Set of objects that were deleted by database cascade delete constraints. |
| protected Set | |
| protected int | cloneDepth
Used during the cloning process to track the recursive depth in. This will be used to determine at which point the process can begin to wait on locks without being concerned about creating deadlock situations. |
| protected Map | cloneMapping
Map of all the clones. |
| protected transient Map | cloneToOriginals
As well as used as lookup in merge algorithm for aggregates and others |
| protected UnitOfWork. | commitOrder
Allow updates and deletes to be ordered by id or changes to avoid possible deadlocks. |
| public static final int | |
| public static final int | |
| protected Map | |
| protected UnitOfWorkImpl | containerUnitOfWork
This is only used for EJB entity beans to manage beans accessed in a transaction context. |
| public final long | |
| public final long | |
| public final String | |
| private String | |
| public static final int | |
| protected List | deferredModifyAllQueries
Contains deferred ModifyAllQuery's that have translation row for execution only. |
| protected Map | |
| protected Map | deletedPrivateOwnedObjects
Stores all of the private owned objects that have been removed and may need to cascade deletion |
| protected Map | deletionDependencies
Used to store deleted objects that have reference to other deleted objects. |
| public static final int | DO_NOT_THROW_CONFORM_EXCEPTIONS
Used for Conforming Queries |
| public static final int | |
| protected boolean | isNestedUnitOfWork
PERF: Cache isNestedUnitOfWork check. |
| protected transient MergeManager | lastUsedMergeManager
Used to store the list of locks that this UnitOfWork has acquired for this merge |
| protected int | lifecycle
With the new synchronized unit of work, need a lifecycle state variable to track birth, committed, pending_merge and death. |
| public static final String | |
| protected transient MergeManager | mergeManagerForActiveMerge
temporarily holds a reference to a merge manager that is calling this UnitOfWork during merge |
| public static final int | |
| protected List | modifyAllQueries
lazy initialization done in storeModifyAllQuery. |
| protected Map | |
| protected Map | newObjectsCloneToMergeOriginal
Stores a map from the clone to the original merged object, as a different instance is used as the original for merges. |
| protected Map | |
| protected Map | newObjectsInParent
used to store a list of the new objects in the parent |
| protected Map | |
| protected Map | |
| public static final int | |
| protected Map | |
| protected Map | optimisticReadLockObjects
Kept reference of read lock objects |
| protected transient AbstractSession | |
| public static final int | |
| protected Map | pessimisticLockedObjects
use to track pessimistic locked objects |
| protected boolean | preDeleteComplete
This attribute records when the preDelete stage of Commit has completed |
| protected Map | primaryKeyToNewObjects
Map of primary key to list of new objects. |
| protected Map | privateOwnedObjects
Cache references of private owned objects for the removal of private owned orphans |
| public static final String | ReadLockOnly
Used for read lock to determine update the version field with the same value or increment value |
| public static final String | |
| protected Set | readOnlyClasses
Read-only class can be used for reference data to avoid cloning when not required. |
| protected ReferenceMode | referenceMode
This stored the reference mode for this UOW. |
| protected Map | |
| protected boolean | resumeOnTransactionCompletion
True if UnitOfWork should be resumed on completion of transaction. |
| protected boolean | shouldCascadeCloneToJoinedRelationship
True if the value holder for the joined attribute should be triggered. |
| protected boolean | shouldDiscoverNewObjects
PERF: Allows discover new objects to be skipped if app always calls persist. |
| protected boolean | shouldNewObjectsBeCached
Allow for double merges of new objects by putting them into the cache. |
| protected boolean | shouldPerformDeletesFirst
Flag indicating that deletes should be performed before other updates. |
| protected int | shouldThrowConformExceptions
Flag indicating how to deal with exceptions on conforming queries. |
| protected boolean | shouldValidateExistence
Determine if does-exist should be performed on persist. |
| protected static boolean | SmartMerge
Used for merging dependent values without use of WL SessionAccessor |
| public static final int | |
| protected Object | transaction
PERF: Stores the JTA transaction to optimize activeUnitOfWork lookup. |
| protected UnitOfWorkChangeSet | unitOfWorkChangeSet
This method is used to store the current changeSet for this UnitOfWork. |
| protected Map | unregisteredDeletedObjectsCloneToBackupAndOriginal
Used to store objects already deleted from the db and unregistered |
| protected Map | |
| protected Map | |
| protected Map | |
| protected int | validationLevel
The amount of validation can be configured. |
| protected boolean | wasNonObjectLevelModifyQueryExecuted
True if either DataModifyQuery or ModifyAllQuery was executed. |
| protected boolean | wasTransactionBegunPrematurely
Flag indicating that the transaction for this UOW was already begun. |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | UnitOfWorkImpl(AbstractSession parent, ReferenceMode referenceMode)
INTERNAL: Create and return a new unit of work with the session as its parent. |
| Modifier and Type | Method and Description |
|---|---|
| public Session | acquireHistoricalSession(AsOfClause
Represents a valid snap shot time. clause)Overrides org. Implements org. |
| public UnitOfWorkImpl | acquireUnitOfWork()
Overrides org. Implements org. |
| protected void | |
| public void | addDeletedPrivateOwnedObjects(DatabaseMapping mapping, Object object)
INTERNAL: Records a private owned object that has been de-referenced and will need to processed for related private owned objects. |
| public void | addDeletionDependency(Object target, Object source)
INTERNAL: Record deleted objects that have reference to other deleted objects. |
| public void | addNewAggregate(Object originalObject)
INTERNAL: Register a new aggregate object with the unit of work. |
| protected void | addNewObjectToPrimaryKeyToNewObjects(Object newObject)
INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects. |
| protected void | addNewObjectToPrimaryKeyToNewObjects(Object newObject, ClassDescriptor descriptor)
INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects. |
| public void | addObjectDeletedDuringCommit(Object object, ClassDescriptor descriptor)
INTERNAL: Add object deleted during root commit of unit of work. |
| public void | |
| public void | addPrivateOwnedObject(DatabaseMapping mapping, Object privateOwnedObject)
INTERNAL: Add a privately owned object to the privateOwnedObjectsMap. |
| public void | addReadOnlyClass(Class<?> theClass)
Implements org. |
| public void | addReadOnlyClasses(Collection<E> classes)
Implements org. |
| public void | addRemovedObject(Object orignal)
INTERNAL: Register that an object was removed in a nested unit of work. |
| public void | |
| public void | |
| public void | assignSequenceNumber(Object object)
Implements org. |
| public Object | assignSequenceNumber(Object object, ClassDescriptor descriptor)
INTERNAL: Assign sequence number to the object. |
| public void | assignSequenceNumbers()
Implements org. |
| protected void | |
| protected void | |
| public void | beginEarlyTransaction()
Implements org. |
| public void | beginTransaction()
Overrides org. |
| public Object | buildOriginal(Object workingClone)
INTERNAL: Unregistered new objects have no original so we must create one for commit and resume and to put into the parent. |
| public UnitOfWorkChangeSet | calculateChanges(Map<K, V> registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)
INTERNAL: This calculates changes in two passes, first on registered objects, second it discovers unregistered new objects on only those objects that changed, and calculates their changes. |
| protected boolean | Returns: true or false depending on whether the read-only set can be changed or not.INTERNAL: Checks whether the receiver has been used. |
| public Object | checkExistence(Object object)
INTERNAL: Register the object and return the clone if it is existing otherwise return null if it is new. |
| public boolean | checkForUnregisteredExistingObject(Object object)
INTERNAL: Return if the object is an existing object (but has not been registered), or a new object (that has not be persisted). |
| public Object | checkIfAlreadyRegistered(Object object, ClassDescriptor descriptor)
INTERNAL: Return the value of the object if it already is registered, otherwise null. |
| public void | clear(boolean shouldClearCache)
INTERNAL: This method will clear all registered objects from this UnitOfWork. |
| public void | clearForClose(boolean shouldClearCache)
INTERNAL: Call this method if the uow will no longer be used for committing transactions: all the change sets will be dereferenced, and (optionally) the cache cleared. |
| private void | |
| protected Object | cloneAndRegisterNewObject(Object original, boolean isShallowClone)
ADVANCED: Register the new object with the unit of work. |
| public Object | cloneAndRegisterObject(Object original, CacheKey parentCacheKey, ClassDescriptor descriptor)
INTERNAL: Clone and register the object. |
| public Object | cloneAndRegisterObject(Object original, CacheKey parentCacheKey, CacheKey unitOfWorkCacheKey, ClassDescriptor descriptor)
INTERNAL: Clone and register the object. |
| protected Map | |
| public Map | |
| public void | commit()
Implements org. |
| protected void | commitAfterWriteChanges()
INTERNAL: Commits a UnitOfWork where the commit process has already been initiated by all call to writeChanges(). |
| public void | commitAndResume()
Implements org. |
| protected void | commitAndResumeAfterWriteChanges()
INTERNAL: Commits and resumes a UnitOfWork where the commit process has already been initiated by all call to writeChanges(). |
| public void | commitAndResumeOnFailure()
Implements org. |
| public void | commitAndResumeWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet)
INTERNAL: This method is used by the MappingWorkbench for their read-only file feature this method must not be exposed to or used by customers until it has been revised and the feature revisited to support OptimisticLocking and Serialization |
| protected boolean | commitInternallyStartedExternalTransaction()
PROTECTED: Used in commit and commit-like methods to commit internally started external transaction |
| protected void | |
| public void | |
| public void | commitRootUnitOfWorkWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet)
INTERNAL: This method is used by the MappingWorkbench read-only files feature It will commit a pre-built unitofwork change set to the database |
| protected void | commitToDatabase(boolean
false if called by writeChanges as intent is
not to finalize the transaction. commitTransaction)INTERNAL: CommitChanges To The Database from a calculated changeSet |
| protected void | commitToDatabaseWithChangeSet(boolean
false if called by writeChanges as intent is
not to finalize the transaction. commitTransaction)INTERNAL: Commit the changes to any objects to the parent. |
| protected void | commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet, boolean commitTransaction, boolean isChangeSetFromOutsideUOW)
INTERNAL: Commit pre-built changeSet to the database changeSet to the database. |
| public void | commitTransaction()
Overrides org. |
| public void | commitTransactionAfterWriteChanges()
INTERNAL: After writeChanges() everything has been done except for committing the transaction. |
| public Vector | copyReadOnlyClasses()
Overrides org. |
| private void | |
| public <T> DatabaseValueHolder | createCloneQueryValueHolder(ValueHolderInterface<T> attributeValue, Object clone, AbstractRecord row, ForeignReferenceMapping mapping)
Overrides org. |
| public <T> DatabaseValueHolder | createCloneTransformationValueHolder(ValueHolderInterface<T> attributeValue, Object original, Object clone, AbstractTransformationMapping mapping)
Overrides org. |
| protected Map | |
| protected Map | |
| public Object | Returns: the registered version for the clone being merged.Implements org. |
| public Object | Returns: the object reverted.Implements org. |
| public void | deepUnregisterObject(Object clone)
Implements org. |
| protected void | discoverAllUnregisteredNewObjects()
INTERNAL: Search for any objects in the parent that have not been registered. |
| protected void | discoverAllUnregisteredNewObjectsInParent()
INTERNAL: Search for any objects in the parent that have not been registered. |
| public void | discoverAndPersistUnregisteredNewObjects(Object object, boolean
determines if this call is cascading from a cascadePersist mapping or not. cascadePersist, Map<K, V> any new objects found must be added to this collection. newObjects, Map<K, V> unregisteredExistingObjects, Map<K, V> visitedObjects, Set<E> cascadeErrors)INTERNAL: Discover any new objects referenced from registered objects and persist them. |
| public void | discoverUnregisteredNewObjects(Map<K, V> clones, final Map<K, V> knownNewObjects, final Map<K, V> unregisteredExistingObjects, Map<K, V> visitedObjects)
INTERNAL: Traverse the object to find references to objects not registered in this unit of work. |
| public void | dontPerformValidation()
Implements org. |
| public Object | executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query)
Overrides org. |
| public void | forceUpdateToVersionField(Object lockObject, boolean shouldModifyVersionField)
Implements org. |
| public Accessor | getAccessor()
Overrides org. |
| public Collection | getAccessors()
Overrides org. |
| public Collection | getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)
Overrides org. |
| public UnitOfWork | getActiveUnitOfWork()
Overrides org. Implements org. |
| public Vector | getAllFromNewObjects(Expression selectionCriteria, Class<?> theClass, AbstractRecord translationRow, int valueHolderPolicy)
INTERNAL: Return any new objects matching the expression. |
| public Object | |
| public Object | getBackupClone(Object clone, ClassDescriptor descriptor)
INTERNAL: Return the backup clone for the working clone. |
| public Object | getBackupCloneForCommit(Object clone, ClassDescriptor descriptor)
INTERNAL: Return the backup clone for the working clone. |
| public Object | |
| public Map | getBatchQueries()
INTERNAL: When in transaction batch read objects must use query local to the unit of work. |
| public Set | getCascadeDeleteObjects()
INTERNAL: Return any objects have been deleted through database cascade delete constraints. |
| public Set | |
| public Map | |
| public Map | |
| public CommitManager | getCommitManager()
Overrides org. |
| public UnitOfWork. | getCommitOrder()
Implements org. |
| public Map | getContainerBeans()
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context. |
| public UnitOfWorkImpl | getContainerUnitOfWork()
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context. |
| public UnitOfWorkChangeSet | getCurrentChanges()
Implements org. |
| public Vector | getDefaultReadOnlyClasses()
Overrides org. |
| public Map | getDeletedObjects()
INTERNAL: The deleted objects stores any objects removed during the unit of work. |
| public Map | getDeletionDependencies()
INTERNAL: Return deleted objects that have reference to other deleted objects. |
| public Set | getDeletionDependencies(Object deletedObject)
INTERNAL: Return references to other deleted objects for this deleted object. |
| public AbstractSession | Returns: a session with a live accessormay store session name or reference class for brokers case query)Overrides org. |
| public int | |
| public MergeManager | |
| public Map | |
| public Map | getNewObjectsCloneToMergeOriginal()
INTERNAL: The stores a map from new object clones to the original object used from merge. |
| public Map | getNewObjectsCloneToOriginal()
INTERNAL: The new objects stores any objects newly created during the unit of work. |
| public Map | getNewObjectsInParentOriginalToClone()
INTERNAL: The returns the list that will hold the new objects from the Parent UnitOfWork |
| public Map | getNewObjectsOriginalToClone()
INTERNAL: The new objects stores any objects newly created during the unit of work. |
| public Object | getObjectFromNewObjects(Class<?> theClass, Object selectionKey)
INTERNAL: Return any new object matching the expression. |
| public Object | getObjectFromNewObjects(Expression selectionCriteria, Class<?> theClass, AbstractRecord translationRow, int valueHolderPolicy)
INTERNAL: Return any new object matching the expression. |
| public Map | getObjectsDeletedDuringCommit()
INTERNAL: Returns all the objects which are deleted during root commit of unit of work. |
| public Map | |
| public Object | getOriginalVersionOfNewObject(Object workingClone)
INTERNAL: Return the original version of the new object (working clone). |
| public Object | getOriginalVersionOfObject(Object workingClone)
Implements org. |
| public Object | getOriginalVersionOfObjectOrNull(Object workingClone, ObjectChangeSet changeSet, ClassDescriptor descriptor, AbstractSession targetSession)
INTERNAL: Return the original version of the object(clone) from the parent's identity map. |
| public Object | getOriginalVersionOfObjectOrNull(Object workingClone, ClassDescriptor descriptor)
INTERNAL: Return the original version of the object(clone) from the parent's identity map. |
| public AbstractSession | getParent()
Overrides org. Implements org. |
| public AbstractSession | Returns: Session with the required IdentityMaptrue when method calls itself. If the path
starting at canReturnSelf, boolean this is acceptable. Sometimes true if want to
move to the first valid session, i.e. executing on ClientSession when really
should be on ServerSession.return the last session in the chain where the Enitity is stored. terminalOnly)Overrides org. |
| public Map | |
| public Platform | getPlatform(Class<?> domainClass)
Overrides org. |
| public Map | getPrimaryKeyToNewObjects()
INTERNAL: The primaryKeyToNewObjects stores a list of objects for every primary key. |
| private Map | |
| public Object | getProperty(String name)
Overrides org. Implements org. |
| public DatabaseQuery | getQuery(String name, Vector<E> arguments)
Overrides org. |
| public DatabaseQuery | getQuery(String name)
Overrides org. Implements org. |
| public Set | getReadOnlyClasses()
Implements org. |
| public Object | getReference(Class<?> theClass, Object
The primary key of the object, either as a List, singleton, IdClass or an instance of the object. id)Implements org. |
| public ReferenceMode | |
| protected Map | getRemovedObjects()
INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work. |
| public Sequencing | getSequencing()
Overrides org. |
| public ServerPlatform | getServerPlatform()
Overrides org. Implements org. |
| public String | getSessionTypeString()
Overrides org. |
| public int | |
| public int | |
| public Object | |
| public UnitOfWorkChangeSet | getUnitOfWorkChangeSet()
Implements org. |
| public Map | Returns: MapINTERNAL: Used to lazy Initialize the unregistered existing Objects collection. |
| protected Map | getUnregisteredNewObjects()
INTERNAL: This is used to store unregistered objects discovered in the parent so that the child unit of work knows not to register them on commit. |
| protected Map | getUnregisteredNewObjectsInParent()
INTERNAL: This is used to store unregistered objects discovered in the parent so that the child unit of work knows not to register them on commit. |
| public int | getValidationLevel()
Implements org. |
| public boolean | hasCascadeDeleteObjects()
INTERNAL: Return if any objects have been deleted through database cascade delete constraints. |
| public boolean | hasChanges()
Implements org. |
| public boolean | |
| protected boolean | |
| public boolean | |
| protected boolean | |
| public boolean | hasDeletedObjects()
INTERNAL: The deleted objects stores any objects removed during the unit of work. |
| protected boolean | hasModifications()
INTERNAL: Does this unit of work have any changes or anything that requires a write to the database and a transaction to be started. |
| protected boolean | |
| public boolean | |
| protected boolean | |
| protected boolean | |
| public boolean | |
| public boolean | hasPessimisticLockedObjects()
INTERNAL: Return true if there are any pessimistic locked objects in this unit of work, false otherwise. |
| public boolean | hasPrivateOwnedObjects()
INTERNAL: Return true if privateOwnedObjects is not null and not empty, false otherwise. |
| protected boolean | |
| public boolean | |
| public void | initializeIdentityMapAccessor()
Overrides org. |
| public Object | internalExecuteQuery(DatabaseQuery query, AbstractRecord databaseRow)
Overrides org. |
| public Object | internalRegisterObject(Object object, ClassDescriptor descriptor, boolean isShallowClone)
INTERNAL: Register the object with the unit of work. |
| public boolean | isActive()
Implements org. |
| public boolean | |
| protected boolean | isAfterWriteChangesFailed()
INTERNAL: Once writeChanges has failed all a user can do really is rollback. |
| public boolean | Returns: boolean, true if the class is read-only, false otherwise.Overrides org. |
| public boolean | |
| public boolean | isCloneNewObjectFromParent(Object clone)
INTERNAL: Check if the object is already registered in a parent Unit Of Work |
| public boolean | isCommitPending()
INTERNAL: Return if the unit of work is waiting to be committed or in the process of being committed. |
| public boolean | isConsideredInvalid(Object object, CacheKey cacheKey, ClassDescriptor descriptor)
Overrides org. |
| public boolean | |
| public boolean | isInTransaction()
Overrides org. |
| public boolean | isMergePending()
INTERNAL: Return if the unit of work is waiting to be merged or in the process of being merged. |
| public boolean | isNestedUnitOfWork()
Implements org. |
| public boolean | isNewObjectInParent(Object clone)
INTERNAL: This method determines if the specified clone is new in the parent UnitOfWork |
| public boolean | |
| public boolean | isObjectNew(Object clone)
INTERNAL: This method is used to determine if the clone is a new Object in the UnitOfWork |
| public boolean | isObjectRegistered(Object clone)
Implements org. |
| public boolean | |
| public boolean | isPessimisticLocked(Object clone)
INTERNAL: Return if the clone has been pessimistic locked in this unit of work. |
| public boolean | |
| public static boolean | |
| protected void | issueModifyAllQueryList()
INTERNAL: Will notify all the deferred ModifyAllQuery's (excluding UpdateAllQuery's) and deferred UpdateAllQuery's to execute. |
| public void | |
| public void | issueSQLbeforeCompletion(boolean commitTransaction)
INTERNAL: For synchronized units of work, dump SQL to database. |
| public boolean | isUnitOfWork()
Overrides org. Implements org. |
| public boolean | isUnregisteredExistingObject(Object object)
INTERNAL: Return if the object is a known unregistered existing object. |
| public boolean | isUnregisteredNewObjectInParent(Object originalObject)
INTERNAL: Return if the object was existing but not registered in the parent of the nested unit of work. |
| private void | |
| protected void | mergeBmpAndWsEntities()
INTERNAL: BMP and Websphere CMP entities have to be merged if they are registered in the unit of work. |
| protected void | |
| public Object | Returns: the registered version for the clone being merged.Implements org. |
| public Object | mergeClone(Object rmiClone, int cascadeDepth, boolean forRefresh)
INTERNAL: Merge the attributes of the clone into the unit of work copy. |
| public void | |
| public Object | Returns: the registered version for the clone being merged.Implements org. |
| public Object | Returns: the registered version for the clone being merged.PUBLIC: Merge the attributes of the clone into the unit of work copy. |
| public Object | Returns: the registered version for the clone being merged.INTERNAL: Merge the attributes of the clone into the unit of work copy. |
| public Object | Returns: the registered version for the clone being merged.INTERNAL: Merge the attributes of the clone into the unit of work copy. |
| public Object | newInstance(Class<?> theClass)
Implements org. |
| public void | performFullValidation()
Implements org. |
| public void | performPartialValidation()
Implements org. |
| public void | performRemove(Object toBeDeleted, Map<K, V> visitedObjects)
INTERNAL: This method will perform a delete operation on the provided objects pre-determining the objects that will be deleted by a commit of the UnitOfWork including privately owned objects. |
| public void | performRemovePrivateOwnedObjectFromChangeSet(Object toBeRemoved, Map<K, V> visitedObjects)
INTERNAL: Cascade remove the private owned object from the owned UnitOfWorkChangeSet |
| protected void | populateAndRegisterObject(Object original, Object workingClone, CacheKey unitOfWorkCacheKey, CacheKey parentCacheKey, ClassDescriptor descriptor)
INTERNAL: This method is called from clone and register. |
| protected void | |
| protected void | preMergeChanges()
INTERNAL: Remove objects deleted during commit from clone and new object cache so that these are not merged |
| public void | printRegisteredObjects()
Implements org. |
| public Object | processDeleteObjectQuery(DeleteObjectQuery deleteQuery)
INTERNAL: This method is used to process delete queries that pass through the unitOfWork It is extracted out of the internalExecuteQuery method to reduce duplication |
| public Vector | Returns: is the clones of the original objects, the return value must be used for editing. Editing the original is not allowed in the unit of work.Implements org. |
| public Vector | Returns: is the clones of the original objects, the return value must be used for editing. Editing the original is not allowed in the unit of work.PUBLIC: Register the objects with the unit of work. |
| public Object | Returns: The clone of the original object, the return value must be used for editing. Editing the original is not allowed in the unit of work.Implements org. |
| public Object | Returns: The clone of the original object, the return value must be used for editing. Editing the original is not allowed in the unit of work.ADVANCED: Register the existing object with the unit of work. |
| public Object | Returns: The clone of the original object, the return value must be used for editing. Editing the original is not allowed in the unit of work.INTERNAL: Register the existing object with the unit of work. |
| public Object | registerNewContainerBean(Object newObject)
INTERNAL: Register the new container bean with the unit of work. |
| public Object | registerNewContainerBeanForCMP(Object newObject)
INTERNAL: Register the new Bean with the unit of work. |
| public Object | registerNewObject(Object newObject)
Implements org. |
| protected Object | registerNewObject(Object implementation, ClassDescriptor descriptor)
INTERNAL: Updated to allow passing in of the object's descriptor Register the new object with the unit of work. |
| protected void | registerNewObjectClone(Object clone, Object original, ClassDescriptor descriptor)
INTERNAL: Register the working copy of a new object and its original. |
| public void | registerNewObjectForPersist(Object newObject, Map<K, V> visitedObjects)
INTERNAL: Register the new object with the unit of work. |
| protected void | registerNewObjectInIdentityMap(Object clone, Object original, ClassDescriptor descriptor)
INTERNAL: Add the new object to the cache if set to. |
| protected void | registerNotRegisteredNewObjectForPersist(Object newObject, ClassDescriptor descriptor)
INTERNAL: Called only by registerNewObjectForPersist method, and only if newObject is not already registered. |
| public Object | Returns: the clone of the original object, the return value must be used for editing, ** Editing the original is not allowed in the unit of work. **Implements org. |
| protected Object | Returns: the clone of the original object, the return value must be used for editing,INTERNAL: Allows for calling method to provide the descriptor information for this object. |
| public void | registerOriginalNewObjectFromNestedUnitOfWork(Object originalObject, Object backupClone, Object newInstance, ClassDescriptor descriptor)
INTERNAL: Register a new object from a nested unit of work into its parent. |
| public void | registerWithTransactionIfRequired()
INTERNAL: Register this UnitOfWork against an external transaction controller |
| public void | release()
Overrides org. Implements org. |
| public void | releaseJTSConnection()
Overrides org. |
| public void | releaseReadConnection(Accessor connection)
Overrides org. |
| public void | |
| public void | removeAllReadOnlyClasses()
Implements org. |
| public void | removeForceUpdateToVersionField(Object lockObject)
Implements org. |
| protected void | removeObjectFromPrimaryKeyToNewObjects(Object object)
INTERNAL: Extracts the primary key and removes an object from primaryKeyToNewObjects. |
| protected void | removeObjectFromPrimaryKeyToNewObjects(Object object, Object primaryKey)
INTERNAL: Removes an object from primaryKeyToNewObjects. |
| public void | removePrivateOwnedObject(DatabaseMapping mapping, Object privateOwnedObject)
INTERNAL: Remove a privately owned object from the privateOwnedObjects Map. |
| public void | removeReadOnlyClass(Class<?> theClass)
Implements org. |
| public void | |
| public Object | retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)
Overrides org. |
| public void | revertAndResume()
Implements org. |
| public Object | Returns: the object reverted.Implements org. |
| public Object | revertObject(Object clone, int cascadeDepth)
INTERNAL: Revert the object's attributes from the parent. |
| public void | rollbackTransaction()
Overrides org. |
| protected void | rollbackTransaction(boolean
whether we were inside a commit or just trying to
write out changes early. intendedToCommitTransaction)INTERNAL: rollbackTransaction() with a twist for external transactions. |
| public Map | Returns: Map to facilitate merging with conforming instances returned from a query on the database.must be cloned and specially prepared for conforming selectionCriteria, Class<?> referenceClass, AbstractRecord arguments, ObjectLevelReadQuery query)INTERNAL: Scans the UnitOfWork identity map for conforming instances. |
| protected void | setAllClonesCollection(Map<K, V> objects)
INTERNAL: Used to set the collections of all objects in the UnitOfWork. |
| public void | setBatchQueries(Map<ReadQuery, ReadQuery> batchQueries)
INTERNAL: When in transaction batch read objects must use query local to the unit of work. |
| protected void | setCascadeDeleteObjects(Set<Object> cascadeDeleteObjects)
INTERNAL: Set any objects have been deleted through database cascade delete constraints. |
| protected void | |
| public void | setCommitOrder(UnitOfWork.
Implements org. |
| protected void | setContainerBeans(Map<K, V> containerBeans)
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context. |
| protected void | setContainerUnitOfWork(UnitOfWorkImpl containerUnitOfWork)
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context. |
| public void | |
| protected void | setDeletedObjects(Map<K, V> deletedObjects)
INTERNAL: The deleted objects stores any objects removed during the unit of work. |
| protected void | setLifecycle(int lifecycle)
INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS. |
| public void | |
| protected void | setNewObjectsCloneToOriginal(Map<K, V> newObjects)
INTERNAL: The new objects stores any objects newly created during the unit of work. |
| protected void | setNewObjectsOriginalToClone(Map<K, V> newObjects)
INTERNAL: The new objects stores any objects newly created during the unit of work. |
| public void | setObjectsDeletedDuringCommit(Map<K, V> deletedObjects)
INTERNAL: Set the objects that have been deleted. |
| public void | |
| public void | |
| public void | |
| public void | setReadOnlyClasses(List<Class<?>> classes)
INTERNAL: Gives a new set of read-only classes to the receiver. |
| protected void | setRemovedObjects(Map<K, V> removedObjects)
INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work. |
| public void | setResumeUnitOfWorkOnTransactionCompletion(boolean resumeUnitOfWork)
INTERNAL: Set if this UnitofWork should be resumed after the end of the transaction Used when UnitOfWork is synchronized with external transaction control |
| public void | setShouldCascadeCloneToJoinedRelationship(boolean shouldCascadeCloneToJoinedRelationship)
INTERNAL: True if the value holder for the joined attribute should be triggered. |
| public void | setShouldDiscoverNewObjects(boolean shouldDiscoverNewObjects)
INTERNAL: Set if this UnitofWork should discover new objects on commit. |
| public void | setShouldNewObjectsBeCached(boolean shouldNewObjectsBeCached)
Implements org. |
| public void | setShouldPerformDeletesFirst(boolean shouldPerformDeletesFirst)
Implements org. |
| public void | setShouldThrowConformExceptions(int shouldThrowExceptions)
Implements org. |
| public void | setShouldValidateExistence(boolean shouldValidateExistence)
Set the default to determine if does-exist should be performed on persist. |
| public static void | |
| public void | setSynchronized(boolean synched)
Overrides org. |
| public void | |
| public void | setUnitOfWorkChangeSet(UnitOfWorkChangeSet unitOfWorkChangeSet)
INTERNAL: Sets the current UnitOfWork change set to be the one passed in. |
| protected void | setUnregisteredExistingObjects(Map<K, V>
Map newUnregisteredExistingObjects)INTERNAL: Used to set the unregistered existing objects vector used when validation has been turned off. |
| protected void | |
| protected void | |
| protected void | setupPrimaryKeyToNewObjects()
INTERNAL: Create the map of primary key to new objects used to speed up in-memory querying. |
| public void | setValidationLevel(int validationLevel)
Implements org. |
| public void | setWasNonObjectLevelModifyQueryExecuted(boolean wasNonObjectLevelModifyQueryExecuted)
INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed. |
| public void | setWasTransactionBegunPrematurely(boolean wasTransactionBegunPrematurely)
INTERNAL: Set a flag in the root UOW to indicate that a pess. |
| public Object | Returns: the registered version for the clone being merged.Implements org. |
| public Object | Returns: the object reverted.Implements org. |
| public void | shallowUnregisterObject(Object clone)
Implements org. |
| public boolean | shouldCascadeCloneToJoinedRelationship()
INTERNAL: True if the value holder for the joined attribute should be triggered. |
| public boolean | shouldClearForCloseOnRelease()
INTERNAL: Indicates whether clearForClose method should be called by release method. |
| public boolean | |
| public boolean | shouldForceReadFromDB(ObjectBuildingQuery query, Object primaryKey)
INTERNAL: Calculate whether we should read directly from the database to the UOW. |
| public boolean | shouldNewObjectsBeCached()
Implements org. |
| public boolean | shouldPerformDeletesFirst()
Implements org. |
| public boolean | shouldPerformFullValidation()
Implements org. |
| public boolean | shouldPerformNoValidation()
Implements org. |
| public boolean | shouldPerformPartialValidation()
Implements org. |
| public boolean | shouldReadFromDB()
INTERNAL: Indicates whether readObject should return the object read from the db in case there is no object in uow cache (as opposed to fetching the object from parent's cache). |
| public boolean | shouldResumeUnitOfWorkOnTransactionCompletion()
INTERNAL: Returns true if this UnitofWork should be resumed after the end of the transaction Used when UnitOfWork is synchronized with external transaction control |
| public boolean | shouldStoreBypassCache()
INTERNAL: This is a JPA setting that is off by default in regular EclipseLink. |
| public boolean | shouldValidateExistence()
Return the default to determine if does-exist should be performed on persist. |
| public void | storeDeferredModifyAllQuery(DatabaseQuery query, AbstractRecord translationRow)
INTERNAL: Store the deferred UpdateAllQuery's from the UoW in the list for execution. |
| public void | storeModifyAllQuery(DatabaseQuery query)
INTERNAL: Store the ModifyAllQuery's from the UoW in the list. |
| public void | |
| protected void | undeleteObject(Object object)
INTERNAL: This method is used to transition an object from the deleted objects list to be simply be register. |
| public void | unregisterObject(Object clone)
Implements org. |
| public void | unregisterObject(Object clone, int cascadeDepth)
INTERNAL: Unregister the object with the unit of work. |
| public void | unregisterObject(Object clone, int cascadeDepth, boolean forDetach)
INTERNAL: Unregister the object with the unit of work. |
| public void | updateChangeTrackersIfRequired(Object objectToWrite, ObjectChangeSet changeSetToWrite, UnitOfWorkImpl uow, ClassDescriptor descriptor)
INTERNAL: This method is used internally to update the tracked objects if required |
| protected Object | updateDerivedIds(Object clone, ClassDescriptor descriptor)
INTERNAL: On persist and flush operations we must update any derived id fields. |
| public void | validateObjectSpace()
Implements org. |
| private void | |
| public boolean | Returns: true if threads were switchedINTERNAL: 272022: Avoid releasing locks on the wrong server thread. |
| public boolean | |
| public boolean | wasNonObjectLevelModifyQueryExecuted()
INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed. |
| public boolean | wasTransactionBegunPrematurely()
INTERNAL: Indicates if a transaction was begun by a pessimistic locking or non-selecting query. |
| public void | writeChanges()
Implements org. |
| public void | writesCompleted()
Overrides org. |