Class UnitOfWorkImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.core.sessions.CoreAbstractSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
-
- org.eclipse.persistence.internal.sessions.AbstractSession
-
- org.eclipse.persistence.internal.sessions.UnitOfWorkImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>,CommandProcessor,Session,UnitOfWork
- Direct Known Subclasses:
RepeatableWriteUnitOfWork
public class UnitOfWorkImpl extends AbstractSession implements UnitOfWork
Implementation of org.eclipse.persistence.sessions.UnitOfWork The public interface should be used.- See Also:
Purpose: To allow object level transactions. Description: 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. Responsibilities: Allow parallel transactions against a session's objects. Allow nested transactions. Not require the application to write objects that is changes, automatically determine what has changed. Perform a minimal commit/update of all changes that occurred. Resolve foreign keys for newly created objects and maintain referential integrity. Allow for the object transaction to use its own object space., Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.persistence.sessions.UnitOfWork
UnitOfWork.CommitOrderType
-
-
Field Summary
Fields Modifier and Type Field Description static intAfterExternalTransactionRolledBackprotected java.util.Map<java.lang.Object,java.lang.Object>allClonesThis member variable contains a copy of all of the clones for this particular UOWprotected java.util.Map<ReadQuery,ReadQuery>batchQueriesWhen in transaction batch read objects must use query local to the unit of work.static intBirthprotected java.util.Set<java.lang.Object>cascadeDeleteObjectsSet of objects that were deleted by database cascade delete constraints.protected java.util.Set<java.lang.Object>changeTrackedHardListprotected intcloneDepthUsed during the cloning process to track the recursive depth in.protected java.util.Map<java.lang.Object,java.lang.Object>cloneMappingMap of all the clones.protected java.util.Map<java.lang.Object,java.lang.Object>cloneToOriginalsAs well as used as lookup in merge algorithm for aggregates and othersprotected UnitOfWork.CommitOrderTypecommitOrderAllow updates and deletes to be ordered by id or changes to avoid possible deadlocks.static intCommitPendingstatic intCommitTransactionPendingprotected java.util.Map<java.lang.Object,java.lang.Object>containerBeansprotected UnitOfWorkImplcontainerUnitOfWorkThis is only used for EJB entity beans to manage beans accessed in a transaction context.longCREATION_THREAD_HASHCODElongCREATION_THREAD_IDjava.lang.StringCREATION_THREAD_NAMEstatic intDeathprotected java.util.List<java.lang.Object[]>deferredModifyAllQueriesContains deferred ModifyAllQuery's that have translation row for execution only.protected java.util.Map<java.lang.Object,java.lang.Object>deletedObjectsprotected java.util.Map<DatabaseMapping,java.util.List<java.lang.Object>>deletedPrivateOwnedObjectsStores all of the private owned objects that have been removed and may need to cascade deletionprotected java.util.Map<java.lang.Object,java.util.Set<java.lang.Object>>deletionDependenciesUsed to store deleted objects that have reference to other deleted objects.static intDO_NOT_THROW_CONFORM_EXCEPTIONSUsed for Conforming Queriesstatic intFullprotected booleanisNestedUnitOfWorkPERF: Cache isNestedUnitOfWork check.protected MergeManagerlastUsedMergeManagerUsed to store the list of locks that this UnitOfWork has acquired for this mergeprotected intlifecycleWith the new synchronized unit of work, need a lifecycle state variable to track birth, committed, pending_merge and death.static java.lang.StringLOCK_QUERIES_PROPERTYprotected MergeManagermergeManagerForActiveMergetemporarily holds a reference to a merge manager that is calling this UnitOfWork during mergestatic intMergePendingprotected java.util.List<ModifyAllQuery>modifyAllQuerieslazy initialization done in storeModifyAllQuery.protected java.util.Map<java.lang.Object,java.lang.Object>newAggregatesprotected java.util.Map<java.lang.Object,java.lang.Object>newObjectsCloneToMergeOriginalStores a map from the clone to the original merged object, as a different instance is used as the original for merges.protected java.util.Map<java.lang.Object,java.lang.Object>newObjectsCloneToOriginalprotected java.util.Map<java.lang.Object,java.lang.Object>newObjectsInParentused to store a list of the new objects in the parentprotected java.util.Map<java.lang.Object,java.lang.Object>newObjectsInParentOriginalToCloneprotected java.util.Map<java.lang.Object,java.lang.Object>newObjectsOriginalToClonestatic intNoneprotected java.util.Map<java.lang.Object,java.lang.Object>objectsDeletedDuringCommitprotected java.util.Map<java.lang.Object,java.lang.Object>optimisticReadLockObjectsKept reference of read lock objectsprotected AbstractSessionparentstatic intPartialprotected java.util.Map<java.lang.Object,java.lang.Object>pessimisticLockedObjectsuse to track pessimistic locked objectsprotected booleanpreDeleteCompleteThis attribute records when the preDelete stage of Commit has completedprotected java.util.Map<java.lang.Object,java.util.List<java.lang.Object>>primaryKeyToNewObjectsMap of primary key to list of new objects.protected java.util.Map<DatabaseMapping,java.util.Set>privateOwnedObjectsCache references of private owned objects for the removal of private owned orphansstatic java.lang.StringReadLockOnlyUsed for read lock to determine update the version field with the same value or increment valuestatic java.lang.StringReadLockUpdateVersionprotected java.util.Set<java.lang.Class>readOnlyClassesRead-only class can be used for reference data to avoid cloning when not required.protected ReferenceModereferenceModeThis stored the reference mode for this UOW.protected java.util.Map<java.lang.Object,java.lang.Object>removedObjectsprotected booleanresumeOnTransactionCompletionTrue if UnitOfWork should be resumed on completion of transaction.protected booleanshouldCascadeCloneToJoinedRelationshipTrue if the value holder for the joined attribute should be triggered.protected booleanshouldDiscoverNewObjectsPERF: Allows discover new objects to be skipped if app always calls persist.protected booleanshouldNewObjectsBeCachedAllow for double merges of new objects by putting them into the cache.protected booleanshouldPerformDeletesFirstFlag indicating that deletes should be performed before other updates.protected intshouldThrowConformExceptionsFlag indicating how to deal with exceptions on conforming queries.protected booleanshouldValidateExistenceDetermine if does-exist should be performed on persist.protected static booleanSmartMergeUsed for merging dependent values without use of WL SessionAccessorstatic intTHROW_ALL_CONFORM_EXCEPTIONSprotected java.lang.ObjecttransactionPERF: Stores the JTA transaction to optimize activeUnitOfWork lookup.protected UnitOfWorkChangeSetunitOfWorkChangeSetThis method is used to store the current changeSet for this UnitOfWork.protected java.util.Map<java.lang.Object,java.lang.Object>unregisteredDeletedObjectsCloneToBackupAndOriginalUsed to store objects already deleted from the db and unregisteredprotected java.util.Map<java.lang.Object,java.lang.Object>unregisteredExistingObjectsprotected java.util.Map<java.lang.Object,java.lang.Object>unregisteredNewObjectsprotected java.util.Map<java.lang.Object,java.lang.Object>unregisteredNewObjectsInParentprotected intvalidationLevelThe amount of validation can be configured.protected booleanwasNonObjectLevelModifyQueryExecutedTrue if either DataModifyQuery or ModifyAllQuery was executed.protected booleanwasTransactionBegunPrematurelyFlag indicating that the transaction for this UOW was already begun.static intWriteChangesFailed-
Fields inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
accessors, activeCommandThreads, attributeGroups, broker, commandManager, commitManager, defaultReferenceMode, deferredEvents, descriptors, eventManager, exceptionHandler, externalTransactionController, identityMapAccessor, injectionManager, integrityChecker, isConcurrent, isExecutingEvents, isFinalizersEnabled, isInBroker, isInProfile, isLoggingOff, isSynchronized, jpaQueriesProcessed, lastDescriptorAccessed, logSessionString, metadatalistener, multitenantContextProperties, name, numberOfActiveUnitsOfWork, objectsLockedForClone, partitioningPolicy, pessimisticLockTimeoutDefault, pessimisticLockTimeoutUnitDefault, platform, profiler, project, properties, queries, queryBuilder, queryTimeoutDefault, queryTimeoutUnitDefault, serializer, sessionLog, shouldCheckWriteLock, shouldOptimizeResultSetAccess, shouldPropagateChanges, staticMetamodelClasses, tablePerTenantDescriptors, tablePerTenantQueries, tolerateInvalidJPQL, transactionMutex, wasJTSTransactionInternallyStarted
-
Fields inherited from interface org.eclipse.persistence.sessions.coordination.CommandProcessor
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
-
-
Constructor Summary
Constructors Constructor Description UnitOfWorkImpl()INTERNAL:UnitOfWorkImpl(AbstractSession parent, ReferenceMode referenceMode)INTERNAL: Create and return a new unit of work with the session as its parent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionacquireHistoricalSession(AsOfClause clause)INTERNAL: Acquires a special historical session for reading objects as of a past time.UnitOfWorkImplacquireUnitOfWork()PUBLIC: Return a nested unit of work for this unit of work.protected voidacquireWriteLocks()INTERNAL: Acquire the unit of work cache write locks, if required.voidaddDeletedPrivateOwnedObjects(DatabaseMapping mapping, java.lang.Object object)INTERNAL: Records a private owned object that has been de-referenced and will need to processed for related private owned objects.voidaddDeletionDependency(java.lang.Object target, java.lang.Object source)INTERNAL: Record deleted objects that have reference to other deleted objects.voidaddNewAggregate(java.lang.Object originalObject)INTERNAL: Register a new aggregate object with the unit of work.protected voidaddNewObjectToPrimaryKeyToNewObjects(java.lang.Object newObject)INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects.protected voidaddNewObjectToPrimaryKeyToNewObjects(java.lang.Object newObject, ClassDescriptor descriptor)INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects.voidaddObjectDeletedDuringCommit(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Add object deleted during root commit of unit of work.voidaddPessimisticLockedClone(java.lang.Object clone)INTERNAL:voidaddPrivateOwnedObject(DatabaseMapping mapping, java.lang.Object privateOwnedObject)INTERNAL: Add a privately owned object to the privateOwnedObjectsMap.voidaddReadOnlyClass(java.lang.Class theClass)PUBLIC: Adds the given Java class to the receiver's set of read-only classes.voidaddReadOnlyClasses(java.util.Collection classes)PUBLIC: Adds the classes in the given Vector to the existing set of read-only classes.voidaddRemovedObject(java.lang.Object orignal)INTERNAL: Register that an object was removed in a nested unit of work.voidaddToChangeTrackedHardList(java.lang.Object obj)voidafterExternalTransactionRollback()INTERNAL: Called after external transaction rolled back.voidassignSequenceNumber(java.lang.Object object)ADVANCED: Assign sequence number to the object.java.lang.ObjectassignSequenceNumber(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Assign sequence number to the object.voidassignSequenceNumbers()ADVANCED: Assign sequence numbers to all new objects registered in this unit of work, or any new objects reference by any objects registered.protected voidassignSequenceNumbers(java.util.Map objects)INTERNAL: Assign sequence numbers to all of the objects.protected voidbasicPrintRegisteredObjects()INTERNAL: Print the objects in the unit of work.voidbeginEarlyTransaction()PUBLIC: Tell the unit of work to begin a transaction now.voidbeginTransaction()INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow.java.lang.ObjectbuildOriginal(java.lang.Object workingClone)INTERNAL: Unregistered new objects have no original so we must create one for commit and resume and to put into the parent.UnitOfWorkChangeSetcalculateChanges(java.util.Map registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)INTERNAL:protected booleancanChangeReadOnlySet()INTERNAL: Checks whether the receiver has been used.java.lang.ObjectcheckExistence(java.lang.Object object)INTERNAL: Register the object and return the clone if it is existing otherwise return null if it is new.booleancheckForUnregisteredExistingObject(java.lang.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).java.lang.ObjectcheckIfAlreadyRegistered(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Return the value of the object if it already is registered, otherwise null.voidclear(boolean shouldClearCache)INTERNAL: This method will clear all registered objects from this UnitOfWork.voidclearForClose(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.protected java.lang.ObjectcloneAndRegisterNewObject(java.lang.Object original, boolean isShallowClone)ADVANCED: Register the new object with the unit of work.java.lang.ObjectcloneAndRegisterObject(java.lang.Object original, CacheKey parentCacheKey, ClassDescriptor descriptor)INTERNAL: Clone and register the object.java.lang.ObjectcloneAndRegisterObject(java.lang.Object original, CacheKey parentCacheKey, CacheKey unitOfWorkCacheKey, ClassDescriptor descriptor)INTERNAL: Clone and register the object.protected java.util.MapcloneMap(java.util.Map map)This method is used internally to clone a map that holds the persistenceContexts.java.util.MapcollectAndPrepareObjectsForNestedMerge()INTERNAL: Prepare for merge in nested uow.voidcommit()PUBLIC: Commit the unit of work to its parent.protected voidcommitAfterWriteChanges()INTERNAL: Commits a UnitOfWork where the commit process has already been initiated by all call to writeChanges().voidcommitAndResume()PUBLIC: Commit the unit of work to its parent.protected voidcommitAndResumeAfterWriteChanges()INTERNAL: Commits and resumes a UnitOfWork where the commit process has already been initiated by all call to writeChanges().voidcommitAndResumeOnFailure()PUBLIC: Commit the unit of work to its parent.voidcommitAndResumeWithPreBuiltChangeSet(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 Serializationprotected booleancommitInternallyStartedExternalTransaction()PROTECTED: Used in commit and commit-like methods to commit internally started external transactionprotected voidcommitNestedUnitOfWork()INTERNAL: Commit the changes to any objects to the parent.voidcommitRootUnitOfWork()INTERNAL: Commit the changes to any objects to the parent.voidcommitRootUnitOfWorkWithPreBuiltChangeSet(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 databaseprotected voidcommitToDatabase(boolean commitTransaction)INTERNAL: CommitChanges To The Database from a calculated changeSetprotected voidcommitToDatabaseWithChangeSet(boolean commitTransaction)INTERNAL: Commit the changes to any objects to the parent.protected voidcommitToDatabaseWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet, boolean commitTransaction, boolean isChangeSetFromOutsideUOW)INTERNAL: Commit pre-built changeSet to the database changeSet to the database.voidcommitTransaction()INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow.voidcommitTransactionAfterWriteChanges()INTERNAL: After writeChanges() everything has been done except for committing the transaction.java.util.VectorcopyReadOnlyClasses()INTERNAL: Copy the read only classes from the unit of work.DatabaseValueHoldercreateCloneQueryValueHolder(ValueHolderInterface attributeValue, java.lang.Object clone, AbstractRecord row, ForeignReferenceMapping mapping)DatabaseValueHoldercreateCloneTransformationValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, AbstractTransformationMapping mapping)protected java.util.MapcreateMap()This method is used internally to create a map to hold the persistenceContexts.protected java.util.MapcreateMap(int size)This method is used internally to create a map to hold the persistenceContexts.java.lang.ObjectdeepMergeClone(java.lang.Object rmiClone)PUBLIC: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectdeepRevertObject(java.lang.Object clone)PUBLIC: Revert the object's attributes from the parent.voiddeepUnregisterObject(java.lang.Object clone)ADVANCED: Unregister the object with the unit of work.protected voiddiscoverAllUnregisteredNewObjects()INTERNAL: Search for any objects in the parent that have not been registered.protected voiddiscoverAllUnregisteredNewObjectsInParent()INTERNAL: Search for any objects in the parent that have not been registered.voiddiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, boolean cascadePersist, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, java.util.Set cascadeErrors)INTERNAL: Discover any new objects referenced from registered objects and persist them.voiddiscoverUnregisteredNewObjects(java.util.Map clones, java.util.Map knownNewObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects)INTERNAL: Traverse the object to find references to objects not registered in this unit of work.voiddontPerformValidation()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache.java.lang.ObjectexecuteCall(Call call, AbstractRecord translationRow, DatabaseQuery query)INTERNAL: Override From session.voidforceUpdateToVersionField(java.lang.Object lockObject, boolean shouldModifyVersionField)ADVANCED: Set optimistic read lock on the object.AccessorgetAccessor()INTERNAL: The uow does not store a local accessor but shares its parents.java.util.Collection<Accessor>getAccessors()INTERNAL: The uow does not store a local accessor but shares its parents.java.util.Collection<Accessor>getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)INTERNAL: Return the connections to use for the query execution.UnitOfWorkgetActiveUnitOfWork()PUBLIC: Return the active unit of work for the current active external (JTS) transaction.java.util.VectorgetAllFromNewObjects(Expression selectionCriteria, java.lang.Class theClass, AbstractRecord translationRow, int valueHolderPolicy)INTERNAL: Return any new objects matching the expression.java.lang.ObjectgetBackupClone(java.lang.Object clone)INTERNAL: Return the backup clone for the working clone.java.lang.ObjectgetBackupClone(java.lang.Object clone, ClassDescriptor descriptor)INTERNAL: Return the backup clone for the working clone.java.lang.ObjectgetBackupCloneForCommit(java.lang.Object clone)INTERNAL: Return the backup clone for the working clone.java.lang.ObjectgetBackupCloneForCommit(java.lang.Object clone, ClassDescriptor descriptor)INTERNAL: Return the backup clone for the working clone.java.util.Map<ReadQuery,ReadQuery>getBatchQueries()INTERNAL: When in transaction batch read objects must use query local to the unit of work.java.util.Set<java.lang.Object>getCascadeDeleteObjects()INTERNAL: Return any objects have been deleted through database cascade delete constraints.java.util.Set<java.lang.Object>getChangeTrackedHardList()INTERNAL: Return the list of object with changes.java.util.MapgetCloneMapping()INTERNAL: Return the clone mapping.java.util.MapgetCloneToOriginals()INTERNAL: Map used to avoid garbage collection in weak caches.CommitManagergetCommitManager()INTERNAL: The commit manager is used to resolve referential integrity on commits of multiple objects.UnitOfWork.CommitOrderTypegetCommitOrder()ADVANCED: Return the commit order.java.util.MapgetContainerBeans()INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.UnitOfWorkImplgetContainerUnitOfWork()INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.UnitOfWorkChangeSetgetCurrentChanges()ADVANCED: This method Will Calculate the changes for the UnitOfWork.java.util.VectorgetDefaultReadOnlyClasses()INTERNAL: Returns the set of read-only classes that gets assigned to each newly created UnitOfWork.java.util.MapgetDeletedObjects()INTERNAL: The deleted objects stores any objects removed during the unit of work.java.util.Map<java.lang.Object,java.util.Set<java.lang.Object>>getDeletionDependencies()INTERNAL: Return deleted objects that have reference to other deleted objects.java.util.Set<java.lang.Object>getDeletionDependencies(java.lang.Object deletedObject)INTERNAL: Return references to other deleted objects for this deleted object.AbstractSessiongetExecutionSession(DatabaseQuery query)INTERNAL: Gets the session which this query will be executed on.intgetLifecycle()INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS.MergeManagergetMergeManager()A reference to the last used merge manager.java.util.MapgetNewAggregates()INTERNAL: The map stores any new aggregates that have been cloned.java.util.MapgetNewObjectsCloneToMergeOriginal()INTERNAL: The stores a map from new object clones to the original object used from merge.java.util.MapgetNewObjectsCloneToOriginal()INTERNAL: The new objects stores any objects newly created during the unit of work.java.util.MapgetNewObjectsInParentOriginalToClone()INTERNAL: The returns the list that will hold the new objects from the Parent UnitOfWorkjava.util.MapgetNewObjectsOriginalToClone()INTERNAL: The new objects stores any objects newly created during the unit of work.java.lang.ObjectgetObjectFromNewObjects(java.lang.Class theClass, java.lang.Object selectionKey)INTERNAL: Return any new object matching the expression.java.lang.ObjectgetObjectFromNewObjects(Expression selectionCriteria, java.lang.Class theClass, AbstractRecord translationRow, int valueHolderPolicy)INTERNAL: Return any new object matching the expression.java.util.MapgetObjectsDeletedDuringCommit()INTERNAL: Returns all the objects which are deleted during root commit of unit of work.java.util.MapgetOptimisticReadLockObjects()INTERNAL: Return optimistic read lock objectsjava.lang.ObjectgetOriginalVersionOfNewObject(java.lang.Object workingClone)INTERNAL: Return the original version of the new object (working clone).java.lang.ObjectgetOriginalVersionOfObject(java.lang.Object workingClone)ADVANCED: Return the original version of the object(clone) from the parent's identity map.java.lang.ObjectgetOriginalVersionOfObjectOrNull(java.lang.Object workingClone, ClassDescriptor descriptor)INTERNAL: Return the original version of the object(clone) from the parent's identity map.java.lang.ObjectgetOriginalVersionOfObjectOrNull(java.lang.Object workingClone, ObjectChangeSet changeSet, ClassDescriptor descriptor, AbstractSession targetSession)INTERNAL: Return the original version of the object(clone) from the parent's identity map.AbstractSessiongetParent()PUBLIC: Return the parent.AbstractSessiongetParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)INTERNAL: Returns the appropriate IdentityMap session for this descriptor.java.util.MapgetPessimisticLockedObjects()INTERNAL:PlatformgetPlatform(java.lang.Class domainClass)INTERNAL: Return the platform for a particular class.java.util.Map<java.lang.Object,java.util.List<java.lang.Object>>getPrimaryKeyToNewObjects()INTERNAL: The primaryKeyToNewObjects stores a list of objects for every primary key.java.lang.ObjectgetProperty(java.lang.String name)INTERNAL: Search for and return the user defined property from this UOW, if it not found then search for the property from parent.DatabaseQuerygetQuery(java.lang.String name)PUBLIC: Return the query from the session pre-defined queries with the given name.DatabaseQuerygetQuery(java.lang.String name, java.util.Vector arguments)PUBLIC: Return the query from the session pre-defined queries with the given name.java.util.SetgetReadOnlyClasses()ADVANCED: Returns the set of read-only classes in this UnitOfWork.java.lang.ObjectgetReference(java.lang.Class theClass, java.lang.Object id)Get an instance, whose state may be lazily fetched.ReferenceModegetReferenceMode()protected java.util.MapgetRemovedObjects()INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work.SequencinggetSequencing()INTERNAL: Return the Sequencing object used by the session.ServerPlatformgetServerPlatform()INTERNAL: Marked internal as this is not customer API but helper methods for accessing the server platform from within EclipseLink's other sessions types (i.e.java.lang.StringgetSessionTypeString()INTERNAL: Returns the type of session, its class.intgetShouldThrowConformExceptions()INTERNAL: Return whether to throw exceptions on conforming queriesintgetState()INTERNAL: Find out what the lifecycle state of this UoW is in.java.lang.ObjectgetTransaction()INTERNAL: PERF: Return the associated external transaction.UnitOfWorkChangeSetgetUnitOfWorkChangeSet()ADVANCED: Returns the currentChangeSet from the UnitOfWork.java.util.MapgetUnregisteredExistingObjects()INTERNAL: Used to lazy Initialize the unregistered existing Objects collection.protected java.util.MapgetUnregisteredNewObjects()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 java.util.MapgetUnregisteredNewObjectsInParent()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.intgetValidationLevel()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache.booleanhasCascadeDeleteObjects()INTERNAL: Return if any objects have been deleted through database cascade delete constraints.booleanhasChanges()ADVANCED: The Unit of work is capable of preprocessing to determine if any on the clone have been changed.booleanhasCloneMapping()INTERNAL: Return if the unit of work has any clones.protected booleanhasCloneToOriginals()booleanhasContainerBeans()INTERNAL: Return if any container beans exist.protected booleanhasDeferredModifyAllQueries()booleanhasDeletedObjects()INTERNAL: The deleted objects stores any objects removed during the unit of work.protected booleanhasModifications()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 booleanhasModifyAllQueries()booleanhasNewObjects()INTERNAL: Return if there are any registered new objects.protected booleanhasNewObjectsInParentOriginalToClone()protected booleanhasObjectsDeletedDuringCommit()booleanhasOptimisticReadLockObjects()INTERNAL: Return if there are any optimistic read locks.booleanhasPessimisticLockedObjects()INTERNAL: Return true if there are any pessimistic locked objects in this unit of work, false otherwise.booleanhasPrivateOwnedObjects()INTERNAL: Return true if privateOwnedObjects is not null and not empty, false otherwise.protected booleanhasRemovedObjects()booleanhasUnregisteredNewObjects()INTERNAL: Return if there are any unregistered new objects.voidinitializeIdentityMapAccessor()INTERNAL: Set up the IdentityMapManager.java.lang.ObjectinternalExecuteQuery(DatabaseQuery query, AbstractRecord databaseRow)INTERNAL: Return the results from executing the database query.java.lang.ObjectinternalRegisterObject(java.lang.Object object, ClassDescriptor descriptor, boolean isShallowClone)INTERNAL: Register the object with the unit of work.booleanisActive()PUBLIC: Return if the unit of work is active.booleanisAfterWriteChangesButBeforeCommit()INTERNAL: Has writeChanges() been attempted on this UnitOfWork? It may have either succeeded or failed but either way the UnitOfWork is in a highly restricted state.protected booleanisAfterWriteChangesFailed()INTERNAL: Once writeChanges has failed all a user can do really is rollback.booleanisClassReadOnly(java.lang.Class theClass, ClassDescriptor descriptor)INTERNAL: Checks to see if the specified class or descriptor is read-only or not in this UnitOfWork.booleanisCloneNewObject(java.lang.Object clone)INTERNAL: Check if the object is already registered.booleanisCloneNewObjectFromParent(java.lang.Object clone)INTERNAL: Check if the object is already registered in a parent Unit Of WorkbooleanisCommitPending()INTERNAL: Return if the unit of work is waiting to be committed or in the process of being committed.booleanisConsideredInvalid(java.lang.Object object, CacheKey cacheKey, ClassDescriptor descriptor)INTERNAL: Check if the object is invalid and *should* be refreshed.booleanisDead()INTERNAL: Return if the unit of work is dead.booleanisInTransaction()PUBLIC: Return whether the session currently has a database transaction in progress.booleanisMergePending()INTERNAL: Return if the unit of work is waiting to be merged or in the process of being merged.booleanisNestedUnitOfWork()PUBLIC: Return whether this session is a nested unit of work or not.booleanisNewObjectInParent(java.lang.Object clone)INTERNAL: This method determines if the specified clone is new in the parent UnitOfWorkbooleanisObjectDeleted(java.lang.Object object)INTERNAL: Return if the object has been deleted in this unit of work.booleanisObjectNew(java.lang.Object clone)INTERNAL: This method is used to determine if the clone is a new Object in the UnitOfWorkbooleanisObjectRegistered(java.lang.Object clone)ADVANCED: Return whether the clone object is already registered.booleanisOriginalNewObject(java.lang.Object original)INTERNAL: Return whether the original object is new.booleanisPessimisticLocked(java.lang.Object clone)INTERNAL: Return if the clone has been pessimistic locked in this unit of work.booleanisPreDeleteComplete()static booleanisSmartMerge()INTERNAL: Return the status of smart mergeprotected voidissueModifyAllQueryList()INTERNAL: Will notify all the deferred ModifyAllQuery's (excluding UpdateAllQuery's) and deferred UpdateAllQuery's to execute.voidissueSQLbeforeCompletion()INTERNAL: For synchronized units of work, dump SQL to database.voidissueSQLbeforeCompletion(boolean commitTransaction)INTERNAL: For synchronized units of work, dump SQL to database.booleanisUnitOfWork()PUBLIC: Return if this session is a unit of work.booleanisUnregisteredExistingObject(java.lang.Object object)INTERNAL: Return if the object is a known unregistered existing object.booleanisUnregisteredNewObjectInParent(java.lang.Object originalObject)INTERNAL: Return if the object was existing but not registered in the parent of the nested unit of work.protected voidmergeBmpAndWsEntities()INTERNAL: BMP and Websphere CMP entities have to be merged if they are registered in the unit of work.protected voidmergeChangesIntoParent()INTERNAL: Merge the changes to all objects to the parent.java.lang.ObjectmergeClone(java.lang.Object rmiClone)PUBLIC: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectmergeClone(java.lang.Object rmiClone, int cascadeDepth, boolean forRefresh)INTERNAL: Merge the attributes of the clone into the unit of work copy.voidmergeClonesAfterCompletion()INTERNAL: for synchronized units of work, merge changes into parentjava.lang.ObjectmergeCloneWithReferences(java.lang.Object rmiClone)PUBLIC: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectmergeCloneWithReferences(java.lang.Object rmiClone, int cascadePolicy)PUBLIC: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectmergeCloneWithReferences(java.lang.Object rmiClone, int cascadePolicy, boolean forceCascade)INTERNAL: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectmergeCloneWithReferences(java.lang.Object rmiClone, MergeManager manager)INTERNAL: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectnewInstance(java.lang.Class theClass)PUBLIC: Return a new instance of the class registered in this unit of work.voidperformFullValidation()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache.voidperformPartialValidation()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache.voidperformRemove(java.lang.Object toBeDeleted, java.util.Map 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.voidperformRemovePrivateOwnedObjectFromChangeSet(java.lang.Object toBeRemoved, java.util.Map visitedObjects)INTERNAL: Cascade remove the private owned object from the owned UnitOfWorkChangeSetprotected voidpopulateAndRegisterObject(java.lang.Object original, java.lang.Object workingClone, CacheKey unitOfWorkCacheKey, CacheKey parentCacheKey, ClassDescriptor descriptor)INTERNAL: This method is called from clone and register.protected voidpostMergeChanges(java.util.Set classesChanged)INTERNAL: Remove objects from parent's identity map.protected voidpreMergeChanges()INTERNAL: Remove objects deleted during commit from clone and new object cache so that these are not mergedvoidprintRegisteredObjects()PUBLIC: Print the objects in the unit of work.java.lang.ObjectprocessDeleteObjectQuery(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 duplicationjava.util.VectorregisterAllObjects(java.util.Collection domainObjects)PUBLIC: Register the objects with the unit of work.java.util.VectorregisterAllObjects(java.util.Vector domainObjects)PUBLIC: Register the objects with the unit of work.java.lang.ObjectregisterExistingObject(java.lang.Object existingObject)ADVANCED: Register the existing object with the unit of work.java.lang.ObjectregisterExistingObject(java.lang.Object existingObject, boolean isFromSharedCache)ADVANCED: Register the existing object with the unit of work.java.lang.ObjectregisterExistingObject(java.lang.Object objectToRegister, ClassDescriptor descriptor, java.lang.Object queryPrimaryKey, boolean isFromSharedCache)INTERNAL: Register the existing object with the unit of work.java.lang.ObjectregisterNewContainerBean(java.lang.Object newObject)INTERNAL: Register the new container bean with the unit of work.java.lang.ObjectregisterNewContainerBeanForCMP(java.lang.Object newObject)INTERNAL: Register the new Bean with the unit of work.java.lang.ObjectregisterNewObject(java.lang.Object newObject)ADVANCED: Register the new object with the unit of work.protected java.lang.ObjectregisterNewObject(java.lang.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 voidregisterNewObjectClone(java.lang.Object clone, java.lang.Object original, ClassDescriptor descriptor)INTERNAL: Register the working copy of a new object and its original.voidregisterNewObjectForPersist(java.lang.Object newObject, java.util.Map visitedObjects)INTERNAL: Register the new object with the unit of work.protected voidregisterNewObjectInIdentityMap(java.lang.Object clone, java.lang.Object original, ClassDescriptor descriptor)INTERNAL: Add the new object to the cache if set to.protected voidregisterNotRegisteredNewObjectForPersist(java.lang.Object newObject, ClassDescriptor descriptor)INTERNAL: Called only by registerNewObjectForPersist method, and only if newObject is not already registered.java.lang.ObjectregisterObject(java.lang.Object object)PUBLIC: Register the object with the unit of work.protected java.lang.ObjectregisterObject(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Allows for calling method to provide the descriptor information for this object.voidregisterOriginalNewObjectFromNestedUnitOfWork(java.lang.Object originalObject, java.lang.Object backupClone, java.lang.Object newInstance, ClassDescriptor descriptor)INTERNAL: Register a new object from a nested unit of work into its parent.voidregisterWithTransactionIfRequired()INTERNAL: Register this UnitOfWork against an external transaction controllervoidrelease()PUBLIC: Release the unit of work.voidreleaseJTSConnection()INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener.voidreleaseReadConnection(Accessor connection)INTERNAL: Release the read connection to the read connection pool.voidreleaseWriteLocks()INTERNAL: Release the unit of work cache write locks, if acquired.voidremoveAllReadOnlyClasses()PUBLIC: Empties the set of read-only classes.voidremoveForceUpdateToVersionField(java.lang.Object lockObject)ADVANCED: Remove optimistic read lock from the object See forceUpdateToVersionField(Object)protected voidremoveObjectFromPrimaryKeyToNewObjects(java.lang.Object object)INTERNAL: Extracts the primary key and removes an object from primaryKeyToNewObjects.protected voidremoveObjectFromPrimaryKeyToNewObjects(java.lang.Object object, java.lang.Object primaryKey)INTERNAL: Removes an object from primaryKeyToNewObjects.voidremovePrivateOwnedObject(DatabaseMapping mapping, java.lang.Object privateOwnedObject)INTERNAL: Remove a privately owned object from the privateOwnedObjects Map.voidremoveReadOnlyClass(java.lang.Class theClass)PUBLIC: Removes a Class from the receiver's set of read-only classes.voidresumeUnitOfWork()INTERNAL: Resume the unit of work state after a flush, or resume operation.java.lang.ObjectretryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)INTERNAL: A query execution failed due to an invalid query.voidrevertAndResume()PUBLIC: Revert all changes made to any registered object.java.lang.ObjectrevertObject(java.lang.Object clone)PUBLIC: Revert the object's attributes from the parent.java.lang.ObjectrevertObject(java.lang.Object clone, int cascadeDepth)INTERNAL: Revert the object's attributes from the parent.voidrollbackTransaction()INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow.protected voidrollbackTransaction(boolean intendedToCommitTransaction)INTERNAL: rollbackTransaction() with a twist for external transactions.java.util.Map<java.lang.Object,java.lang.Object>scanForConformingInstances(Expression selectionCriteria, java.lang.Class referenceClass, AbstractRecord arguments, ObjectLevelReadQuery query)INTERNAL: Scans the UnitOfWork identity map for conforming instances.protected voidsetAllClonesCollection(java.util.Map objects)INTERNAL: Used to set the collections of all objects in the UnitOfWork.voidsetBatchQueries(java.util.Map<ReadQuery,ReadQuery> batchQueries)INTERNAL: When in transaction batch read objects must use query local to the unit of work.protected voidsetCascadeDeleteObjects(java.util.Set<java.lang.Object> cascadeDeleteObjects)INTERNAL: Set any objects have been deleted through database cascade delete constraints.protected voidsetCloneMapping(java.util.Map cloneMapping)INTERNAL: Set the clone mapping.voidsetCommitOrder(UnitOfWork.CommitOrderType order)ADVANCED: Set the commit order.protected voidsetContainerBeans(java.util.Map containerBeans)INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.protected voidsetContainerUnitOfWork(UnitOfWorkImpl containerUnitOfWork)INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.voidsetDead()INTERNAL: set UoW lifecycle state variable to DEATHprotected voidsetDeletedObjects(java.util.Map deletedObjects)INTERNAL: The deleted objects stores any objects removed during the unit of work.protected voidsetLifecycle(int lifecycle)INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS.voidsetMergeManager(MergeManager mergeManager)INTERNAL: A reference to the last used merge manager.protected voidsetNewObjectsCloneToOriginal(java.util.Map newObjects)INTERNAL: The new objects stores any objects newly created during the unit of work.protected voidsetNewObjectsOriginalToClone(java.util.Map newObjects)INTERNAL: The new objects stores any objects newly created during the unit of work.voidsetObjectsDeletedDuringCommit(java.util.Map deletedObjects)INTERNAL: Set the objects that have been deleted.voidsetParent(AbstractSession parent)INTERNAL: Set the parent.voidsetPendingMerge()INTERNAL: set UoW lifecycle state variable to PENDING_MERGEvoidsetPreDeleteComplete(boolean preDeleteComplete)voidsetReadOnlyClasses(java.util.List<java.lang.Class> classes)INTERNAL: Gives a new set of read-only classes to the receiver.protected voidsetRemovedObjects(java.util.Map removedObjects)INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work.voidsetResumeUnitOfWorkOnTransactionCompletion(boolean resumeUnitOfWork)INTERNAL: Set if this UnitofWork should be resumed after the end of the transaction Used when UnitOfWork is synchronized with external transaction controlvoidsetShouldCascadeCloneToJoinedRelationship(boolean shouldCascadeCloneToJoinedRelationship)INTERNAL: True if the value holder for the joined attribute should be triggered.voidsetShouldDiscoverNewObjects(boolean shouldDiscoverNewObjects)INTERNAL: Set if this UnitofWork should discover new objects on commit.voidsetShouldNewObjectsBeCached(boolean shouldNewObjectsBeCached)ADVANCED: By default new objects are not cached until the exist on the database.voidsetShouldOrderUpdates(boolean shouldOrderUpdates)ADVANCED: Set updates should be ordered by primary key to avoid possible database deadlocks.voidsetShouldPerformDeletesFirst(boolean shouldPerformDeletesFirst)ADVANCED: By default deletes are performed last in a unit of work.voidsetShouldThrowConformExceptions(int shouldThrowExceptions)ADVANCED: Conforming queries can be set to provide different levels of detail about the exceptions they encounter There are two levels: DO_NOT_THROW_CONFORM_EXCEPTIONS = 0; THROW_ALL_CONFORM_EXCEPTIONS = 1;voidsetShouldValidateExistence(boolean shouldValidateExistence)Set the default to determine if does-exist should be performed on persist.static voidsetSmartMerge(boolean option)INTERNAL: Set smart merge flag.voidsetSynchronized(boolean synched)INTERNAL: Set isSynchronized flag to indicate that this session is a synchronized unit of work.voidsetTransaction(java.lang.Object transaction)INTERNAL: PERF: Set the associated external transaction.voidsetUnitOfWorkChangeSet(UnitOfWorkChangeSet unitOfWorkChangeSet)INTERNAL: Sets the current UnitOfWork change set to be the one passed in.protected voidsetUnregisteredExistingObjects(java.util.Map newUnregisteredExistingObjects)INTERNAL: Used to set the unregistered existing objects vector used when validation has been turned off.protected voidsetUnregisteredNewObjects(java.util.Map newObjects)INTERNAL:protected voidsetUnregisteredNewObjectsInParent(java.util.Map newObjects)INTERNAL:protected voidsetupPrimaryKeyToNewObjects()INTERNAL: Create the map of primary key to new objects to speed up in-memory querying.voidsetValidationLevel(int validationLevel)ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache.voidsetWasNonObjectLevelModifyQueryExecuted(boolean wasNonObjectLevelModifyQueryExecuted)INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed.voidsetWasTransactionBegunPrematurely(boolean wasTransactionBegunPrematurely)INTERNAL: Set a flag in the root UOW to indicate that a pess.java.lang.ObjectshallowMergeClone(java.lang.Object rmiClone)PUBLIC: Merge the attributes of the clone into the unit of work copy.java.lang.ObjectshallowRevertObject(java.lang.Object clone)PUBLIC: Revert the object's attributes from the parent.voidshallowUnregisterObject(java.lang.Object clone)ADVANCED: Unregister the object with the unit of work.booleanshouldCascadeCloneToJoinedRelationship()INTERNAL: True if the value holder for the joined attribute should be triggered.booleanshouldClearForCloseOnRelease()INTERNAL: Indicates whether clearForClose method should be called by release method.booleanshouldDiscoverNewObjects()INTERNAL: Set if this UnitofWork should discover new objects on commit.booleanshouldForceReadFromDB(ObjectBuildingQuery query, java.lang.Object primaryKey)INTERNAL: Calculate whether we should read directly from the database to the UOW.booleanshouldNewObjectsBeCached()ADVANCED: By default new objects are not cached until the exist on the database.booleanshouldOrderUpdates()ADVANCED: Return if updates should be ordered by primary key to avoid possible database deadlocks.booleanshouldPerformDeletesFirst()ADVANCED: By default all objects are inserted and updated in the database before any object is deleted.booleanshouldPerformFullValidation()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not refered in the unit of work cache.booleanshouldPerformNoValidation()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not refered in the unit of work cache.booleanshouldPerformPartialValidation()ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not refered after commit, ensures that objects from the parent cache are not refered in the unit of work cache.booleanshouldReadFromDB()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).booleanshouldResumeUnitOfWorkOnTransactionCompletion()INTERNAL: Returns true if this UnitofWork should be resumed after the end of the transaction Used when UnitOfWork is synchronized with external transaction controlbooleanshouldStoreBypassCache()INTERNAL: This is a JPA setting that is off by default in regular EclipseLink.booleanshouldValidateExistence()Return the default to determine if does-exist should be performed on persist.voidstoreDeferredModifyAllQuery(DatabaseQuery query, AbstractRecord translationRow)INTERNAL: Store the deferred UpdateAllQuery's from the UoW in the list for execution.voidstoreModifyAllQuery(DatabaseQuery query)INTERNAL: Store the ModifyAllQuery's from the UoW in the list.voidsynchronizeAndResume()INTERNAL Synchronize the clones and update their backup copies.protected voidundeleteObject(java.lang.Object object)INTERNAL: This method is used to transition an object from the deleted objects list to be simply be register.voidunregisterObject(java.lang.Object clone)PUBLIC: Unregister the object with the unit of work.voidunregisterObject(java.lang.Object clone, int cascadeDepth)INTERNAL: Unregister the object with the unit of work.voidunregisterObject(java.lang.Object clone, int cascadeDepth, boolean forDetach)INTERNAL: Unregister the object with the unit of work.voidupdateChangeTrackersIfRequired(java.lang.Object objectToWrite, ObjectChangeSet changeSetToWrite, UnitOfWorkImpl uow, ClassDescriptor descriptor)INTERNAL: This method is used internally to update the tracked objects if requiredprotected java.lang.ObjectupdateDerivedIds(java.lang.Object clone, ClassDescriptor descriptor)INTERNAL: On persist and flush operations we must update any derived id fields.voidvalidateObjectSpace()ADVANCED: This can be used to help debugging an object-space corruption.booleanverifyMutexThreadIntegrityBeforeRelease()INTERNAL: 272022: Avoid releasing locks on the wrong server thread.booleanwasDeleted(java.lang.Object original)INTERNAL: Return if the object was deleted previously (in a flush).booleanwasNonObjectLevelModifyQueryExecuted()INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed.booleanwasTransactionBegunPrematurely()INTERNAL: Indicates if a transaction was begun by a pessimistic locking or non-selecting query.voidwriteChanges()ADVANCED: Writes all changes now before commit().voidwritesCompleted()INTERNAL: This method notifies the accessor that a particular sets of writes has completed.-
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
acquireNonSynchronizedUnitOfWork, acquireNonSynchronizedUnitOfWork, acquireRepeatableWriteUnitOfWork, acquireUnitOfWork, addAlias, addJPAQuery, addJPATablePerTenantQuery, addMultitenantContextProperty, addQuery, addQuery, addQuery, addStaticMetamodelClass, addTablePerTenantDescriptor, addTablePerTenantQuery, basicBeginTransaction, basicBeginTransaction, basicCommitTransaction, basicExecuteCall, basicRollbackTransaction, beginExternalTransaction, buildDefaultQueryBuilder, checkAndRefreshInvalidObject, checkHierarchyForDescriptor, cleanUpInjectionManager, clearDescriptors, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitExternalTransaction, compareObjects, compareObjectsDontMatch, config, containsQuery, copy, copy, copyDescriptorNamedQueries, copyDescriptorsFromProject, copyInternal, copyObject, copyObject, createInjectionManager, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, endOperationProfile, executeDeferredEvents, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, fine, finer, finest, getActiveCommandThreads, getActiveSession, getAliasDescriptors, getAllQueries, getAsOfClause, getAttributeGroups, getBroker, getCacheKeyFromTargetSessionForMerge, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getCommandManager, getDatasourceLogin, getDatasourcePlatform, getDefaultReferenceMode, getDescriptor, getDescriptor, getDescriptorForAlias, getDescriptors, getEventManager, getExceptionHandler, getExceptionHandlerClass, getExternalTransactionController, getId, getIdentityMapAccessor, getIdentityMapAccessorInstance, getInjectionManager, getIntegrityChecker, getJPAQueries, getJPATablePerTenantQueries, getLoader, getLog, getLogin, getLogLevel, getLogLevel, getLogSessionString, getMappedSuperclass, getMultitenantContextProperties, getName, getNextQueryId, getNextSequenceNumberValue, getNumberOfActiveUnitsOfWork, getParentIdentityMapSession, getParentIdentityMapSession, getPartitioningPolicy, getPessimisticLockTimeoutDefault, getPessimisticLockTimeoutUnitDefault, getPlatform, getProfiler, getProject, getProperties, getQueries, getQuery, getQuery, getQueryBuilder, getQueryTimeoutDefault, getQueryTimeoutUnitDefault, getRefreshMetadataListener, getRootSession, getSerializer, getSessionForClass, getSessionForName, getSessionLog, getStaticMetamodelClass, getTablePerTenantDescriptors, getTablePerTenantQueries, getTransactionMutex, handleException, handleSevere, hasBroker, hasCommitManager, hasDescriptor, hasEventManager, hasExceptionHandler, hasExternalTransactionController, hasProperties, hasTablePerTenantDescriptors, hasTablePerTenantQueries, incrementProfile, incrementProfile, info, insertObject, isBroker, isClassReadOnly, isClientSession, isConcurrent, isConnected, isDatabaseSession, isDistributedSession, isExclusiveConnectionRequired, isExclusiveIsolatedClientSession, isFinalizersEnabled, isHistoricalSession, isInBroker, isInProfile, isIsolatedClientSession, isJPAQueriesProcessed, isLoggingOff, isProtectedSession, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isSynchronized, keyFromObject, keyFromObject, load, load, log, log, log, log, log, log, log, log, log, log, logMessage, logMessage, logThrowable, postAcquireConnection, prepareDatabaseQuery, preReleaseConnection, priviledgedExecuteNonSelectingCall, priviledgedExecuteSelectingCall, processCommand, processJPAQueries, processJPAQuery, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshAndLockObject, refreshAndLockObject, refreshObject, registerFinalizer, releaseConnectionAfterCall, releaseUnitOfWork, removeProperty, removeQuery, removeQuery, retrieveCacheKey, retryTransaction, rollbackExternalTransaction, setAccessor, setBroker, setCommandManager, setCommitManager, setDatasourceLogin, setDefaultReferenceMode, setEventManager, setExceptionHandler, setExternalTransactionController, setInjectionManager, setIntegrityChecker, setIsConcurrent, setIsFinalizersEnabled, setIsInBroker, setIsInProfile, setJPAQueriesProcessed, setLog, setLoggingOff, setLogin, setLogin, setLogLevel, setName, setNumberOfActiveUnitsOfWork, setPartitioningPolicy, setPessimisticLockTimeoutDefault, setPessimisticLockTimeoutUnitDefault, setProfiler, setProject, setProperties, setProperty, setQueries, setQueryBuilder, setQueryTimeoutDefault, setQueryTimeoutUnitDefault, setRefreshMetadataListener, setSerializer, setSessionLog, setShouldOptimizeResultSetAccess, setShouldPropagateChanges, setTolerateInvalidJPQL, setTransactionMutex, setWasJTSTransactionInternallyStarted, severe, shouldDisplayData, shouldLog, shouldLogMessages, shouldLogMessages, shouldOptimizeResultSetAccess, shouldPropagateChanges, shouldTolerateInvalidJPQL, startOperationProfile, startOperationProfile, toString, unwrapObject, updateObject, updateProfile, updateTablePerTenantDescriptors, validateCache, validateQuery, verifyDelete, warning, wasJTSTransactionInternallyStarted, wrapObject, writeAllObjectsWithChangeSet, writeObject
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.sessions.Session
acquireUnitOfWork, addJPAQuery, addQuery, clearIntegrityChecker, clearProfile, containsQuery, copy, copy, copyObject, copyObject, doesObjectExist, dontLogMessages, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getActiveSession, getAsOfClause, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getDatasourceLogin, getDatasourcePlatform, getDefaultReferenceMode, getDescriptor, getDescriptor, getDescriptorForAlias, getDescriptors, getEventManager, getExceptionHandler, getExternalTransactionController, getId, getIdentityMapAccessor, getIntegrityChecker, getJPAQueries, getLog, getLogin, getLogLevel, getLogLevel, getName, getNextSequenceNumberValue, getPartitioningPolicy, getPlatform, getProfiler, getProject, getProperties, getQueries, getQuery, getSerializer, getSessionLog, handleException, handleSevere, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, isClientSession, isConnected, isDatabaseSession, isDistributedSession, isFinalizersEnabled, isInProfile, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, keyFromObject, log, logMessage, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, refreshObject, removeProperty, removeQuery, setDefaultReferenceMode, setExceptionHandler, setExternalTransactionController, setIntegrityChecker, setIsFinalizersEnabled, setLog, setLogLevel, setName, setPartitioningPolicy, setProfiler, setProperty, setQueryTimeoutDefault, setQueryTimeoutUnitDefault, setSerializer, setSessionLog, shouldLog, shouldLogMessages, validateCache
-
Methods inherited from interface org.eclipse.persistence.sessions.UnitOfWork
deleteAllObjects, deleteObject, isClassReadOnly, refreshAndLockObject, refreshAndLockObject
-
-
-
-
Field Detail
-
CREATION_THREAD_ID
public final long CREATION_THREAD_ID
-
CREATION_THREAD_NAME
public final java.lang.String CREATION_THREAD_NAME
-
CREATION_THREAD_HASHCODE
public final long CREATION_THREAD_HASHCODE
-
cloneToOriginals
protected transient java.util.Map<java.lang.Object,java.lang.Object> cloneToOriginals
As well as used as lookup in merge algorithm for aggregates and others
-
parent
protected transient AbstractSession parent
-
cloneMapping
protected java.util.Map<java.lang.Object,java.lang.Object> cloneMapping
Map of all the clones. The key contains the clone of the object.
-
newObjectsCloneToOriginal
protected java.util.Map<java.lang.Object,java.lang.Object> newObjectsCloneToOriginal
-
newObjectsOriginalToClone
protected java.util.Map<java.lang.Object,java.lang.Object> newObjectsOriginalToClone
-
primaryKeyToNewObjects
protected java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> primaryKeyToNewObjects
Map of primary key to list of new objects. Used to speedup in-memory querying.
-
newObjectsCloneToMergeOriginal
protected java.util.Map<java.lang.Object,java.lang.Object> newObjectsCloneToMergeOriginal
Stores a map from the clone to the original merged object, as a different instance is used as the original for merges.
-
deletedObjects
protected java.util.Map<java.lang.Object,java.lang.Object> deletedObjects
-
allClones
protected java.util.Map<java.lang.Object,java.lang.Object> allClones
This member variable contains a copy of all of the clones for this particular UOW
-
objectsDeletedDuringCommit
protected java.util.Map<java.lang.Object,java.lang.Object> objectsDeletedDuringCommit
-
removedObjects
protected java.util.Map<java.lang.Object,java.lang.Object> removedObjects
-
unregisteredNewObjects
protected java.util.Map<java.lang.Object,java.lang.Object> unregisteredNewObjects
-
unregisteredNewObjectsInParent
protected java.util.Map<java.lang.Object,java.lang.Object> unregisteredNewObjectsInParent
-
unregisteredExistingObjects
protected java.util.Map<java.lang.Object,java.lang.Object> unregisteredExistingObjects
-
newObjectsInParentOriginalToClone
protected java.util.Map<java.lang.Object,java.lang.Object> newObjectsInParentOriginalToClone
-
privateOwnedObjects
protected java.util.Map<DatabaseMapping,java.util.Set> privateOwnedObjects
Cache references of private owned objects for the removal of private owned orphans
-
newObjectsInParent
protected java.util.Map<java.lang.Object,java.lang.Object> newObjectsInParent
used to store a list of the new objects in the parent
-
newAggregates
protected java.util.Map<java.lang.Object,java.lang.Object> newAggregates
-
unitOfWorkChangeSet
protected UnitOfWorkChangeSet unitOfWorkChangeSet
This method is used to store the current changeSet for this UnitOfWork.
-
containerUnitOfWork
protected UnitOfWorkImpl containerUnitOfWork
This is only used for EJB entity beans to manage beans accessed in a transaction context.
-
containerBeans
protected java.util.Map<java.lang.Object,java.lang.Object> containerBeans
-
pessimisticLockedObjects
protected java.util.Map<java.lang.Object,java.lang.Object> pessimisticLockedObjects
use to track pessimistic locked objects
-
lastUsedMergeManager
protected transient MergeManager lastUsedMergeManager
Used to store the list of locks that this UnitOfWork has acquired for this merge
-
batchQueries
protected java.util.Map<ReadQuery,ReadQuery> batchQueries
When in transaction batch read objects must use query local to the unit of work.
-
readOnlyClasses
protected java.util.Set<java.lang.Class> readOnlyClasses
Read-only class can be used for reference data to avoid cloning when not required.
-
wasTransactionBegunPrematurely
protected boolean wasTransactionBegunPrematurely
Flag indicating that the transaction for this UOW was already begun.
-
shouldNewObjectsBeCached
protected boolean shouldNewObjectsBeCached
Allow for double merges of new objects by putting them into the cache.
-
shouldPerformDeletesFirst
protected boolean shouldPerformDeletesFirst
Flag indicating that deletes should be performed before other updates.
-
shouldThrowConformExceptions
protected int shouldThrowConformExceptions
Flag indicating how to deal with exceptions on conforming queries.
-
validationLevel
protected int validationLevel
The amount of validation can be configured.
-
None
public static final int None
- See Also:
- Constant Field Values
-
Partial
public static final int Partial
- See Also:
- Constant Field Values
-
Full
public static final int Full
- See Also:
- Constant Field Values
-
lifecycle
protected int lifecycle
With the new synchronized unit of work, need a lifecycle state variable to track birth, committed, pending_merge and death.
-
Birth
public static final int Birth
- See Also:
- Constant Field Values
-
CommitPending
public static final int CommitPending
- See Also:
- Constant Field Values
-
CommitTransactionPending
public static final int CommitTransactionPending
- See Also:
- Constant Field Values
-
WriteChangesFailed
public static final int WriteChangesFailed
- See Also:
- Constant Field Values
-
MergePending
public static final int MergePending
- See Also:
- Constant Field Values
-
Death
public static final int Death
- See Also:
- Constant Field Values
-
AfterExternalTransactionRolledBack
public static final int AfterExternalTransactionRolledBack
- See Also:
- Constant Field Values
-
DO_NOT_THROW_CONFORM_EXCEPTIONS
public static final int DO_NOT_THROW_CONFORM_EXCEPTIONS
Used for Conforming Queries- See Also:
- Constant Field Values
-
THROW_ALL_CONFORM_EXCEPTIONS
public static final int THROW_ALL_CONFORM_EXCEPTIONS
- See Also:
- Constant Field Values
-
LOCK_QUERIES_PROPERTY
public static final java.lang.String LOCK_QUERIES_PROPERTY
- See Also:
- Constant Field Values
-
SmartMerge
protected static boolean SmartMerge
Used for merging dependent values without use of WL SessionAccessor
-
optimisticReadLockObjects
protected java.util.Map<java.lang.Object,java.lang.Object> optimisticReadLockObjects
Kept reference of read lock objects
-
ReadLockOnly
public static final java.lang.String ReadLockOnly
Used for read lock to determine update the version field with the same value or increment value- See Also:
- Constant Field Values
-
ReadLockUpdateVersion
public static final java.lang.String ReadLockUpdateVersion
- See Also:
- Constant Field Values
-
modifyAllQueries
protected java.util.List<ModifyAllQuery> modifyAllQueries
lazy initialization done in storeModifyAllQuery. For UpdateAllQuery, only clones of all UpdateAllQuery's (deferred and non-deferred) are stored here for validation only.
-
deferredModifyAllQueries
protected java.util.List<java.lang.Object[]> deferredModifyAllQueries
Contains deferred ModifyAllQuery's that have translation row for execution only. At commit their clones will be added to modifyAllQueries for validation afterwards. Array of the query (ModifyAllQuery) and translationRow (AbstractRecord).
-
cloneDepth
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.
-
transaction
protected java.lang.Object transaction
PERF: Stores the JTA transaction to optimize activeUnitOfWork lookup.
-
resumeOnTransactionCompletion
protected boolean resumeOnTransactionCompletion
True if UnitOfWork should be resumed on completion of transaction. Used when UnitOfWork is Synchronized with external transaction control
-
shouldDiscoverNewObjects
protected boolean shouldDiscoverNewObjects
PERF: Allows discover new objects to be skipped if app always calls persist.
-
wasNonObjectLevelModifyQueryExecuted
protected boolean wasNonObjectLevelModifyQueryExecuted
True if either DataModifyQuery or ModifyAllQuery was executed. Gets reset on commit, effects DoesExistQuery behavior and reading.
-
shouldCascadeCloneToJoinedRelationship
protected boolean shouldCascadeCloneToJoinedRelationship
True if the value holder for the joined attribute should be triggered. Required by ejb30 fetch join.
-
isNestedUnitOfWork
protected boolean isNestedUnitOfWork
PERF: Cache isNestedUnitOfWork check.
-
shouldValidateExistence
protected boolean shouldValidateExistence
Determine if does-exist should be performed on persist.
-
commitOrder
protected UnitOfWork.CommitOrderType commitOrder
Allow updates and deletes to be ordered by id or changes to avoid possible deadlocks.
-
referenceMode
protected ReferenceMode referenceMode
This stored the reference mode for this UOW. If the reference mode is weak then this unit of work will retain only weak references to non new, non-deleted objects allowing for garbage collection. If ObjectChangeTracking is used then any objects with changes will not be garbage collected.
-
changeTrackedHardList
protected java.util.Set<java.lang.Object> changeTrackedHardList
-
unregisteredDeletedObjectsCloneToBackupAndOriginal
protected java.util.Map<java.lang.Object,java.lang.Object> unregisteredDeletedObjectsCloneToBackupAndOriginal
Used to store objects already deleted from the db and unregistered
-
preDeleteComplete
protected boolean preDeleteComplete
This attribute records when the preDelete stage of Commit has completed
-
deletedPrivateOwnedObjects
protected java.util.Map<DatabaseMapping,java.util.List<java.lang.Object>> deletedPrivateOwnedObjects
Stores all of the private owned objects that have been removed and may need to cascade deletion
-
mergeManagerForActiveMerge
protected transient MergeManager mergeManagerForActiveMerge
temporarily holds a reference to a merge manager that is calling this UnitOfWork during merge
-
cascadeDeleteObjects
protected java.util.Set<java.lang.Object> cascadeDeleteObjects
Set of objects that were deleted by database cascade delete constraints.
-
deletionDependencies
protected java.util.Map<java.lang.Object,java.util.Set<java.lang.Object>> deletionDependencies
Used to store deleted objects that have reference to other deleted objects. This is need to delete cycles of objects in the correct order.
-
-
Constructor Detail
-
UnitOfWorkImpl
public UnitOfWorkImpl()
INTERNAL:
-
UnitOfWorkImpl
public UnitOfWorkImpl(AbstractSession parent, ReferenceMode referenceMode)
INTERNAL: Create and return a new unit of work with the session as its parent.
-
-
Method Detail
-
acquireHistoricalSession
public Session acquireHistoricalSession(AsOfClause clause) throws ValidationException
INTERNAL: Acquires a special historical session for reading objects as of a past time.- Specified by:
acquireHistoricalSessionin interfaceSession- Overrides:
acquireHistoricalSessionin classAbstractSession- Parameters:
clause- Represents a valid snap shot time.- Throws:
ValidationException- ifthisnot a ClientSession, plain Session, or SessionBroker.- See Also:
AsOfClause,Expression.asOf(org.eclipse.persistence.history.AsOfClause),ObjectLevelReadQuery.setAsOfClause(org.eclipse.persistence.history.AsOfClause),HistoryPolicy
-
acquireUnitOfWork
public UnitOfWorkImpl acquireUnitOfWork()
PUBLIC: Return a nested unit of work for this unit of work. A nested unit of work can be used to isolate a subset of work on the unit of work, such as a dialog being open from an editor. The nested unit of work will only commit change to its objects to its parent unit of work, not the database. Only the parent unit of work will commit to the database.- Specified by:
acquireUnitOfWorkin interfaceSession- Overrides:
acquireUnitOfWorkin classAbstractSession- See Also:
UnitOfWorkImpl
-
addDeletedPrivateOwnedObjects
public void addDeletedPrivateOwnedObjects(DatabaseMapping mapping, java.lang.Object object)
INTERNAL: Records a private owned object that has been de-referenced and will need to processed for related private owned objects.
-
addNewAggregate
public void addNewAggregate(java.lang.Object originalObject)
INTERNAL: Register a new aggregate object with the unit of work.
-
addObjectDeletedDuringCommit
public void addObjectDeletedDuringCommit(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Add object deleted during root commit of unit of work.
-
addReadOnlyClass
public void addReadOnlyClass(java.lang.Class theClass) throws ValidationExceptionPUBLIC: Adds the given Java class to the receiver's set of read-only classes. Cannot be called after objects have been registered in the unit of work.- Specified by:
addReadOnlyClassin interfaceUnitOfWork- Throws:
ValidationException
-
addReadOnlyClasses
public void addReadOnlyClasses(java.util.Collection classes)
PUBLIC: Adds the classes in the given Vector to the existing set of read-only classes. Cannot be called after objects have been registered in the unit of work.- Specified by:
addReadOnlyClassesin interfaceUnitOfWork
-
addRemovedObject
public void addRemovedObject(java.lang.Object orignal)
INTERNAL: Register that an object was removed in a nested unit of work.
-
assignSequenceNumber
public void assignSequenceNumber(java.lang.Object object) throws DatabaseExceptionADVANCED: Assign sequence number to the object. This allows for an object's id to be assigned before commit. It can be used if the application requires to use the object id before the object exists on the database. Normally all ids are assigned during the commit automatically.- Specified by:
assignSequenceNumberin interfaceUnitOfWork- Throws:
DatabaseException
-
assignSequenceNumber
public java.lang.Object assignSequenceNumber(java.lang.Object object, ClassDescriptor descriptor) throws DatabaseExceptionINTERNAL: Assign sequence number to the object.- Throws:
DatabaseException
-
assignSequenceNumbers
public void assignSequenceNumbers() throws DatabaseExceptionADVANCED: Assign sequence numbers to all new objects registered in this unit of work, or any new objects reference by any objects registered. This allows for an object's id to be assigned before commit. It can be used if the application requires to use the object id before the object exists on the database. Normally all ids are assigned during the commit automatically.- Specified by:
assignSequenceNumbersin interfaceUnitOfWork- Throws:
DatabaseException
-
assignSequenceNumbers
protected void assignSequenceNumbers(java.util.Map objects) throws DatabaseExceptionINTERNAL: Assign sequence numbers to all of the objects. This allows for an object's id to be assigned before commit. It can be used if the application requires to use the object id before the object exists on the database. Normally all ids are assigned during the commit automatically.- Throws:
DatabaseException
-
beginEarlyTransaction
public void beginEarlyTransaction() throws DatabaseExceptionPUBLIC: Tell the unit of work to begin a transaction now. By default the unit of work will begin a transaction at commit time. The default is the recommended approach, however sometimes it is necessary to start the transaction before commit time. When the unit of work commits, this transaction will be committed.- Specified by:
beginEarlyTransactionin interfaceUnitOfWork- Throws:
DatabaseException- See Also:
commit(),release()
-
beginTransaction
public void beginTransaction() throws DatabaseExceptionINTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow. The uow shares its parents transactions.- Overrides:
beginTransactionin classAbstractSession- Throws:
DatabaseException- if the database connection is lost or the begin is rejected.- See Also:
AbstractSession.isInTransaction()
-
buildOriginal
public java.lang.Object buildOriginal(java.lang.Object workingClone)
INTERNAL: Unregistered new objects have no original so we must create one for commit and resume and to put into the parent. We can NEVER let the same copy of an object exist in multiple units of work.
-
calculateChanges
public UnitOfWorkChangeSet calculateChanges(java.util.Map 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. This also assigns sequence numbers to new objects.
-
canChangeReadOnlySet
protected boolean canChangeReadOnlySet()
INTERNAL: Checks whether the receiver has been used. i.e. objects have been registered.- Returns:
- true or false depending on whether the read-only set can be changed or not.
-
checkForUnregisteredExistingObject
public boolean checkForUnregisteredExistingObject(java.lang.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).
-
checkExistence
public java.lang.Object checkExistence(java.lang.Object object)
INTERNAL: Register the object and return the clone if it is existing otherwise return null if it is new. The unit of work determines existence during registration, not during the commit.
-
checkIfAlreadyRegistered
public java.lang.Object checkIfAlreadyRegistered(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Return the value of the object if it already is registered, otherwise null.
-
isConsideredInvalid
public boolean isConsideredInvalid(java.lang.Object object, CacheKey cacheKey, ClassDescriptor descriptor)INTERNAL: Check if the object is invalid and *should* be refreshed. This is used to ensure that no invalid objects are cloned.- Overrides:
isConsideredInvalidin classAbstractSession
-
cloneAndRegisterNewObject
protected java.lang.Object cloneAndRegisterNewObject(java.lang.Object original, boolean isShallowClone)ADVANCED: Register the new object with the unit of work. This will register the new object with cloning. Normally the registerObject method should be used for all registration of new and existing objects. This version of the register method can only be used for new objects. This method should only be used if a new object is desired to be registered without an existence Check.- See Also:
registerObject(Object)
-
cloneAndRegisterObject
public java.lang.Object cloneAndRegisterObject(java.lang.Object original, CacheKey parentCacheKey, ClassDescriptor descriptor)INTERNAL: Clone and register the object. The cache key must the cache key from the session cache, as it will be used for locking. The unit of work cache key is passed to the normal cloneAndRegisterObject method.
-
cloneAndRegisterObject
public java.lang.Object cloneAndRegisterObject(java.lang.Object original, CacheKey parentCacheKey, CacheKey unitOfWorkCacheKey, ClassDescriptor descriptor)INTERNAL: Clone and register the object. The cache key must the cache key from the session cache, as it will be used for locking.
-
collectAndPrepareObjectsForNestedMerge
public java.util.Map collectAndPrepareObjectsForNestedMerge()
INTERNAL: Prepare for merge in nested uow.
-
commit
public void commit() throws DatabaseException, OptimisticLockExceptionPUBLIC: Commit the unit of work to its parent. For a nested unit of work this will merge any changes to its objects with its parents. For a first level unit of work it will commit all changes to its objects to the database as a single transaction. If successful the changes to its objects will be merged to its parent's objects. If the commit fails the database transaction will be rolledback, and the unit of work will be released. If the commit is successful the unit of work is released, and a new unit of work must be acquired if further changes are desired.- Specified by:
commitin interfaceUnitOfWork- Throws:
DatabaseExceptionOptimisticLockException- See Also:
commitAndResumeOnFailure(),commitAndResume(),release()
-
commitAndResume
public void commitAndResume() throws DatabaseException, OptimisticLockExceptionPUBLIC: Commit the unit of work to its parent. For a nested unit of work this will merge any changes to its objects with its parents. For a first level unit of work it will commit all changes to its objects to the database as a single transaction. If successful the changes to its objects will be merged to its parent's objects. If the commit fails the database transaction will be rolledback, and the unit of work will be released. The normal commit releases the unit of work, forcing a new one to be acquired if further changes are desired. The resuming feature allows for the same unit of work (and working copies) to be continued to be used.- Specified by:
commitAndResumein interfaceUnitOfWork- Throws:
DatabaseExceptionOptimisticLockException- See Also:
commitAndResumeOnFailure(),commit(),release()
-
commitAndResumeWithPreBuiltChangeSet
public void commitAndResumeWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet) throws DatabaseException, OptimisticLockException
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
-
commitAndResumeOnFailure
public void commitAndResumeOnFailure() throws DatabaseException, OptimisticLockExceptionPUBLIC: Commit the unit of work to its parent. For a nested unit of work this will merge any changes to its objects with its parents. For a first level unit of work it will commit all changes to its objects to the database as a single transaction. If successful the changes to its objects will be merged to its parent's objects. If the commit fails the database transaction will be rolledback, but the unit of work will remain active. It can then be retried or released. The normal commit failure releases the unit of work, forcing a new one to be acquired if further changes are desired. The resuming feature allows for the same unit of work (and working copies) to be continued to be used if an error occurs. The UnitOfWork will also remain active if the commit is successful.- Specified by:
commitAndResumeOnFailurein interfaceUnitOfWork- Throws:
DatabaseExceptionOptimisticLockException- See Also:
commit(),release()
-
commitAfterWriteChanges
protected void commitAfterWriteChanges()
INTERNAL: Commits a UnitOfWork where the commit process has already been initiated by all call to writeChanges().a.k.a finalizeCommit()
-
commitAndResumeAfterWriteChanges
protected void commitAndResumeAfterWriteChanges()
INTERNAL: Commits and resumes a UnitOfWork where the commit process has already been initiated by all call to writeChanges().a.k.a finalizeCommit()
-
commitInternallyStartedExternalTransaction
protected boolean commitInternallyStartedExternalTransaction()
PROTECTED: Used in commit and commit-like methods to commit internally started external transaction
-
commitNestedUnitOfWork
protected void commitNestedUnitOfWork()
INTERNAL: Commit the changes to any objects to the parent.
-
commitRootUnitOfWork
public void commitRootUnitOfWork() throws DatabaseException, OptimisticLockExceptionINTERNAL: Commit the changes to any objects to the parent.
-
commitRootUnitOfWorkWithPreBuiltChangeSet
public void commitRootUnitOfWorkWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet) throws DatabaseException, OptimisticLockException
INTERNAL: This method is used by the MappingWorkbench read-only files feature It will commit a pre-built unitofwork change set to the database
-
commitToDatabase
protected void commitToDatabase(boolean commitTransaction)
INTERNAL: CommitChanges To The Database from a calculated changeSet- Parameters:
commitTransaction- false if called by writeChanges as intent is not to finalize the transaction.
-
commitToDatabaseWithChangeSet
protected void commitToDatabaseWithChangeSet(boolean commitTransaction) throws DatabaseException, OptimisticLockExceptionINTERNAL: Commit the changes to any objects to the parent.- Parameters:
commitTransaction- false if called by writeChanges as intent is not to finalize the transaction.- Throws:
DatabaseExceptionOptimisticLockException
-
commitToDatabaseWithPreBuiltChangeSet
protected void commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet, boolean commitTransaction, boolean isChangeSetFromOutsideUOW) throws DatabaseException, OptimisticLockException
INTERNAL: Commit pre-built changeSet to the database changeSet to the database.
-
commitTransaction
public void commitTransaction() throws DatabaseExceptionINTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow. The uow shares its parents transactions.- Overrides:
commitTransactionin classAbstractSession- Throws:
DatabaseException- most databases validate changes as they are done, normally errors do not occur on commit unless the disk fails or the connection is lost.
-
commitTransactionAfterWriteChanges
public void commitTransactionAfterWriteChanges()
INTERNAL: After writeChanges() everything has been done except for committing the transaction. This allows that execution path to 'catch up'.
-
acquireWriteLocks
protected void acquireWriteLocks()
INTERNAL: Acquire the unit of work cache write locks, if required.
-
releaseWriteLocks
public void releaseWriteLocks()
INTERNAL: Release the unit of work cache write locks, if acquired.
-
copyReadOnlyClasses
public java.util.Vector copyReadOnlyClasses()
INTERNAL: Copy the read only classes from the unit of work.- Overrides:
copyReadOnlyClassesin classAbstractSession
-
deepMergeClone
public java.lang.Object deepMergeClone(java.lang.Object rmiClone)
PUBLIC: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization or other serialization mechanisms, because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. Everything connected to this object (i.e. the entire object tree where rmiClone is the root) is also merged.- Specified by:
deepMergeClonein interfaceUnitOfWork- Returns:
- the registered version for the clone being merged.
- See Also:
mergeClone(Object),shallowMergeClone(Object)
-
deepRevertObject
public java.lang.Object deepRevertObject(java.lang.Object clone)
PUBLIC: Revert the object's attributes from the parent. This reverts everything the object references.- Specified by:
deepRevertObjectin interfaceUnitOfWork- Returns:
- the object reverted.
- See Also:
revertObject(Object),shallowRevertObject(Object)
-
deepUnregisterObject
public void deepUnregisterObject(java.lang.Object clone)
ADVANCED: Unregister the object with the unit of work. This can be used to delete an object that was just created and is not yet persistent. Delete object can also be used, but will result in inserting the object and then deleting it. The method should be used carefully because it will delete all the reachable parts.- Specified by:
deepUnregisterObjectin interfaceUnitOfWork
-
discoverAllUnregisteredNewObjects
protected void discoverAllUnregisteredNewObjects()
INTERNAL: Search for any objects in the parent that have not been registered. These are required so that the nested unit of work does not add them to the parent clone mapping on commit, causing possible incorrect insertions if they are dereferenced.
-
discoverAllUnregisteredNewObjectsInParent
protected void discoverAllUnregisteredNewObjectsInParent()
INTERNAL: Search for any objects in the parent that have not been registered. These are required so that the nested unit of work does not add them to the parent clone mapping on commit, causing possible incorrect insertions if they are dereferenced.
-
discoverUnregisteredNewObjects
public void discoverUnregisteredNewObjects(java.util.Map clones, java.util.Map knownNewObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects)INTERNAL: Traverse the object to find references to objects not registered in this unit of work.
-
dontPerformValidation
public void dontPerformValidation()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
dontPerformValidationin interfaceUnitOfWork
-
executeCall
public java.lang.Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException
INTERNAL: Override From session. Get the accessor based on the query, and execute call, this is here for session broker.- Overrides:
executeCallin classAbstractSession- Throws:
DatabaseException
-
forceUpdateToVersionField
public void forceUpdateToVersionField(java.lang.Object lockObject, boolean shouldModifyVersionField)ADVANCED: Set optimistic read lock on the object. This feature is override by normal optimistic lock. when the object is changed in UnitOfWork. The cloneFromUOW must be the clone of from this UnitOfWork and it must implements version locking or timestamp locking. The SQL would look like the followings. If shouldModifyVersionField is true, "UPDATE EMPLOYEE SET VERSION = 2 WHERE EMP_ID = 9 AND VERSION = 1" If shouldModifyVersionField is false, "UPDATE EMPLOYEE SET VERSION = 1 WHERE EMP_ID = 9 AND VERSION = 1"- Specified by:
forceUpdateToVersionFieldin interfaceUnitOfWork
-
getAccessor
public Accessor getAccessor()
INTERNAL: The uow does not store a local accessor but shares its parents.- Overrides:
getAccessorin classAbstractSession
-
getAccessors
public java.util.Collection<Accessor> getAccessors()
INTERNAL: The uow does not store a local accessor but shares its parents.- Overrides:
getAccessorsin classAbstractSession
-
getCommitManager
public CommitManager getCommitManager()
INTERNAL: The commit manager is used to resolve referential integrity on commits of multiple objects. The commit manage is lazy init from parent.- Overrides:
getCommitManagerin classAbstractSession
-
getAccessors
public java.util.Collection<Accessor> getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)
INTERNAL: Return the connections to use for the query execution.- Overrides:
getAccessorsin classAbstractSession
-
getActiveUnitOfWork
public UnitOfWork getActiveUnitOfWork()
PUBLIC: Return the active unit of work for the current active external (JTS) transaction. This should only be used with JTS and will return null if no external transaction exists.- Specified by:
getActiveUnitOfWorkin interfaceSession- Overrides:
getActiveUnitOfWorkin classAbstractSession
-
getAllFromNewObjects
public java.util.Vector getAllFromNewObjects(Expression selectionCriteria, java.lang.Class theClass, AbstractRecord translationRow, int valueHolderPolicy)
INTERNAL: Return any new objects matching the expression. Used for in-memory querying.
-
getBackupClone
public java.lang.Object getBackupClone(java.lang.Object clone) throws QueryExceptionINTERNAL: Return the backup clone for the working clone.- Throws:
QueryException
-
getBackupClone
public java.lang.Object getBackupClone(java.lang.Object clone, ClassDescriptor descriptor) throws QueryExceptionINTERNAL: Return the backup clone for the working clone.- Throws:
QueryException
-
getBackupCloneForCommit
public java.lang.Object getBackupCloneForCommit(java.lang.Object clone, ClassDescriptor descriptor)INTERNAL: Return the backup clone for the working clone.
-
getBackupCloneForCommit
public java.lang.Object getBackupCloneForCommit(java.lang.Object clone)
INTERNAL: Return the backup clone for the working clone.
-
getCurrentChanges
public UnitOfWorkChangeSet getCurrentChanges()
ADVANCED: This method Will Calculate the changes for the UnitOfWork. Without assigning sequence numbers This is a computationally intensive operation and should be avoided unless necessary. A valid changeSet, with sequencenumbers can be collected from the UnitOfWork after the commit is complete by calling unitOfWork.getUnitOfWorkChangeSet()- Specified by:
getCurrentChangesin interfaceUnitOfWork
-
getParentIdentityMapSession
public AbstractSession getParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)
INTERNAL: Returns the appropriate IdentityMap session for this descriptor. Sessions can be chained and each session can have its own Cache/IdentityMap. Entities can be stored at different levels based on Cache Isolation. This method will return the correct Session for a particular Entity class based on the Isolation Level and the attributes provided.- Overrides:
getParentIdentityMapSessionin classAbstractSession- Parameters:
canReturnSelf- true when method calls itself. If the path starting atthisis acceptable. Sometimes true if want to move to the first valid session, i.e. executing on ClientSession when really should be on ServerSession.terminalOnly- return the last session in the chain where the Enitity is stored.- Returns:
- Session with the required IdentityMap
-
getExecutionSession
public AbstractSession getExecutionSession(DatabaseQuery query)
INTERNAL: Gets the session which this query will be executed on. Generally will be called immediately before the call is translated, which is immediately before session.executeCall.Since the execution session also knows the correct datasource platform to execute on, it is often used in the mappings where the platform is needed for type conversion, or where calls are translated.
Is also the session with the accessor. Will return a ClientSession if it is in transaction and has a write connection.
- Overrides:
getExecutionSessionin classAbstractSession- Parameters:
query- may store session name or reference class for brokers case- Returns:
- a session with a live accessor
-
getCloneMapping
public java.util.Map getCloneMapping()
INTERNAL: Return the clone mapping. The clone mapping contains clone of all registered objects, this is required to store the original state of the objects when registered so that only what is changed will be committed to the database and the parent, (this is required to support parallel unit of work).
-
hasCloneMapping
public boolean hasCloneMapping()
INTERNAL: Return if the unit of work has any clones.
-
getCloneToOriginals
public java.util.Map getCloneToOriginals()
INTERNAL: Map used to avoid garbage collection in weak caches. Also, map used as lookup when originals used for merge when original in identitymap can not be found. As in a CacheIdentityMap
-
hasCloneToOriginals
protected boolean hasCloneToOriginals()
-
getContainerBeans
public java.util.Map getContainerBeans()
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.
-
hasContainerBeans
public boolean hasContainerBeans()
INTERNAL: Return if any container beans exist. PERF: Used to avoid lazy initialization of getContainerBeans().
-
getCascadeDeleteObjects
public java.util.Set<java.lang.Object> getCascadeDeleteObjects()
INTERNAL: Return any objects have been deleted through database cascade delete constraints.
-
setCascadeDeleteObjects
protected void setCascadeDeleteObjects(java.util.Set<java.lang.Object> cascadeDeleteObjects)
INTERNAL: Set any objects have been deleted through database cascade delete constraints.
-
hasCascadeDeleteObjects
public boolean hasCascadeDeleteObjects()
INTERNAL: Return if any objects have been deleted through database cascade delete constraints.
-
hasUnregisteredNewObjects
public boolean hasUnregisteredNewObjects()
INTERNAL: Return if there are any unregistered new objects. PERF: Used to avoid initialization of new objects map unless required.
-
hasNewObjects
public boolean hasNewObjects()
INTERNAL: Return if there are any registered new objects. This is used for both newObjectsOriginalToClone and newObjectsCloneToOriginal as they are always in synch. PERF: Used to avoid initialization of new objects map unless required.
-
getContainerUnitOfWork
public UnitOfWorkImpl getContainerUnitOfWork()
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.
-
getDefaultReadOnlyClasses
public java.util.Vector getDefaultReadOnlyClasses()
INTERNAL: Returns the set of read-only classes that gets assigned to each newly created UnitOfWork.- Overrides:
getDefaultReadOnlyClassesin classAbstractSession- See Also:
org.eclipse.persistence.sessions.Project#setDefaultReadOnlyClasses(Vector)
-
getDeletedObjects
public java.util.Map getDeletedObjects()
INTERNAL: The deleted objects stores any objects removed during the unit of work. On commit they will all be removed from the database.
-
hasDeletedObjects
public boolean hasDeletedObjects()
INTERNAL: The deleted objects stores any objects removed during the unit of work. On commit they will all be removed from the database.
-
getLifecycle
public int getLifecycle()
INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS.
-
getMergeManager
public MergeManager getMergeManager()
A reference to the last used merge manager. This is used to track locked objects.
-
getNewAggregates
public java.util.Map getNewAggregates()
INTERNAL: The map stores any new aggregates that have been cloned.
-
getNewObjectsCloneToOriginal
public java.util.Map getNewObjectsCloneToOriginal()
INTERNAL: The new objects stores any objects newly created during the unit of work. On commit they will all be inserted into the database.
-
getPrimaryKeyToNewObjects
public java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> getPrimaryKeyToNewObjects()
INTERNAL: The primaryKeyToNewObjects stores a list of objects for every primary key. It is used to speed up in-memory-querying.
-
getNewObjectsCloneToMergeOriginal
public java.util.Map getNewObjectsCloneToMergeOriginal()
INTERNAL: The stores a map from new object clones to the original object used from merge.
-
getNewObjectsInParentOriginalToClone
public java.util.Map getNewObjectsInParentOriginalToClone()
INTERNAL: The returns the list that will hold the new objects from the Parent UnitOfWork
-
hasNewObjectsInParentOriginalToClone
protected boolean hasNewObjectsInParentOriginalToClone()
-
hasPrivateOwnedObjects
public boolean hasPrivateOwnedObjects()
INTERNAL: Return true if privateOwnedObjects is not null and not empty, false otherwise.
-
hasOptimisticReadLockObjects
public boolean hasOptimisticReadLockObjects()
INTERNAL: Return if there are any optimistic read locks.
-
getNewObjectsOriginalToClone
public java.util.Map getNewObjectsOriginalToClone()
INTERNAL: The new objects stores any objects newly created during the unit of work. On commit they will all be inserted into the database.
-
getSequencing
public Sequencing getSequencing()
INTERNAL: Return the Sequencing object used by the session.- Overrides:
getSequencingin classAbstractSession
-
getServerPlatform
public ServerPlatform getServerPlatform()
INTERNAL: Marked internal as this is not customer API but helper methods for accessing the server platform from within EclipseLink's other sessions types (i.e. not DatabaseSession)- Specified by:
getServerPlatformin interfaceSession- Overrides:
getServerPlatformin classAbstractSession
-
getSessionTypeString
public java.lang.String getSessionTypeString()
INTERNAL: Returns the type of session, its class.Override to hide from the user when they are using an internal subclass of a known class.
A user does not need to know that their UnitOfWork is a non-deferred UnitOfWork, or that their ClientSession is an IsolatedClientSession.
- Overrides:
getSessionTypeStringin classAbstractSession
-
afterExternalTransactionRollback
public void afterExternalTransactionRollback()
INTERNAL: Called after external transaction rolled back.
-
releaseJTSConnection
public void releaseJTSConnection()
INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener. Close the managed sql connection corresponding to the external transaction.- Overrides:
releaseJTSConnectionin classAbstractSession
-
getObjectFromNewObjects
public java.lang.Object getObjectFromNewObjects(java.lang.Class theClass, java.lang.Object selectionKey)INTERNAL: Return any new object matching the expression. Used for in-memory querying.
-
getObjectFromNewObjects
public java.lang.Object getObjectFromNewObjects(Expression selectionCriteria, java.lang.Class theClass, AbstractRecord translationRow, int valueHolderPolicy)
INTERNAL: Return any new object matching the expression. Used for in-memory querying.
-
getObjectsDeletedDuringCommit
public java.util.Map getObjectsDeletedDuringCommit()
INTERNAL: Returns all the objects which are deleted during root commit of unit of work.
-
hasObjectsDeletedDuringCommit
protected boolean hasObjectsDeletedDuringCommit()
-
getOptimisticReadLockObjects
public java.util.Map getOptimisticReadLockObjects()
INTERNAL: Return optimistic read lock objects
-
getOriginalVersionOfNewObject
public java.lang.Object getOriginalVersionOfNewObject(java.lang.Object workingClone)
INTERNAL: Return the original version of the new object (working clone).
-
getOriginalVersionOfObject
public java.lang.Object getOriginalVersionOfObject(java.lang.Object workingClone)
ADVANCED: Return the original version of the object(clone) from the parent's identity map.- Specified by:
getOriginalVersionOfObjectin interfaceUnitOfWork
-
getOriginalVersionOfObjectOrNull
public java.lang.Object getOriginalVersionOfObjectOrNull(java.lang.Object workingClone, ObjectChangeSet changeSet, ClassDescriptor descriptor, AbstractSession targetSession)INTERNAL: Return the original version of the object(clone) from the parent's identity map. PERF: Use the change set to avoid cache lookups.
-
getOriginalVersionOfObjectOrNull
public java.lang.Object getOriginalVersionOfObjectOrNull(java.lang.Object workingClone, ClassDescriptor descriptor)INTERNAL: Return the original version of the object(clone) from the parent's identity map.
-
getParent
public AbstractSession getParent()
PUBLIC: Return the parent. This is a unit of work if nested, otherwise a database session or client session.- Specified by:
getParentin interfaceUnitOfWork- Overrides:
getParentin classAbstractSession
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
INTERNAL: Search for and return the user defined property from this UOW, if it not found then search for the property from parent.- Specified by:
getPropertyin interfaceSession- Overrides:
getPropertyin classAbstractSession
-
getPlatform
public Platform getPlatform(java.lang.Class domainClass)
INTERNAL: Return the platform for a particular class.- Overrides:
getPlatformin classAbstractSession
-
getShouldThrowConformExceptions
public int getShouldThrowConformExceptions()
INTERNAL: Return whether to throw exceptions on conforming queries
-
getQuery
public DatabaseQuery getQuery(java.lang.String name, java.util.Vector arguments)
PUBLIC: Return the query from the session pre-defined queries with the given name. This allows for common queries to be pre-defined, reused and executed by name.- Overrides:
getQueryin classAbstractSession- See Also:
AbstractSession.getQuery(String)
-
getQuery
public DatabaseQuery getQuery(java.lang.String name)
PUBLIC: Return the query from the session pre-defined queries with the given name. This allows for common queries to be pre-defined, reused and executed by name.- Specified by:
getQueryin interfaceSession- Overrides:
getQueryin classAbstractSession
-
getReadOnlyClasses
public java.util.Set getReadOnlyClasses()
ADVANCED: Returns the set of read-only classes in this UnitOfWork.- Specified by:
getReadOnlyClassesin interfaceUnitOfWork
-
getRemovedObjects
protected java.util.Map getRemovedObjects()
INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work. On commit they will all be removed from the parent unit of work.
-
hasRemovedObjects
protected boolean hasRemovedObjects()
-
hasModifyAllQueries
protected boolean hasModifyAllQueries()
-
hasDeferredModifyAllQueries
protected boolean hasDeferredModifyAllQueries()
-
getState
public int getState()
INTERNAL: Find out what the lifecycle state of this UoW is in.
-
getTransaction
public java.lang.Object getTransaction()
INTERNAL: PERF: Return the associated external transaction. Used to optimize activeUnitOfWork lookup.
-
setTransaction
public void setTransaction(java.lang.Object transaction)
INTERNAL: PERF: Set the associated external transaction. Used to optimize activeUnitOfWork lookup.
-
getUnitOfWorkChangeSet
public UnitOfWorkChangeSet getUnitOfWorkChangeSet()
ADVANCED: Returns the currentChangeSet from the UnitOfWork. This is only valid after the UnitOfWOrk has committed successfully- Specified by:
getUnitOfWorkChangeSetin interfaceUnitOfWork
-
getUnregisteredExistingObjects
public java.util.Map getUnregisteredExistingObjects()
INTERNAL: Used to lazy Initialize the unregistered existing Objects collection.- Returns:
- Map
-
getUnregisteredNewObjects
protected java.util.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.
-
getUnregisteredNewObjectsInParent
protected java.util.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.
-
getValidationLevel
public int getValidationLevel()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
getValidationLevelin interfaceUnitOfWork
-
hasChanges
public boolean hasChanges()
ADVANCED: The Unit of work is capable of preprocessing to determine if any on the clone have been changed. This is computationally expensive and should be avoided on large object graphs.- Specified by:
hasChangesin interfaceUnitOfWork
-
hasModifications
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. Should be called after changes are calculated internally by commit.Note if a transaction was begun prematurely it still needs to be committed.
-
initializeIdentityMapAccessor
public void initializeIdentityMapAccessor()
INTERNAL: Set up the IdentityMapManager. This method allows subclasses of Session to override the default IdentityMapManager functionality.- Overrides:
initializeIdentityMapAccessorin classAbstractSession
-
internalExecuteQuery
public java.lang.Object internalExecuteQuery(DatabaseQuery query, AbstractRecord databaseRow) throws DatabaseException, QueryException
INTERNAL: Return the results from executing the database query. the arguments should be a database row with raw data values.- Overrides:
internalExecuteQueryin classAbstractSession- Throws:
DatabaseExceptionQueryException
-
internalRegisterObject
public java.lang.Object internalRegisterObject(java.lang.Object object, ClassDescriptor descriptor, boolean isShallowClone)INTERNAL: Register the object with the unit of work. This does not perform wrapping or unwrapping. This is used for internal registration in the merge manager.
-
isActive
public boolean isActive()
PUBLIC: Return if the unit of work is active. (i.e. has not been released).- Specified by:
isActivein interfaceUnitOfWork
-
isClassReadOnly
public boolean isClassReadOnly(java.lang.Class theClass, ClassDescriptor descriptor)INTERNAL: Checks to see if the specified class or descriptor is read-only or not in this UnitOfWork.- Overrides:
isClassReadOnlyin classAbstractSession- Returns:
- boolean, true if the class is read-only, false otherwise.
-
isCloneNewObjectFromParent
public boolean isCloneNewObjectFromParent(java.lang.Object clone)
INTERNAL: Check if the object is already registered in a parent Unit Of Work
-
isCloneNewObject
public boolean isCloneNewObject(java.lang.Object clone)
INTERNAL: Check if the object is already registered.
-
isCommitPending
public boolean isCommitPending()
INTERNAL: Return if the unit of work is waiting to be committed or in the process of being committed.
-
isDead
public boolean isDead()
INTERNAL: Return if the unit of work is dead.
-
isInTransaction
public boolean isInTransaction()
PUBLIC: Return whether the session currently has a database transaction in progress.- Overrides:
isInTransactionin classAbstractSession
-
isMergePending
public boolean isMergePending()
INTERNAL: Return if the unit of work is waiting to be merged or in the process of being merged.
-
isAfterWriteChangesButBeforeCommit
public boolean isAfterWriteChangesButBeforeCommit()
INTERNAL: Has writeChanges() been attempted on this UnitOfWork? It may have either succeeded or failed but either way the UnitOfWork is in a highly restricted state.
-
isAfterWriteChangesFailed
protected boolean isAfterWriteChangesFailed()
INTERNAL: Once writeChanges has failed all a user can do really is rollback.
-
isNestedUnitOfWork
public boolean isNestedUnitOfWork()
PUBLIC: Return whether this session is a nested unit of work or not.- Specified by:
isNestedUnitOfWorkin interfaceUnitOfWork
-
isNewObjectInParent
public boolean isNewObjectInParent(java.lang.Object clone)
INTERNAL: This method determines if the specified clone is new in the parent UnitOfWork
-
isObjectDeleted
public boolean isObjectDeleted(java.lang.Object object)
INTERNAL: Return if the object has been deleted in this unit of work.
-
isObjectNew
public boolean isObjectNew(java.lang.Object clone)
INTERNAL: This method is used to determine if the clone is a new Object in the UnitOfWork
-
isUnregisteredExistingObject
public boolean isUnregisteredExistingObject(java.lang.Object object)
INTERNAL: Return if the object is a known unregistered existing object.
-
isObjectRegistered
public boolean isObjectRegistered(java.lang.Object clone)
ADVANCED: Return whether the clone object is already registered.- Specified by:
isObjectRegisteredin interfaceUnitOfWork
-
isOriginalNewObject
public boolean isOriginalNewObject(java.lang.Object original)
INTERNAL: Return whether the original object is new. It was either registered as new or discovered as a new aggregate within another new object.
-
isSmartMerge
public static boolean isSmartMerge()
INTERNAL: Return the status of smart merge
-
issueSQLbeforeCompletion
public void issueSQLbeforeCompletion()
INTERNAL: For synchronized units of work, dump SQL to database. For cases where writes occur before the end of the transaction don't commit
-
issueSQLbeforeCompletion
public void issueSQLbeforeCompletion(boolean commitTransaction)
INTERNAL: For synchronized units of work, dump SQL to database. For cases where writes occur before the end of the transaction don't commit
-
issueModifyAllQueryList
protected void issueModifyAllQueryList()
INTERNAL: Will notify all the deferred ModifyAllQuery's (excluding UpdateAllQuery's) and deferred UpdateAllQuery's to execute.
-
isUnitOfWork
public boolean isUnitOfWork()
PUBLIC: Return if this session is a unit of work.- Specified by:
isUnitOfWorkin interfaceSession- Overrides:
isUnitOfWorkin classAbstractSession
-
isUnregisteredNewObjectInParent
public boolean isUnregisteredNewObjectInParent(java.lang.Object originalObject)
INTERNAL: Return if the object was existing but not registered in the parent of the nested unit of work.
-
mergeBmpAndWsEntities
protected void mergeBmpAndWsEntities()
INTERNAL: BMP and Websphere CMP entities have to be merged if they are registered in the unit of work. Check to see if there are any such entities and do the merge if required.
-
mergeChangesIntoParent
protected void mergeChangesIntoParent()
INTERNAL: Merge the changes to all objects to the parent.
-
mergeClone
public java.lang.Object mergeClone(java.lang.Object rmiClone)
PUBLIC: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization (or another serialization mechanism), because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. The object and its private owned parts are merged.- Specified by:
mergeClonein interfaceUnitOfWork- Returns:
- the registered version for the clone being merged.
- See Also:
shallowMergeClone(Object),deepMergeClone(Object)
-
mergeClone
public java.lang.Object mergeClone(java.lang.Object rmiClone, int cascadeDepth, boolean forRefresh)INTERNAL: Merge the attributes of the clone into the unit of work copy.
-
mergeClonesAfterCompletion
public void mergeClonesAfterCompletion()
INTERNAL: for synchronized units of work, merge changes into parent
-
mergeCloneWithReferences
public java.lang.Object mergeCloneWithReferences(java.lang.Object rmiClone)
PUBLIC: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization (or another serialization mechanism), because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. The object and its private owned parts are merged. This will include references from dependent objects to independent objects.- Specified by:
mergeCloneWithReferencesin interfaceUnitOfWork- Returns:
- the registered version for the clone being merged.
- See Also:
shallowMergeClone(Object),deepMergeClone(Object)
-
mergeCloneWithReferences
public java.lang.Object mergeCloneWithReferences(java.lang.Object rmiClone, int cascadePolicy)PUBLIC: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization (or another serialization mechanism), because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. The object and its private owned parts are merged. This will include references from dependent objects to independent objects.- Returns:
- the registered version for the clone being merged.
- See Also:
shallowMergeClone(Object),deepMergeClone(Object)
-
mergeCloneWithReferences
public java.lang.Object mergeCloneWithReferences(java.lang.Object rmiClone, int cascadePolicy, boolean forceCascade)INTERNAL: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization (or another serialization mechanism), because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. The object and its private owned parts are merged. This will include references from dependent objects to independent objects.- Returns:
- the registered version for the clone being merged.
- See Also:
shallowMergeClone(Object),deepMergeClone(Object)
-
mergeCloneWithReferences
public java.lang.Object mergeCloneWithReferences(java.lang.Object rmiClone, MergeManager manager)INTERNAL: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization (or another serialization mechanism), because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. The object and its private owned parts are merged. This will include references from dependent objects to independent objects.- Returns:
- the registered version for the clone being merged.
- See Also:
shallowMergeClone(Object),deepMergeClone(Object)
-
newInstance
public java.lang.Object newInstance(java.lang.Class theClass)
PUBLIC: Return a new instance of the class registered in this unit of work. This can be used to ensure that new objects are registered correctly.- Specified by:
newInstancein interfaceUnitOfWork
-
performRemove
public void performRemove(java.lang.Object toBeDeleted, java.util.Map 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. It does not execute a query for the deletion of these objects as the normal deleteobject operation does. Mainly implemented to provide EJB 3.0 deleteObject support.
-
performRemovePrivateOwnedObjectFromChangeSet
public void performRemovePrivateOwnedObjectFromChangeSet(java.lang.Object toBeRemoved, java.util.Map visitedObjects)INTERNAL: Cascade remove the private owned object from the owned UnitOfWorkChangeSet
-
performFullValidation
public void performFullValidation()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
performFullValidationin interfaceUnitOfWork
-
performPartialValidation
public void performPartialValidation()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
performPartialValidationin interfaceUnitOfWork
-
populateAndRegisterObject
protected void populateAndRegisterObject(java.lang.Object original, java.lang.Object workingClone, CacheKey unitOfWorkCacheKey, CacheKey parentCacheKey, ClassDescriptor descriptor)INTERNAL: This method is called from clone and register. It includes the processing required to clone an object, including populating attributes, putting in UOW identitymap and building a backupclone
-
postMergeChanges
protected void postMergeChanges(java.util.Set classesChanged)
INTERNAL: Remove objects from parent's identity map.
-
preMergeChanges
protected void preMergeChanges()
INTERNAL: Remove objects deleted during commit from clone and new object cache so that these are not merged
-
printRegisteredObjects
public void printRegisteredObjects()
PUBLIC: Print the objects in the unit of work. The output of this method will be logged to this unit of work's SessionLog at SEVERE level.- Specified by:
printRegisteredObjectsin interfaceUnitOfWork
-
processDeleteObjectQuery
public java.lang.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
-
basicPrintRegisteredObjects
protected void basicPrintRegisteredObjects()
INTERNAL: Print the objects in the unit of work.
-
registerAllObjects
public java.util.Vector registerAllObjects(java.util.Collection domainObjects)
PUBLIC: Register the objects with the unit of work. All newly created root domain objects must be registered to be inserted on commit. Also any existing objects that will be edited and were not read from this unit of work must also be registered. Once registered any changes to the objects will be committed to the database on commit.- Specified by:
registerAllObjectsin interfaceUnitOfWork- 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.
-
registerAllObjects
public java.util.Vector registerAllObjects(java.util.Vector domainObjects) throws DatabaseException, OptimisticLockExceptionPUBLIC: Register the objects with the unit of work. All newly created root domain objects must be registered to be inserted on commit. Also any existing objects that will be edited and were not read from this unit of work must also be registered. Once registered any changes to the objects will be committed to the database on commit.- 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.
- Throws:
DatabaseExceptionOptimisticLockException
-
registerExistingObject
public java.lang.Object registerExistingObject(java.lang.Object existingObject)
ADVANCED: Register the existing object with the unit of work. This is a advanced API that can be used if the application can guarantee the object exists on the database. When registerObject is called the unit of work determines existence through the descriptor's doesExist setting.- Specified by:
registerExistingObjectin interfaceUnitOfWork- 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.
-
registerExistingObject
public java.lang.Object registerExistingObject(java.lang.Object existingObject, boolean isFromSharedCache)ADVANCED: Register the existing object with the unit of work. This is a advanced API that can be used if the application can guarantee the object exists on the database. When registerObject is called the unit of work determines existence through the descriptor's doesExist setting.- 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.
-
registerExistingObject
public java.lang.Object registerExistingObject(java.lang.Object objectToRegister, ClassDescriptor descriptor, java.lang.Object queryPrimaryKey, boolean isFromSharedCache)INTERNAL: Register the existing object with the unit of work. This is a advanced API that can be used if the application can guarantee the object exists on the database. When registerObject is called the unit of work determines existence through the descriptor's doesExist setting.- 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.
-
registerNewContainerBean
public java.lang.Object registerNewContainerBean(java.lang.Object newObject)
INTERNAL: Register the new container bean with the unit of work. Normally the registerObject method should be used for all registration of new and existing objects. This version of the register method can only be used for new container beans.- See Also:
registerObject(Object)
-
registerNewContainerBeanForCMP
public java.lang.Object registerNewContainerBeanForCMP(java.lang.Object newObject)
INTERNAL: Register the new Bean with the unit of work. This will register the new Bean with cloning. Normally the registerObject method should be used for all registration of new and existing objects. This version of the register method can only be used for new objects.
-
registerNewObject
public java.lang.Object registerNewObject(java.lang.Object newObject)
ADVANCED: Register the new object with the unit of work. This will register the new object without cloning. Normally the registerObject method should be used for all registration of new and existing objects. This version of the register method can only be used for new objects. This method should only be used if a new object is desired to be registered without cloning.- Specified by:
registerNewObjectin interfaceUnitOfWork- See Also:
registerObject(Object)
-
registerNewObject
protected java.lang.Object registerNewObject(java.lang.Object implementation, ClassDescriptor descriptor)INTERNAL: Updated to allow passing in of the object's descriptor Register the new object with the unit of work. This will register the new object without cloning. Normally the registerObject method should be used for all registration of new and existing objects. This version of the register method can only be used for new objects. This method should only be used if a new object is desired to be registered without cloning.- See Also:
registerObject(Object)
-
discoverAndPersistUnregisteredNewObjects
public void discoverAndPersistUnregisteredNewObjects(java.lang.Object object, boolean cascadePersist, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, java.util.Set cascadeErrors)INTERNAL: Discover any new objects referenced from registered objects and persist them. This is similar to persist, except that it traverses (all changed or new) objects during the commit to find any unregistered new objects and persists them. Only objects referenced by cascade persist mappings will be persisted, an error will be thrown from non-cascade persist mappings to new objects (detached existing object are ok...in thoery). This is specific to EJB 3.0 support.- Parameters:
newObjects- any new objects found must be added to this collection.cascadePersist- determines if this call is cascading from a cascadePersist mapping or not.
-
registerNewObjectForPersist
public void registerNewObjectForPersist(java.lang.Object newObject, java.util.Map visitedObjects)INTERNAL: Register the new object with the unit of work. This will register the new object without cloning. Checks based on existence will be completed and the create will be cascaded based on the object's mappings cascade requirements. This is specific to EJB 3.0 support.- See Also:
registerObject(Object)
-
wasDeleted
public boolean wasDeleted(java.lang.Object original)
INTERNAL: Return if the object was deleted previously (in a flush).
-
registerNotRegisteredNewObjectForPersist
protected void registerNotRegisteredNewObjectForPersist(java.lang.Object newObject, ClassDescriptor descriptor)INTERNAL: Called only by registerNewObjectForPersist method, and only if newObject is not already registered. Could be overridden in subclasses.
-
registerNewObjectClone
protected void registerNewObjectClone(java.lang.Object clone, java.lang.Object original, ClassDescriptor descriptor)INTERNAL: Register the working copy of a new object and its original. The user must edit the working copy and the original is used to merge into the parent. This mapping is kept both ways because lookup is required in both directions.
-
registerNewObjectInIdentityMap
protected void registerNewObjectInIdentityMap(java.lang.Object clone, java.lang.Object original, ClassDescriptor descriptor)INTERNAL: Add the new object to the cache if set to. This is useful for using mergeclone on new objects.
-
registerObject
public java.lang.Object registerObject(java.lang.Object object)
PUBLIC: Register the object with the unit of work. All newly created root domain objects must be registered to be inserted on commit. Also any existing objects that will be edited and were not read from this unit of work must also be registered. Once registered any changes to the objects will be committed to the database on commit.- Specified by:
registerObjectin interfaceUnitOfWork- 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. **
-
registerObject
protected java.lang.Object registerObject(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Allows for calling method to provide the descriptor information for this object. Prevents double lookup of descriptor. Register the object with the unit of work. All newly created root domain objects must be registered to be inserted on commit. Also any existing objects that will be edited and were not read from this unit of work must also be registered. Once registered any changes to the objects will be committed to the database on commit. calling this method will also sort the objects into different different groups depending on if the object being registered is a bean or a regular Java object and if its updates are deferred, non-deferred or if all modifications are deferred.- Returns:
- the clone of the original object, the return value must be used for editing,
-
registerOriginalNewObjectFromNestedUnitOfWork
public void registerOriginalNewObjectFromNestedUnitOfWork(java.lang.Object originalObject, java.lang.Object backupClone, java.lang.Object newInstance, ClassDescriptor descriptor)INTERNAL: Register a new object from a nested unit of work into its parent.
-
registerWithTransactionIfRequired
public void registerWithTransactionIfRequired()
INTERNAL: Register this UnitOfWork against an external transaction controller
-
release
public void release()
PUBLIC: Release the unit of work. This terminates this unit of work. Because the unit of work operates on its own object space (clones) no work is required. The unit of work should no longer be used or referenced by the application beyond this point so that it can be garbage collected.- Specified by:
releasein interfaceSession- Specified by:
releasein interfaceUnitOfWork- Overrides:
releasein classAbstractSession- See Also:
commit()
-
removeAllReadOnlyClasses
public void removeAllReadOnlyClasses() throws ValidationExceptionPUBLIC: Empties the set of read-only classes. It is illegal to call this method on nested UnitOfWork objects. A nested UnitOfWork cannot have a subset of its parent's set of read-only classes. Also removes classes which are read only because their descriptors are readonly- Specified by:
removeAllReadOnlyClassesin interfaceUnitOfWork- Throws:
ValidationException
-
removeForceUpdateToVersionField
public void removeForceUpdateToVersionField(java.lang.Object lockObject)
ADVANCED: Remove optimistic read lock from the object See forceUpdateToVersionField(Object)- Specified by:
removeForceUpdateToVersionFieldin interfaceUnitOfWork
-
removePrivateOwnedObject
public void removePrivateOwnedObject(DatabaseMapping mapping, java.lang.Object privateOwnedObject)
INTERNAL: Remove a privately owned object from the privateOwnedObjects Map. The UnitOfWork needs to keep track of privately owned objects in order to detect and remove private owned objects which are de-referenced. When an object (which is referenced) is removed from the privateOwnedObjects Map, it is no longer considered for removal from ChangeSets and the UnitOfWork identitymap.
-
removeReadOnlyClass
public void removeReadOnlyClass(java.lang.Class theClass) throws ValidationExceptionPUBLIC: Removes a Class from the receiver's set of read-only classes. It is illegal to try to send this method to a nested UnitOfWork.- Specified by:
removeReadOnlyClassin interfaceUnitOfWork- Throws:
ValidationException
-
revertAndResume
public void revertAndResume()
PUBLIC: Revert all changes made to any registered object. Clear all deleted and new objects. Revert should not be confused with release which it the normal compliment to commit. Revert is more similar to commit and resume, however reverts all changes and resumes. If you do not require to resume the unit of work release should be used instead.- Specified by:
revertAndResumein interfaceUnitOfWork- See Also:
commitAndResume(),release()
-
revertObject
public java.lang.Object revertObject(java.lang.Object clone)
PUBLIC: Revert the object's attributes from the parent. This also reverts the object privately-owned parts.- Specified by:
revertObjectin interfaceUnitOfWork- Returns:
- the object reverted.
- See Also:
shallowRevertObject(Object),deepRevertObject(Object)
-
revertObject
public java.lang.Object revertObject(java.lang.Object clone, int cascadeDepth)INTERNAL: Revert the object's attributes from the parent. This uses merging to merge the object changes.
-
rollbackTransaction
public void rollbackTransaction() throws DatabaseExceptionINTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow. The uow shares its parents transactions.- Overrides:
rollbackTransactionin classAbstractSession- Throws:
DatabaseException- if the database connection is lost or the rollback fails.
-
rollbackTransaction
protected void rollbackTransaction(boolean intendedToCommitTransaction) throws DatabaseExceptionINTERNAL: rollbackTransaction() with a twist for external transactions.writeChanges() is called outside the JTA beforeCompletion(), so the accompanying exception won't propagate up and cause a rollback by itself.
Instead must mark the transaction for rollback only here.
If internally started external transaction or no external transaction can still rollback normally.
- Parameters:
intendedToCommitTransaction- whether we were inside a commit or just trying to write out changes early.- Throws:
DatabaseException
-
scanForConformingInstances
public java.util.Map<java.lang.Object,java.lang.Object> scanForConformingInstances(Expression selectionCriteria, java.lang.Class referenceClass, AbstractRecord arguments, ObjectLevelReadQuery query)
INTERNAL: Scans the UnitOfWork identity map for conforming instances.Later this method can be made recursive to check all parent units of work also.
- Parameters:
selectionCriteria- must be cloned and specially prepared for conforming- Returns:
- Map to facilitate merging with conforming instances returned from a query on the database.
-
setAllClonesCollection
protected void setAllClonesCollection(java.util.Map objects)
INTERNAL: Used to set the collections of all objects in the UnitOfWork.- Parameters:
newUnregisteredExistingObjects- Map
-
setCloneMapping
protected void setCloneMapping(java.util.Map cloneMapping)
INTERNAL: Set the clone mapping. The clone mapping contains clone of all registered objects, this is required to store the original state of the objects when registered so that only what is changed will be committed to the database and the parent, (this is required to support parallel unit of work).
-
setContainerBeans
protected void setContainerBeans(java.util.Map containerBeans)
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.
-
setContainerUnitOfWork
protected void setContainerUnitOfWork(UnitOfWorkImpl containerUnitOfWork)
INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.
-
setDead
public void setDead()
INTERNAL: set UoW lifecycle state variable to DEATH
-
setDeletedObjects
protected void setDeletedObjects(java.util.Map deletedObjects)
INTERNAL: The deleted objects stores any objects removed during the unit of work. On commit they will all be removed from the database.
-
setLifecycle
protected void setLifecycle(int lifecycle)
INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS.
-
setMergeManager
public void setMergeManager(MergeManager mergeManager)
INTERNAL: A reference to the last used merge manager. This is used to track locked objects.
-
setNewObjectsCloneToOriginal
protected void setNewObjectsCloneToOriginal(java.util.Map newObjects)
INTERNAL: The new objects stores any objects newly created during the unit of work. On commit they will all be inserted into the database.
-
setupPrimaryKeyToNewObjects
protected void setupPrimaryKeyToNewObjects()
INTERNAL: Create the map of primary key to new objects to speed up in-memory querying.
-
addNewObjectToPrimaryKeyToNewObjects
protected void addNewObjectToPrimaryKeyToNewObjects(java.lang.Object newObject)
INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects.
-
addNewObjectToPrimaryKeyToNewObjects
protected void addNewObjectToPrimaryKeyToNewObjects(java.lang.Object newObject, ClassDescriptor descriptor)INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects. Allows passing of the ClassDescriptor.
-
removeObjectFromPrimaryKeyToNewObjects
protected void removeObjectFromPrimaryKeyToNewObjects(java.lang.Object object)
INTERNAL: Extracts the primary key and removes an object from primaryKeyToNewObjects.
-
removeObjectFromPrimaryKeyToNewObjects
protected void removeObjectFromPrimaryKeyToNewObjects(java.lang.Object object, java.lang.Object primaryKey)INTERNAL: Removes an object from primaryKeyToNewObjects.
-
setNewObjectsOriginalToClone
protected void setNewObjectsOriginalToClone(java.util.Map newObjects)
INTERNAL: The new objects stores any objects newly created during the unit of work. On commit they will all be inserted into the database.
-
setObjectsDeletedDuringCommit
public void setObjectsDeletedDuringCommit(java.util.Map deletedObjects)
INTERNAL: Set the objects that have been deleted.
-
setParent
public void setParent(AbstractSession parent)
INTERNAL: Set the parent. This is a unit of work if nested, otherwise a database session or client session.
-
setPendingMerge
public void setPendingMerge()
INTERNAL: set UoW lifecycle state variable to PENDING_MERGE
-
setPreDeleteComplete
public void setPreDeleteComplete(boolean preDeleteComplete)
- Parameters:
preDeleteComplete- the preDeleteComplete to set
-
setReadOnlyClasses
public void setReadOnlyClasses(java.util.List<java.lang.Class> classes)
INTERNAL: Gives a new set of read-only classes to the receiver. This set of classes given are checked that subclasses of a read-only class are also in the read-only set provided.
-
setRemovedObjects
protected void setRemovedObjects(java.util.Map removedObjects)
INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work. On commit they will all be removed from the parent unit of work.
-
setResumeUnitOfWorkOnTransactionCompletion
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
-
shouldDiscoverNewObjects
public boolean shouldDiscoverNewObjects()
INTERNAL: Set if this UnitofWork should discover new objects on commit.
-
setShouldDiscoverNewObjects
public void setShouldDiscoverNewObjects(boolean shouldDiscoverNewObjects)
INTERNAL: Set if this UnitofWork should discover new objects on commit.
-
setShouldCascadeCloneToJoinedRelationship
public void setShouldCascadeCloneToJoinedRelationship(boolean shouldCascadeCloneToJoinedRelationship)
INTERNAL: True if the value holder for the joined attribute should be triggered. Required by ejb30 fetch join.
-
shouldForceReadFromDB
public boolean shouldForceReadFromDB(ObjectBuildingQuery query, java.lang.Object primaryKey)
INTERNAL: Calculate whether we should read directly from the database to the UOW. This may be necessary in subclasses of UnitOfWork that have special behavior- See Also:
RepeatableWriteUnitOfWork
-
setShouldNewObjectsBeCached
public void setShouldNewObjectsBeCached(boolean shouldNewObjectsBeCached)
ADVANCED: By default new objects are not cached until the exist on the database. Occasionally if mergeClone is used on new objects and is required to allow multiple merges on the same new object, then if the new objects are not cached, each mergeClone will be interpretted as a different new object. By setting new objects to be cached mergeClone can be performed multiple times before commit. New objects cannot be cached unless they have a valid assigned primary key before being registered. New object with non-null invalid primary keys such as 0 or '' can cause problems and should not be used with this option.- Specified by:
setShouldNewObjectsBeCachedin interfaceUnitOfWork
-
setShouldPerformDeletesFirst
public void setShouldPerformDeletesFirst(boolean shouldPerformDeletesFirst)
ADVANCED: By default deletes are performed last in a unit of work. Sometimes you may want to have the deletes performed before other actions.- Specified by:
setShouldPerformDeletesFirstin interfaceUnitOfWork
-
setShouldThrowConformExceptions
public void setShouldThrowConformExceptions(int shouldThrowExceptions)
ADVANCED: Conforming queries can be set to provide different levels of detail about the exceptions they encounter There are two levels: DO_NOT_THROW_CONFORM_EXCEPTIONS = 0; THROW_ALL_CONFORM_EXCEPTIONS = 1;- Specified by:
setShouldThrowConformExceptionsin interfaceUnitOfWork
-
setSmartMerge
public static void setSmartMerge(boolean option)
INTERNAL: Set smart merge flag. This feature is used in WL to merge dependent values without SessionAccessor
-
setSynchronized
public void setSynchronized(boolean synched)
INTERNAL: Set isSynchronized flag to indicate that this session is a synchronized unit of work.- Overrides:
setSynchronizedin classAbstractSession
-
setUnitOfWorkChangeSet
public void setUnitOfWorkChangeSet(UnitOfWorkChangeSet unitOfWorkChangeSet)
INTERNAL: Sets the current UnitOfWork change set to be the one passed in.
-
setUnregisteredExistingObjects
protected void setUnregisteredExistingObjects(java.util.Map newUnregisteredExistingObjects)
INTERNAL: Used to set the unregistered existing objects vector used when validation has been turned off.- Parameters:
newUnregisteredExistingObjects- Map
-
setUnregisteredNewObjects
protected void setUnregisteredNewObjects(java.util.Map newObjects)
INTERNAL:
-
setUnregisteredNewObjectsInParent
protected void setUnregisteredNewObjectsInParent(java.util.Map newObjects)
INTERNAL:
-
setValidationLevel
public void setValidationLevel(int validationLevel)
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not referred in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
setValidationLevelin interfaceUnitOfWork
-
setWasTransactionBegunPrematurely
public void setWasTransactionBegunPrematurely(boolean wasTransactionBegunPrematurely)
INTERNAL: Set a flag in the root UOW to indicate that a pess. locking or non-selecting SQL query was executed and forced a transaction to be started.
-
shallowMergeClone
public java.lang.Object shallowMergeClone(java.lang.Object rmiClone)
PUBLIC: Merge the attributes of the clone into the unit of work copy. This can be used for objects that are returned from the client through RMI serialization (or other serialization mechanisms), because the RMI object will be a clone this will merge its attributes correctly to preserve object identity within the unit of work and record its changes. Only direct attributes are merged.- Specified by:
shallowMergeClonein interfaceUnitOfWork- Returns:
- the registered version for the clone being merged.
- See Also:
mergeClone(Object),deepMergeClone(Object)
-
shallowRevertObject
public java.lang.Object shallowRevertObject(java.lang.Object clone)
PUBLIC: Revert the object's attributes from the parent. This only reverts the object's direct attributes.- Specified by:
shallowRevertObjectin interfaceUnitOfWork- Returns:
- the object reverted.
- See Also:
revertObject(Object),deepRevertObject(Object)
-
shallowUnregisterObject
public void shallowUnregisterObject(java.lang.Object clone)
ADVANCED: Unregister the object with the unit of work. This can be used to delete an object that was just created and is not yet persistent. Delete object can also be used, but will result in inserting the object and then deleting it. The method will only unregister the clone, none of its parts.- Specified by:
shallowUnregisterObjectin interfaceUnitOfWork
-
shouldCascadeCloneToJoinedRelationship
public boolean shouldCascadeCloneToJoinedRelationship()
INTERNAL: True if the value holder for the joined attribute should be triggered. Required by ejb30 fetch join.
-
shouldNewObjectsBeCached
public boolean shouldNewObjectsBeCached()
ADVANCED: By default new objects are not cached until the exist on the database. Occasionally if mergeClone is used on new objects and is required to allow multiple merges on the same new object, then if the new objects are not cached, each mergeClone will be interpretted as a different new object. By setting new objects to be cached mergeClone can be performed multiple times before commit. New objects cannot be cached unless they have a valid assigned primary key before being registered. New object with non-null invalid primary keys such as 0 or '' can cause problems and should not be used with this option.- Specified by:
shouldNewObjectsBeCachedin interfaceUnitOfWork
-
shouldValidateExistence
public boolean shouldValidateExistence()
Return the default to determine if does-exist should be performed on persist.
-
setShouldValidateExistence
public void setShouldValidateExistence(boolean shouldValidateExistence)
Set the default to determine if does-exist should be performed on persist.
-
shouldPerformDeletesFirst
public boolean shouldPerformDeletesFirst()
ADVANCED: By default all objects are inserted and updated in the database before any object is deleted. If this flag is set to true, deletes will be performed before inserts and updates- Specified by:
shouldPerformDeletesFirstin interfaceUnitOfWork
-
shouldPerformFullValidation
public boolean shouldPerformFullValidation()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not refered in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
shouldPerformFullValidationin interfaceUnitOfWork
-
shouldPerformNoValidation
public boolean shouldPerformNoValidation()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not referred after commit, ensures that objects from the parent cache are not refered in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violated in the unit of work.- Specified by:
shouldPerformNoValidationin interfaceUnitOfWork
-
shouldPerformPartialValidation
public boolean shouldPerformPartialValidation()
ADVANCED: The unit of work performs validations such as, ensuring multiple copies of the same object don't exist in the same unit of work, ensuring deleted objects are not refered after commit, ensures that objects from the parent cache are not refered in the unit of work cache. The level of validation can be increased or decreased for debugging purposes or under advanced situation where the application requires/desires to violate clone identity in the unit of work. It is strongly suggested that clone identity not be violate in the unit of work.- Specified by:
shouldPerformPartialValidationin interfaceUnitOfWork
-
shouldResumeUnitOfWorkOnTransactionCompletion
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
-
shouldStoreBypassCache
public boolean shouldStoreBypassCache()
INTERNAL: This is a JPA setting that is off by default in regular EclipseLink. It's used to avoid updating the shared cache when the cacheStoreMode property is set to BYPASS.
-
storeModifyAllQuery
public void storeModifyAllQuery(DatabaseQuery query)
INTERNAL: Store the ModifyAllQuery's from the UoW in the list. They are always deferred to commit time
-
storeDeferredModifyAllQuery
public void storeDeferredModifyAllQuery(DatabaseQuery query, AbstractRecord translationRow)
INTERNAL: Store the deferred UpdateAllQuery's from the UoW in the list for execution.
-
synchronizeAndResume
public void synchronizeAndResume()
INTERNAL Synchronize the clones and update their backup copies. Called after commit and commit and resume.
-
resumeUnitOfWork
public void resumeUnitOfWork()
INTERNAL: Resume the unit of work state after a flush, or resume operation. This will occur on commitAndResume, JPA commit and JPA flush.
-
undeleteObject
protected void undeleteObject(java.lang.Object object)
INTERNAL: This method is used to transition an object from the deleted objects list to be simply be register.
-
unregisterObject
public void unregisterObject(java.lang.Object clone)
PUBLIC: Unregister the object with the unit of work. This can be used to delete an object that was just created and is not yet persistent. Delete object can also be used, but will result in inserting the object and then deleting it. The method will only unregister the object and its privately owned parts- Specified by:
unregisterObjectin interfaceUnitOfWork
-
unregisterObject
public void unregisterObject(java.lang.Object clone, int cascadeDepth)INTERNAL: Unregister the object with the unit of work. This can be used to delete an object that was just created and is not yet persistent. Delete object can also be used, but will result in inserting the object and then deleting it.
-
unregisterObject
public void unregisterObject(java.lang.Object clone, int cascadeDepth, boolean forDetach)INTERNAL: Unregister the object with the unit of work. This can be used to delete an object that was just created and is not yet persistent. Delete object can also be used, but will result in inserting the object and then deleting it.
-
updateChangeTrackersIfRequired
public void updateChangeTrackersIfRequired(java.lang.Object objectToWrite, ObjectChangeSet changeSetToWrite, UnitOfWorkImpl uow, ClassDescriptor descriptor)INTERNAL: This method is used internally to update the tracked objects if required
-
updateDerivedIds
protected java.lang.Object updateDerivedIds(java.lang.Object clone, ClassDescriptor descriptor)INTERNAL: On persist and flush operations we must update any derived id fields.
-
validateObjectSpace
public void validateObjectSpace()
ADVANCED: This can be used to help debugging an object-space corruption. An object-space corruption is when your application has incorrectly related a clone to an original object. This method will validate that all registered objects are in a correct state and throw an error if not, it will contain the full stack of object references in the error message. If you call this method after each register or change you perform it will pin-point where the error was made.- Specified by:
validateObjectSpacein interfaceUnitOfWork
-
wasTransactionBegunPrematurely
public boolean wasTransactionBegunPrematurely()
INTERNAL: Indicates if a transaction was begun by a pessimistic locking or non-selecting query. Traverse to the root UOW to get value.
-
retryQuery
public java.lang.Object retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)
INTERNAL: A query execution failed due to an invalid query. Re-connect and retry the query.- Overrides:
retryQueryin classAbstractSession
-
writeChanges
public void writeChanges()
ADVANCED: Writes all changes now before commit(). The commit process will begin and all changes will be written out to the datastore, but the datastore transaction will not be committed, nor will changes be merged into the global cache.A subsequent commit (on UnitOfWork or global transaction) will be required to finalize the commit process.
As the commit process has begun any attempt to register objects, or execute object-level queries will generate an exception. Report queries, non-caching queries, and data read/modify queries are allowed.
On exception any global transaction will be rolled back or marked rollback only. No recovery of this UnitOfWork will be possible.
Can only be called once. It can not be used to write out changes in an incremental fashion.
Use to partially commit a transaction outside of a JTA transaction's callbacks. Allows you to get back any exception directly.
Use to commit a UnitOfWork in two stages.
- Specified by:
writeChangesin interfaceUnitOfWork
-
writesCompleted
public void writesCompleted()
INTERNAL: This method notifies the accessor that a particular sets of writes has completed. This notification can be used for such thing as flushing the batch mechanism- Overrides:
writesCompletedin classAbstractSession
-
getBatchQueries
public java.util.Map<ReadQuery,ReadQuery> getBatchQueries()
INTERNAL: When in transaction batch read objects must use query local to the unit of work.
-
setBatchQueries
public void setBatchQueries(java.util.Map<ReadQuery,ReadQuery> batchQueries)
INTERNAL: When in transaction batch read objects must use query local to the unit of work.
-
getPessimisticLockedObjects
public java.util.Map getPessimisticLockedObjects()
INTERNAL:
-
addToChangeTrackedHardList
public void addToChangeTrackedHardList(java.lang.Object obj)
-
addPessimisticLockedClone
public void addPessimisticLockedClone(java.lang.Object clone)
INTERNAL:
-
addPrivateOwnedObject
public void addPrivateOwnedObject(DatabaseMapping mapping, java.lang.Object privateOwnedObject)
INTERNAL: Add a privately owned object to the privateOwnedObjectsMap. The UnitOfWork needs to keep track of privately owned objects in order to detect and remove private owned objects which are de-referenced.
-
isPessimisticLocked
public boolean isPessimisticLocked(java.lang.Object clone)
INTERNAL: Return if the clone has been pessimistic locked in this unit of work.
-
hasPessimisticLockedObjects
public boolean hasPessimisticLockedObjects()
INTERNAL: Return true if there are any pessimistic locked objects in this unit of work, false otherwise.
-
isPreDeleteComplete
public boolean isPreDeleteComplete()
- Returns:
- the preDeleteComplete
-
setWasNonObjectLevelModifyQueryExecuted
public void setWasNonObjectLevelModifyQueryExecuted(boolean wasNonObjectLevelModifyQueryExecuted)
INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed. In absense of transaction the query execution starts one, therefore the flag may only be true in transaction, it's reset on commit or rollback.
-
wasNonObjectLevelModifyQueryExecuted
public boolean wasNonObjectLevelModifyQueryExecuted()
INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed.
-
shouldReadFromDB
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). Note that wasNonObjectLevelModifyQueryExecuted()==true implies inTransaction()==true.
-
releaseReadConnection
public void releaseReadConnection(Accessor connection)
INTERNAL: Release the read connection to the read connection pool.- Overrides:
releaseReadConnectionin classAbstractSession
-
clear
public void clear(boolean shouldClearCache)
INTERNAL: This method will clear all registered objects from this UnitOfWork. If parameter value is 'true' then the cache(s) are cleared, too.
-
clearForClose
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. If the uow is not released, but rather kept around for ValueHolders, then identity maps shouldn't be cleared: the parameter value should be 'false'. The lifecycle set to Birth so that uow ValueHolder still could be used. Alternatively, if called from release method then everything should go and therefore parameter value should be 'true'. In this case lifecycle won't change - uow.release (optionally) calls this method when it (uow) is already dead. The reason for calling this method from release is to free maximum memory right away: the uow might still be referenced by objects using UOWValueHolders (though they shouldn't be around they still might). We defer a clear() call to release() if the uow lifecycle is 1,2 or 4 (*Pending).
-
shouldClearForCloseOnRelease
public boolean shouldClearForCloseOnRelease()
INTERNAL: Indicates whether clearForClose method should be called by release method.
-
createMap
protected java.util.Map createMap()
This method is used internally to create a map to hold the persistenceContexts. A weak map is returned if ReferenceMode is weak.
-
createMap
protected java.util.Map createMap(int size)
This method is used internally to create a map to hold the persistenceContexts. A weak map is returned if ReferenceMode is weak.- Parameters:
size-
-
cloneMap
protected java.util.Map cloneMap(java.util.Map map)
This method is used internally to clone a map that holds the persistenceContexts. A weak map is returned if ReferenceMode is weak.
-
getReferenceMode
public ReferenceMode getReferenceMode()
-
getChangeTrackedHardList
public java.util.Set<java.lang.Object> getChangeTrackedHardList()
INTERNAL: Return the list of object with changes. This is used in weak reference mode to avoid garbage collection of changed objects.
-
getReference
public java.lang.Object getReference(java.lang.Class theClass, java.lang.Object id)Get an instance, whose state may be lazily fetched. If the requested instance does not exist in the database, null is returned, or the object will fail when accessed. The instance will be lazy when it does not exist in the cache, and supports fetch groups.- Specified by:
getReferencein interfaceUnitOfWork- Parameters:
primaryKey- - The primary key of the object, either as a List, singleton, IdClass or an instance of the object.
-
verifyMutexThreadIntegrityBeforeRelease
public boolean verifyMutexThreadIntegrityBeforeRelease()
INTERNAL: 272022: Avoid releasing locks on the wrong server thread. If the current thread and the active thread on the mutex do not match - switch them Before we release acquired locks (do the same as we do for mergeClonesBeforeCompletion()) Check that the current thread is the active thread on all lock managers by checking the cached lockThread on the mergeManager. If we find that these 2 threads are different - then all threads in the acquired locks list are different. Switch the activeThread on the mutex to this current thread for each lock.- Returns:
- true if threads were switched
-
shouldOrderUpdates
public boolean shouldOrderUpdates()
ADVANCED: Return if updates should be ordered by primary key to avoid possible database deadlocks.- Specified by:
shouldOrderUpdatesin interfaceUnitOfWork
-
setShouldOrderUpdates
public void setShouldOrderUpdates(boolean shouldOrderUpdates)
ADVANCED: Set updates should be ordered by primary key to avoid possible database deadlocks.- Specified by:
setShouldOrderUpdatesin interfaceUnitOfWork
-
createCloneQueryValueHolder
public DatabaseValueHolder createCloneQueryValueHolder(ValueHolderInterface attributeValue, java.lang.Object clone, AbstractRecord row, ForeignReferenceMapping mapping)
- Overrides:
createCloneQueryValueHolderin classAbstractSession
-
createCloneTransformationValueHolder
public DatabaseValueHolder createCloneTransformationValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, AbstractTransformationMapping mapping)
- Overrides:
createCloneTransformationValueHolderin classAbstractSession
-
getDeletionDependencies
public java.util.Map<java.lang.Object,java.util.Set<java.lang.Object>> getDeletionDependencies()
INTERNAL: Return deleted objects that have reference to other deleted objects. This is need to delete cycles of objects in the correct order.
-
addDeletionDependency
public void addDeletionDependency(java.lang.Object target, java.lang.Object source)INTERNAL: Record deleted objects that have reference to other deleted objects. This is need to delete cycles of objects in the correct order.
-
getDeletionDependencies
public java.util.Set<java.lang.Object> getDeletionDependencies(java.lang.Object deletedObject)
INTERNAL: Return references to other deleted objects for this deleted object. This is need to delete cycles of objects in the correct order.
-
getCommitOrder
public UnitOfWork.CommitOrderType getCommitOrder()
ADVANCED: Return the commit order.- Specified by:
getCommitOrderin interfaceUnitOfWork
-
setCommitOrder
public void setCommitOrder(UnitOfWork.CommitOrderType order)
ADVANCED: Set the commit order.- Specified by:
setCommitOrderin interfaceUnitOfWork
-
-