Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions

public Class UnitOfWorkImpl

extends AbstractSession
implements UnitOfWork
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.sessions.UnitOfWork, org.eclipse.persistence.sessions.Session, org.eclipse.persistence.core.sessions.CoreSession
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork
Imports
java.io.StringWriter, java.util.ArrayList, .Collection, .Enumeration, .HashMap, .HashSet, .IdentityHashMap, .Iterator, .List, .Map, .Set, .Vector, org.eclipse.persistence.annotations.CacheKeyType, org.eclipse.persistence.config.ReferenceMode, org.eclipse.persistence.descriptors.ClassDescriptor, .DescriptorEvent, .DescriptorEventManager, org.eclipse.persistence.descriptors.changetracking.AttributeChangeTrackingPolicy, .ObjectChangePolicy, org.eclipse.persistence.exceptions.DatabaseException, .DescriptorException, .EclipseLinkException, .OptimisticLockException, .QueryException, .ValidationException, org.eclipse.persistence.expressions.Expression, org.eclipse.persistence.indirection.ValueHolderInterface, org.eclipse.persistence.internal.databaseaccess.Accessor, .DatasourceAccessor, .Platform, org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy, .DescriptorIterator, .DescriptorIterator.CascadeCondition, .ObjectBuilder, .PersistenceEntity, org.eclipse.persistence.internal.helper.ConcurrencyManager, .ConcurrencyUtil, .Helper, .IdentityHashSet, .IdentityWeakHashMap, org.eclipse.persistence.internal.identitymaps.CacheId, .CacheKey, .IdentityMapManager, org.eclipse.persistence.internal.indirection.DatabaseValueHolder, .UnitOfWorkQueryValueHolder, .UnitOfWorkTransformerValueHolder, org.eclipse.persistence.internal.localization.ExceptionLocalization, .LoggingLocalization, org.eclipse.persistence.internal.sequencing.Sequencing, org.eclipse.persistence.logging.AbstractSessionLog, .SessionLog, org.eclipse.persistence.mappings.DatabaseMapping, .ForeignReferenceMapping, org.eclipse.persistence.mappings.foundation.AbstractTransformationMapping, org.eclipse.persistence.platform.server.ServerPlatform, org.eclipse.persistence.queries.Call, .DatabaseQuery, .DeleteObjectQuery, .DoesExistQuery, .InMemoryQueryIndirectionPolicy, .ModifyAllQuery, .ObjectBuildingQuery, .ObjectLevelReadQuery, .ReadObjectQuery, .ReadQuery, org.eclipse.persistence.sessions.DatabaseRecord, .Session, .SessionProfiler, org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand

Implementation of org.eclipse.persistence.sessions.UnitOfWork The public interface should be used.
See Also
<p> <b>Purpose</b>: To allow object level transactions. <p> <b>Description</b>: The unit of work is a session that implements all of the normal protocol of an EclipseLink session. It can be spawned from any other session including another unit of work. Objects can be brought into the unit of work through reading them or through registering them. The unit of work will operate on its own object space, that is the objects within the unit of work will be clones of the original objects. When the unit of work is committed, all changes to any objects registered within the unit of work will be committed to the database. A minimal commit/update will be performed and any foreign keys/circular reference/referential integrity will be resolved. If the commit to the database is successful the changed objects will be merged back into the unit of work parent session. <p> <b>Responsibilities</b>: <ul> <li> Allow parallel transactions against a session's objects. <li> Allow nested transactions. <li> Not require the application to write objects that is changes, automatically determine what has changed. <li> Perform a minimal commit/update of all changes that occurred. <li> Resolve foreign keys for newly created objects and maintain referential integrity. <li> Allow for the object transaction to use its own object space. </ul>

Field Summary

Modifier and TypeField and Description
public static final int
protected Map<Object, Object>
allClones

This member variable contains a copy of all of the clones for this particular UOW

protected Map<ReadQuery, ReadQuery>
batchQueries

When in transaction batch read objects must use query local to the unit of work.

public static final int
protected Set<Object>
cascadeDeleteObjects

Set of objects that were deleted by database cascade delete constraints.

protected Set<Object>
protected int
cloneDepth

Used during the cloning process to track the recursive depth in. This will be used to determine at which point the process can begin to wait on locks without being concerned about creating deadlock situations.

protected Map<Object, Object>
cloneMapping

Map of all the clones.

protected transient Map<Object, Object>
cloneToOriginals

As well as used as lookup in merge algorithm for aggregates and others

protected UnitOfWork.CommitOrderType
commitOrder

Allow updates and deletes to be ordered by id or changes to avoid possible deadlocks.

public static final int
public static final int
protected Map<Object, Object>
protected UnitOfWorkImpl
containerUnitOfWork

This is only used for EJB entity beans to manage beans accessed in a transaction context.

public final long
public final long
public final String
private String
public static final int
protected List<Object[]>
deferredModifyAllQueries

Contains deferred ModifyAllQuery's that have translation row for execution only.

protected Map<Object, Object>
protected Map<DatabaseMapping, List<Object>>
deletedPrivateOwnedObjects

Stores all of the private owned objects that have been removed and may need to cascade deletion

protected Map<Object, Set<Object>>
deletionDependencies

Used to store deleted objects that have reference to other deleted objects.

public static final int
DO_NOT_THROW_CONFORM_EXCEPTIONS

Used for Conforming Queries

public static final int
protected boolean
isNestedUnitOfWork

PERF: Cache isNestedUnitOfWork check.

protected transient MergeManager
lastUsedMergeManager

Used to store the list of locks that this UnitOfWork has acquired for this merge

protected int
lifecycle

With the new synchronized unit of work, need a lifecycle state variable to track birth, committed, pending_merge and death.

public static final String
protected transient MergeManager
mergeManagerForActiveMerge

temporarily holds a reference to a merge manager that is calling this UnitOfWork during merge

public static final int
protected List<ModifyAllQuery>
modifyAllQueries

lazy initialization done in storeModifyAllQuery.

protected Map<Object, Object>
protected Map<Object, Object>
newObjectsCloneToMergeOriginal

Stores a map from the clone to the original merged object, as a different instance is used as the original for merges.

protected Map<Object, Object>
protected Map<Object, Object>
newObjectsInParent

used to store a list of the new objects in the parent

protected Map<Object, Object>
protected Map<Object, Object>
public static final int
protected Map<Object, Object>
protected Map<Object, Object>
optimisticReadLockObjects

Kept reference of read lock objects

protected transient AbstractSession
public static final int
protected Map<Object, Object>
pessimisticLockedObjects

use to track pessimistic locked objects

protected boolean
preDeleteComplete

This attribute records when the preDelete stage of Commit has completed

protected Map<Object, List<Object>>
primaryKeyToNewObjects

Map of primary key to list of new objects.

protected Map<DatabaseMapping, Set<E>>
privateOwnedObjects

Cache references of private owned objects for the removal of private owned orphans

public static final String
ReadLockOnly

Used for read lock to determine update the version field with the same value or increment value

public static final String
protected Set<Class<?>>
readOnlyClasses

Read-only class can be used for reference data to avoid cloning when not required.

protected ReferenceMode
referenceMode

This stored the reference mode for this UOW.

protected Map<Object, Object>
protected boolean
resumeOnTransactionCompletion

True if UnitOfWork should be resumed on completion of transaction.

protected boolean
shouldCascadeCloneToJoinedRelationship

True if the value holder for the joined attribute should be triggered.

protected boolean
shouldDiscoverNewObjects

PERF: Allows discover new objects to be skipped if app always calls persist.

protected boolean
shouldNewObjectsBeCached

Allow for double merges of new objects by putting them into the cache.

protected boolean
shouldPerformDeletesFirst

Flag indicating that deletes should be performed before other updates.

protected int
shouldThrowConformExceptions

Flag indicating how to deal with exceptions on conforming queries.

protected boolean
shouldValidateExistence

Determine if does-exist should be performed on persist.

protected static boolean
SmartMerge

Used for merging dependent values without use of WL SessionAccessor

public static final int
protected Object
transaction

PERF: Stores the JTA transaction to optimize activeUnitOfWork lookup.

protected UnitOfWorkChangeSet
unitOfWorkChangeSet

This method is used to store the current changeSet for this UnitOfWork.

protected Map<Object, Object>
unregisteredDeletedObjectsCloneToBackupAndOriginal

Used to store objects already deleted from the db and unregistered

protected Map<Object, Object>
protected Map<Object, Object>
protected Map<Object, Object>
protected int
validationLevel

The amount of validation can be configured.

protected boolean
wasNonObjectLevelModifyQueryExecuted

True if either DataModifyQuery or ModifyAllQuery was executed.

protected boolean
wasTransactionBegunPrematurely

Flag indicating that the transaction for this UOW was already begun.

public static final int
Inherited from org.eclipse.persistence.internal.sessions.AbstractSession:
accessorsactiveCommandThreadsattributeGroupsbrokercommandManagercommitManagerdefaultReferenceModedeferredEventsdescriptorseventManagerexceptionHandlerexternalTransactionControlleridentityMapAccessorinjectionManagerintegrityCheckerisConcurrentisExecutingEventsisFinalizersEnabledisInBrokerisInProfileisLoggingOffisSynchronizedjpaQueriesProcessedlastDescriptorAccessedlogSessionStringmetadatalistenermultitenantContextPropertiesnamenumberOfActiveUnitsOfWorkobjectsLockedForClonepartitioningPolicypessimisticLockTimeoutDefaultpessimisticLockTimeoutUnitDefaultplatformprofilerprojectpropertiesqueriesqueryBuilderqueryTimeoutDefaultqueryTimeoutUnitDefaultserializersessionLogshouldCheckWriteLockshouldOptimizeResultSetAccessshouldPropagateChangesstaticMetamodelClassestablePerTenantDescriptorstablePerTenantQueriestolerateInvalidJPQLtransactionMutexwasJTSTransactionInternallyStarted

Constructor Summary

AccessConstructor and Description
public
UnitOfWorkImpl()

INTERNAL:

public
UnitOfWorkImpl(AbstractSession parent, ReferenceMode referenceMode)

INTERNAL: Create and return a new unit of work with the session as its parent.

Method Summary

Modifier and TypeMethod and Description
public Session
acquireHistoricalSession(AsOfClause
Represents a valid snap shot time.
clause
)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.acquireHistoricalSession.

Implements org.eclipse.persistence.sessions.Session.acquireHistoricalSession.

INTERNAL: Acquires a special historical session for reading objects as of a past time.
public UnitOfWorkImpl
protected void
acquireWriteLocks()

INTERNAL: Acquire the unit of work cache write locks, if required.

public void
addDeletedPrivateOwnedObjects(DatabaseMapping mapping, Object object)

INTERNAL: Records a private owned object that has been de-referenced and will need to processed for related private owned objects.

public void
addDeletionDependency(Object target, Object source)

INTERNAL: Record deleted objects that have reference to other deleted objects.

public void
addNewAggregate(Object originalObject)

INTERNAL: Register a new aggregate object with the unit of work.

protected void
addNewObjectToPrimaryKeyToNewObjects(Object newObject)

INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects.

protected void
addNewObjectToPrimaryKeyToNewObjects(Object newObject, ClassDescriptor descriptor)

INTERNAL: Extracts the primary key from a new object and puts it in primaryKeyToNewObjects.

public void
addObjectDeletedDuringCommit(Object object, ClassDescriptor descriptor)

INTERNAL: Add object deleted during root commit of unit of work.

public void
public void
addPrivateOwnedObject(DatabaseMapping mapping, Object privateOwnedObject)

INTERNAL: Add a privately owned object to the privateOwnedObjectsMap.

public void
addReadOnlyClass(Class<?> theClass)

Implements org.eclipse.persistence.sessions.UnitOfWork.addReadOnlyClass.

PUBLIC: Adds the given Java class to the receiver's set of read-only classes.
public void
addReadOnlyClasses(Collection<E> classes)

Implements org.eclipse.persistence.sessions.UnitOfWork.addReadOnlyClasses.

PUBLIC: Adds the classes in the given Vector to the existing set of read-only classes.
public void
addRemovedObject(Object orignal)

INTERNAL: Register that an object was removed in a nested unit of work.

public void
public void
afterExternalTransactionRollback()

INTERNAL: Called after external transaction rolled back.

public void
assignSequenceNumber(Object object)

Implements org.eclipse.persistence.sessions.UnitOfWork.assignSequenceNumber.

ADVANCED: Assign sequence number to the object.
public Object
assignSequenceNumber(Object object, ClassDescriptor descriptor)

INTERNAL: Assign sequence number to the object.

public void
assignSequenceNumbers()

Implements org.eclipse.persistence.sessions.UnitOfWork.assignSequenceNumbers.

ADVANCED: Assign sequence numbers to all new objects registered in this unit of work, or any new objects reference by any objects registered.
protected void
assignSequenceNumbers(Map<K, V> objects)

INTERNAL: Assign sequence numbers to all of the objects.

protected void
basicPrintRegisteredObjects()

INTERNAL: Print the objects in the unit of work.

public void
beginEarlyTransaction()

Implements org.eclipse.persistence.sessions.UnitOfWork.beginEarlyTransaction.

PUBLIC: Tell the unit of work to begin a transaction now.
public void
beginTransaction()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.beginTransaction.

INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow.
public Object
buildOriginal(Object workingClone)

INTERNAL: Unregistered new objects have no original so we must create one for commit and resume and to put into the parent.

public UnitOfWorkChangeSet
calculateChanges(Map<K, V> registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)

INTERNAL:

This calculates changes in two passes, first on registered objects, second it discovers unregistered new objects on only those objects that changed, and calculates their changes.

protected boolean

Returns:

true or false depending on whether the read-only set can be changed or not.
canChangeReadOnlySet
()

INTERNAL: Checks whether the receiver has been used.

public Object
checkExistence(Object object)

INTERNAL: Register the object and return the clone if it is existing otherwise return null if it is new.

public boolean
checkForUnregisteredExistingObject(Object object)

INTERNAL: Return if the object is an existing object (but has not been registered), or a new object (that has not be persisted).

public Object
checkIfAlreadyRegistered(Object object, ClassDescriptor descriptor)

INTERNAL: Return the value of the object if it already is registered, otherwise null.

public void
clear(boolean shouldClearCache)

INTERNAL: This method will clear all registered objects from this UnitOfWork.

public void
clearForClose(boolean shouldClearCache)

INTERNAL: Call this method if the uow will no longer be used for committing transactions: all the change sets will be dereferenced, and (optionally) the cache cleared.

private void
clearIdentityMapCache()

INTERNAL: Clear the identityMaps

protected Object
cloneAndRegisterNewObject(Object original, boolean isShallowClone)

ADVANCED: Register the new object with the unit of work.

public Object
cloneAndRegisterObject(Object original, CacheKey parentCacheKey, ClassDescriptor descriptor)

INTERNAL: Clone and register the object.

public Object
cloneAndRegisterObject(Object original, CacheKey parentCacheKey, CacheKey unitOfWorkCacheKey, ClassDescriptor descriptor)

INTERNAL: Clone and register the object.

protected Map<K, V>
cloneMap(Map<K, V> map)

This method is used internally to clone a map that holds the persistenceContexts.

public Map<K, V>
collectAndPrepareObjectsForNestedMerge()

INTERNAL: Prepare for merge in nested uow.

public void
commit()

Implements org.eclipse.persistence.sessions.UnitOfWork.commit.

PUBLIC: Commit the unit of work to its parent.
protected void
commitAfterWriteChanges()

INTERNAL: Commits a UnitOfWork where the commit process has already been initiated by all call to writeChanges().

public void
commitAndResume()

Implements org.eclipse.persistence.sessions.UnitOfWork.commitAndResume.

PUBLIC: Commit the unit of work to its parent.
protected void
commitAndResumeAfterWriteChanges()

INTERNAL: Commits and resumes a UnitOfWork where the commit process has already been initiated by all call to writeChanges().

public void
commitAndResumeOnFailure()

Implements org.eclipse.persistence.sessions.UnitOfWork.commitAndResumeOnFailure.

PUBLIC: Commit the unit of work to its parent.
public void
commitAndResumeWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet)

INTERNAL: This method is used by the MappingWorkbench for their read-only file feature this method must not be exposed to or used by customers until it has been revised and the feature revisited to support OptimisticLocking and Serialization

protected boolean
commitInternallyStartedExternalTransaction()

PROTECTED: Used in commit and commit-like methods to commit internally started external transaction

protected void
commitNestedUnitOfWork()

INTERNAL: Commit the changes to any objects to the parent.

public void
commitRootUnitOfWork()

INTERNAL: Commit the changes to any objects to the parent.

public void
commitRootUnitOfWorkWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet)

INTERNAL: This method is used by the MappingWorkbench read-only files feature It will commit a pre-built unitofwork change set to the database

protected void
commitToDatabase(boolean
false if called by writeChanges as intent is not to finalize the transaction.
commitTransaction
)

INTERNAL: CommitChanges To The Database from a calculated changeSet

protected void
commitToDatabaseWithChangeSet(boolean
false if called by writeChanges as intent is not to finalize the transaction.
commitTransaction
)

INTERNAL: Commit the changes to any objects to the parent.

protected void
commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkChangeSet uowChangeSet, boolean commitTransaction, boolean isChangeSetFromOutsideUOW)

INTERNAL: Commit pre-built changeSet to the database changeSet to the database.

public void
commitTransaction()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.commitTransaction.

INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow.
public void
commitTransactionAfterWriteChanges()

INTERNAL: After writeChanges() everything has been done except for committing the transaction.

public Vector<E>
copyReadOnlyClasses()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.copyReadOnlyClasses.

INTERNAL: Copy the read only classes from the unit of work.
private void
copyStatementsCountIntoProperties()

INTERNAL: Copy statements counts into UOW properties.

public <T> DatabaseValueHolder<T>
public <T> DatabaseValueHolder<T>
protected Map<K, V>
createMap()

This method is used internally to create a map to hold the persistenceContexts.

protected Map<K, V>
createMap(int size)

This method is used internally to create a map to hold the persistenceContexts.

public Object

Returns:

the registered version for the clone being merged.
deepMergeClone
(Object rmiClone)

Implements org.eclipse.persistence.sessions.UnitOfWork.deepMergeClone.

PUBLIC: Merge the attributes of the clone into the unit of work copy.
public Object

Returns:

the object reverted.
deepRevertObject
(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.deepRevertObject.

PUBLIC: Revert the object's attributes from the parent.
public void
deepUnregisterObject(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.deepUnregisterObject.

ADVANCED: Unregister the object with the unit of work.
protected void
discoverAllUnregisteredNewObjects()

INTERNAL: Search for any objects in the parent that have not been registered.

protected void
discoverAllUnregisteredNewObjectsInParent()

INTERNAL: Search for any objects in the parent that have not been registered.

public void
discoverAndPersistUnregisteredNewObjects(Object object, boolean
determines if this call is cascading from a cascadePersist mapping or not.
cascadePersist
,
Map<K, V>
any new objects found must be added to this collection.
newObjects
,
Map<K, V> unregisteredExistingObjects, Map<K, V> visitedObjects, Set<E> cascadeErrors)

INTERNAL: Discover any new objects referenced from registered objects and persist them.

public void
discoverUnregisteredNewObjects(Map<K, V> clones, final Map<K, V> knownNewObjects, final Map<K, V> unregisteredExistingObjects, Map<K, V> visitedObjects)

INTERNAL: Traverse the object to find references to objects not registered in this unit of work.

public void
dontPerformValidation()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public Object
executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.executeCall.

INTERNAL: Override From session.
public void
forceUpdateToVersionField(Object lockObject, boolean shouldModifyVersionField)

Implements org.eclipse.persistence.sessions.UnitOfWork.forceUpdateToVersionField.

ADVANCED: Set optimistic read lock on the object.
public Accessor
getAccessor()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getAccessor.

INTERNAL: The uow does not store a local accessor but shares its parents.
public Collection<Accessor>
getAccessors()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getAccessors.

INTERNAL: The uow does not store a local accessor but shares its parents.
public Collection<Accessor>
getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getAccessors.

INTERNAL: Return the connections to use for the query execution.
public UnitOfWork
getActiveUnitOfWork()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getActiveUnitOfWork.

Implements org.eclipse.persistence.sessions.Session.getActiveUnitOfWork.

PUBLIC: Return the active unit of work for the current active external (JTS) transaction.
public Vector<E>
getAllFromNewObjects(Expression selectionCriteria, Class<?> theClass, AbstractRecord translationRow, int valueHolderPolicy)

INTERNAL: Return any new objects matching the expression.

public Object
getBackupClone(Object clone)

INTERNAL: Return the backup clone for the working clone.

public Object
getBackupClone(Object clone, ClassDescriptor descriptor)

INTERNAL: Return the backup clone for the working clone.

public Object
getBackupCloneForCommit(Object clone, ClassDescriptor descriptor)

INTERNAL: Return the backup clone for the working clone.

public Object
getBackupCloneForCommit(Object clone)

INTERNAL: Return the backup clone for the working clone.

public Map<ReadQuery, ReadQuery>
getBatchQueries()

INTERNAL: When in transaction batch read objects must use query local to the unit of work.

public Set<Object>
getCascadeDeleteObjects()

INTERNAL: Return any objects have been deleted through database cascade delete constraints.

public Set<Object>
getChangeTrackedHardList()

INTERNAL: Return the list of object with changes.

public Map<K, V>
getCloneMapping()

INTERNAL: Return the clone mapping.

public Map<K, V>
getCloneToOriginals()

INTERNAL: Map used to avoid garbage collection in weak caches.

public CommitManager
getCommitManager()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getCommitManager.

INTERNAL: The commit manager is used to resolve referential integrity on commits of multiple objects.
public UnitOfWork.CommitOrderType
getCommitOrder()

Implements org.eclipse.persistence.sessions.UnitOfWork.getCommitOrder.

ADVANCED: Return the commit order.
public Map<K, V>
getContainerBeans()

INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.

public UnitOfWorkImpl
getContainerUnitOfWork()

INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.

public UnitOfWorkChangeSet
getCurrentChanges()

Implements org.eclipse.persistence.sessions.UnitOfWork.getCurrentChanges.

ADVANCED: This method Will Calculate the changes for the UnitOfWork.
public Vector<E>
getDefaultReadOnlyClasses()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getDefaultReadOnlyClasses.

INTERNAL: Returns the set of read-only classes that gets assigned to each newly created UnitOfWork.
public Map<K, V>
getDeletedObjects()

INTERNAL: The deleted objects stores any objects removed during the unit of work.

public Map<Object, Set<Object>>
getDeletionDependencies()

INTERNAL: Return deleted objects that have reference to other deleted objects.

public Set<Object>
getDeletionDependencies(Object deletedObject)

INTERNAL: Return references to other deleted objects for this deleted object.

public AbstractSession

Returns:

a session with a live accessor
getExecutionSession
(DatabaseQuery
may store session name or reference class for brokers case
query
)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getExecutionSession.

INTERNAL: Gets the session which this query will be executed on.
public int
getLifecycle()

INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS.

public MergeManager
getMergeManager()

A reference to the last used merge manager.

public Map<K, V>
getNewAggregates()

INTERNAL: The map stores any new aggregates that have been cloned.

public Map<K, V>
getNewObjectsCloneToMergeOriginal()

INTERNAL: The stores a map from new object clones to the original object used from merge.

public Map<K, V>
getNewObjectsCloneToOriginal()

INTERNAL: The new objects stores any objects newly created during the unit of work.

public Map<K, V>
getNewObjectsInParentOriginalToClone()

INTERNAL: The returns the list that will hold the new objects from the Parent UnitOfWork

public Map<K, V>
getNewObjectsOriginalToClone()

INTERNAL: The new objects stores any objects newly created during the unit of work.

public Object
getObjectFromNewObjects(Class<?> theClass, Object selectionKey)

INTERNAL: Return any new object matching the expression.

public Object
getObjectFromNewObjects(Expression selectionCriteria, Class<?> theClass, AbstractRecord translationRow, int valueHolderPolicy)

INTERNAL: Return any new object matching the expression.

public Map<K, V>
getObjectsDeletedDuringCommit()

INTERNAL: Returns all the objects which are deleted during root commit of unit of work.

public Map<K, V>
getOptimisticReadLockObjects()

INTERNAL: Return optimistic read lock objects

public Object
getOriginalVersionOfNewObject(Object workingClone)

INTERNAL: Return the original version of the new object (working clone).

public Object
getOriginalVersionOfObject(Object workingClone)

Implements org.eclipse.persistence.sessions.UnitOfWork.getOriginalVersionOfObject.

ADVANCED: Return the original version of the object(clone) from the parent's identity map.
public Object
getOriginalVersionOfObjectOrNull(Object workingClone, ObjectChangeSet changeSet, ClassDescriptor descriptor, AbstractSession targetSession)

INTERNAL: Return the original version of the object(clone) from the parent's identity map.

public Object
getOriginalVersionOfObjectOrNull(Object workingClone, ClassDescriptor descriptor)

INTERNAL: Return the original version of the object(clone) from the parent's identity map.

public AbstractSession
public AbstractSession

Returns:

Session with the required IdentityMap
getParentIdentityMapSession
(ClassDescriptor descriptor, boolean
true when method calls itself. If the path starting at this is acceptable. Sometimes true if want to move to the first valid session, i.e. executing on ClientSession when really should be on ServerSession.
canReturnSelf
,
boolean
return the last session in the chain where the Enitity is stored.
terminalOnly
)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getParentIdentityMapSession.

INTERNAL: Returns the appropriate IdentityMap session for this descriptor.
public Map<K, V>
public Platform
getPlatform(Class<?> domainClass)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getPlatform.

INTERNAL: Return the platform for a particular class.
public Map<Object, List<Object>>
getPrimaryKeyToNewObjects()

INTERNAL: The primaryKeyToNewObjects stores a list of objects for every primary key.

private Map<DatabaseMapping, Set<E>>
getPrivateOwnedObjects()

INTERNAL: Return the privateOwnedRelationships attribute.

public Object
getProperty(String name)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getProperty.

Implements org.eclipse.persistence.sessions.Session.getProperty.

INTERNAL: Search for and return the user defined property from this UOW, if it not found then search for the property from parent.
public DatabaseQuery
getQuery(String name, Vector<E> arguments)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getQuery.

PUBLIC: Return the query from the session pre-defined queries with the given name.
public DatabaseQuery
getQuery(String name)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getQuery.

Implements org.eclipse.persistence.sessions.Session.getQuery.

PUBLIC: Return the query from the session pre-defined queries with the given name.
public Set<E>
getReadOnlyClasses()

Implements org.eclipse.persistence.sessions.UnitOfWork.getReadOnlyClasses.

ADVANCED: Returns the set of read-only classes in this UnitOfWork.
public Object
getReference(Class<?> theClass, Object
The primary key of the object, either as a List, singleton, IdClass or an instance of the object.
id
)

Implements org.eclipse.persistence.sessions.UnitOfWork.getReference.

Get an instance, whose state may be lazily fetched.
public ReferenceMode
protected Map<K, V>
getRemovedObjects()

INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work.

public Sequencing
getSequencing()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getSequencing.

INTERNAL: Return the Sequencing object used by the session.
public ServerPlatform
getServerPlatform()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.getServerPlatform.

Implements org.eclipse.persistence.sessions.Session.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)
public String
public int
getShouldThrowConformExceptions()

INTERNAL: Return whether to throw exceptions on conforming queries

public int
getState()

INTERNAL: Find out what the lifecycle state of this UoW is in.

public Object
getTransaction()

INTERNAL: PERF: Return the associated external transaction.

public UnitOfWorkChangeSet
getUnitOfWorkChangeSet()

Implements org.eclipse.persistence.sessions.UnitOfWork.getUnitOfWorkChangeSet.

ADVANCED: Returns the currentChangeSet from the UnitOfWork.
public Map<K, V>

Returns:

Map
getUnregisteredExistingObjects
()

INTERNAL: Used to lazy Initialize the unregistered existing Objects collection.

protected Map<K, V>
getUnregisteredNewObjects()

INTERNAL: This is used to store unregistered objects discovered in the parent so that the child unit of work knows not to register them on commit.

protected Map<K, V>
getUnregisteredNewObjectsInParent()

INTERNAL: This is used to store unregistered objects discovered in the parent so that the child unit of work knows not to register them on commit.

public int
getValidationLevel()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public boolean
hasCascadeDeleteObjects()

INTERNAL: Return if any objects have been deleted through database cascade delete constraints.

public boolean
hasChanges()

Implements org.eclipse.persistence.sessions.UnitOfWork.hasChanges.

ADVANCED: The Unit of work is capable of preprocessing to determine if any on the clone have been changed.
public boolean
hasCloneMapping()

INTERNAL: Return if the unit of work has any clones.

protected boolean
public boolean
hasContainerBeans()

INTERNAL: Return if any container beans exist.

protected boolean
public boolean
hasDeletedObjects()

INTERNAL: The deleted objects stores any objects removed during the unit of work.

protected boolean
hasModifications()

INTERNAL: Does this unit of work have any changes or anything that requires a write to the database and a transaction to be started.

protected boolean
public boolean
hasNewObjects()

INTERNAL: Return if there are any registered new objects.

protected boolean
protected boolean
public boolean
hasOptimisticReadLockObjects()

INTERNAL: Return if there are any optimistic read locks.

public boolean
hasPessimisticLockedObjects()

INTERNAL: Return true if there are any pessimistic locked objects in this unit of work, false otherwise.

public boolean
hasPrivateOwnedObjects()

INTERNAL: Return true if privateOwnedObjects is not null and not empty, false otherwise.

protected boolean
public boolean
hasUnregisteredNewObjects()

INTERNAL: Return if there are any unregistered new objects.

public void
public Object
internalExecuteQuery(DatabaseQuery query, AbstractRecord databaseRow)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery.

INTERNAL: Return the results from executing the database query.
public Object
internalRegisterObject(Object object, ClassDescriptor descriptor, boolean isShallowClone)

INTERNAL: Register the object with the unit of work.

public boolean
isActive()

Implements org.eclipse.persistence.sessions.UnitOfWork.isActive.

PUBLIC: Return if the unit of work is active.
public boolean
isAfterWriteChangesButBeforeCommit()

INTERNAL: Has writeChanges() been attempted on this UnitOfWork?

protected boolean
isAfterWriteChangesFailed()

INTERNAL: Once writeChanges has failed all a user can do really is rollback.

public boolean

Returns:

boolean, true if the class is read-only, false otherwise.
isClassReadOnly
(Class<?> theClass, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.isClassReadOnly.

INTERNAL: Checks to see if the specified class or descriptor is read-only or not in this UnitOfWork.
public boolean
isCloneNewObject(Object clone)

INTERNAL: Check if the object is already registered.

public boolean
isCloneNewObjectFromParent(Object clone)

INTERNAL: Check if the object is already registered in a parent Unit Of Work

public boolean
isCommitPending()

INTERNAL: Return if the unit of work is waiting to be committed or in the process of being committed.

public boolean
isConsideredInvalid(Object object, CacheKey cacheKey, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.isConsideredInvalid.

INTERNAL: Check if the object is invalid and *should* be refreshed.
public boolean
isDead()

INTERNAL: Return if the unit of work is dead.

public boolean
isInTransaction()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.isInTransaction.

PUBLIC: Return whether the session currently has a database transaction in progress.
public boolean
isMergePending()

INTERNAL: Return if the unit of work is waiting to be merged or in the process of being merged.

public boolean
isNestedUnitOfWork()

Implements org.eclipse.persistence.sessions.UnitOfWork.isNestedUnitOfWork.

PUBLIC: Return whether this session is a nested unit of work or not.
public boolean
isNewObjectInParent(Object clone)

INTERNAL: This method determines if the specified clone is new in the parent UnitOfWork

public boolean
isObjectDeleted(Object object)

INTERNAL: Return if the object has been deleted in this unit of work.

public boolean
isObjectNew(Object clone)

INTERNAL: This method is used to determine if the clone is a new Object in the UnitOfWork

public boolean
isObjectRegistered(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.isObjectRegistered.

ADVANCED: Return whether the clone object is already registered.
public boolean
isOriginalNewObject(Object original)

INTERNAL: Return whether the original object is new.

public boolean
isPessimisticLocked(Object clone)

INTERNAL: Return if the clone has been pessimistic locked in this unit of work.

public boolean

Returns:

the preDeleteComplete
isPreDeleteComplete
()

public static boolean
isSmartMerge()

INTERNAL: Return the status of smart merge

protected void
issueModifyAllQueryList()

INTERNAL: Will notify all the deferred ModifyAllQuery's (excluding UpdateAllQuery's) and deferred UpdateAllQuery's to execute.

public void
issueSQLbeforeCompletion()

INTERNAL: For synchronized units of work, dump SQL to database.

public void
issueSQLbeforeCompletion(boolean commitTransaction)

INTERNAL: For synchronized units of work, dump SQL to database.

public boolean
public boolean
isUnregisteredExistingObject(Object object)

INTERNAL: Return if the object is a known unregistered existing object.

public boolean
isUnregisteredNewObjectInParent(Object originalObject)

INTERNAL: Return if the object was existing but not registered in the parent of the nested unit of work.

private void
logDebugMessage(Object object, String debugMessage)

log the message and debug info if option is set.

protected void
mergeBmpAndWsEntities()

INTERNAL: BMP and Websphere CMP entities have to be merged if they are registered in the unit of work.

protected void
mergeChangesIntoParent()

INTERNAL: Merge the changes to all objects to the parent.

public Object

Returns:

the registered version for the clone being merged.
mergeClone
(Object rmiClone)

Implements org.eclipse.persistence.sessions.UnitOfWork.mergeClone.

PUBLIC: Merge the attributes of the clone into the unit of work copy.
public Object
mergeClone(Object rmiClone, int cascadeDepth, boolean forRefresh)

INTERNAL: Merge the attributes of the clone into the unit of work copy.

public void
mergeClonesAfterCompletion()

INTERNAL: for synchronized units of work, merge changes into parent

public Object

Returns:

the registered version for the clone being merged.
mergeCloneWithReferences
(Object rmiClone)

Implements org.eclipse.persistence.sessions.UnitOfWork.mergeCloneWithReferences.

PUBLIC: Merge the attributes of the clone into the unit of work copy.
public Object

Returns:

the registered version for the clone being merged.
mergeCloneWithReferences
(Object rmiClone, int cascadePolicy)

PUBLIC: Merge the attributes of the clone into the unit of work copy.

public Object

Returns:

the registered version for the clone being merged.
mergeCloneWithReferences
(Object rmiClone, int cascadePolicy, boolean forceCascade)

INTERNAL: Merge the attributes of the clone into the unit of work copy.

public Object

Returns:

the registered version for the clone being merged.
mergeCloneWithReferences
(Object rmiClone, MergeManager manager)

INTERNAL: Merge the attributes of the clone into the unit of work copy.

public Object
newInstance(Class<?> theClass)

Implements org.eclipse.persistence.sessions.UnitOfWork.newInstance.

PUBLIC: Return a new instance of the class registered in this unit of work.
public void
performFullValidation()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public void
performPartialValidation()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public void
performRemove(Object toBeDeleted, Map<K, V> visitedObjects)

INTERNAL: This method will perform a delete operation on the provided objects pre-determining the objects that will be deleted by a commit of the UnitOfWork including privately owned objects.

public void
performRemovePrivateOwnedObjectFromChangeSet(Object toBeRemoved, Map<K, V> visitedObjects)

INTERNAL: Cascade remove the private owned object from the owned UnitOfWorkChangeSet

protected void
populateAndRegisterObject(Object original, Object workingClone, CacheKey unitOfWorkCacheKey, CacheKey parentCacheKey, ClassDescriptor descriptor)

INTERNAL: This method is called from clone and register.

protected void
postMergeChanges(Set<E> classesChanged)

INTERNAL: Remove objects from parent's identity map.

protected void
preMergeChanges()

INTERNAL: Remove objects deleted during commit from clone and new object cache so that these are not merged

public void
printRegisteredObjects()

Implements org.eclipse.persistence.sessions.UnitOfWork.printRegisteredObjects.

PUBLIC: Print the objects in the unit of work.
public Object
processDeleteObjectQuery(DeleteObjectQuery deleteQuery)

INTERNAL: This method is used to process delete queries that pass through the unitOfWork It is extracted out of the internalExecuteQuery method to reduce duplication

public Vector<E>

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
(Collection<E> domainObjects)

Implements org.eclipse.persistence.sessions.UnitOfWork.registerAllObjects.

PUBLIC: Register the objects with the unit of work.
public Vector<E>

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
(Vector<E> domainObjects)

PUBLIC: Register the objects with the unit of work.

public Object

Returns:

The clone of the original object, the return value must be used for editing. Editing the original is not allowed in the unit of work.
registerExistingObject
(Object existingObject)

Implements org.eclipse.persistence.sessions.UnitOfWork.registerExistingObject.

ADVANCED: Register the existing object with the unit of work.
public Object

Returns:

The clone of the original object, the return value must be used for editing. Editing the original is not allowed in the unit of work.
registerExistingObject
(Object existingObject, boolean isFromSharedCache)

ADVANCED: Register the existing object with the unit of work.

public Object

Returns:

The clone of the original object, the return value must be used for editing. Editing the original is not allowed in the unit of work.
registerExistingObject
(Object objectToRegister, ClassDescriptor descriptor, Object queryPrimaryKey, boolean isFromSharedCache)

INTERNAL: Register the existing object with the unit of work.

public Object
registerNewContainerBean(Object newObject)

INTERNAL: Register the new container bean with the unit of work.

public Object
registerNewContainerBeanForCMP(Object newObject)

INTERNAL: Register the new Bean with the unit of work.

public Object
registerNewObject(Object newObject)

Implements org.eclipse.persistence.sessions.UnitOfWork.registerNewObject.

ADVANCED: Register the new object with the unit of work.
protected Object
registerNewObject(Object implementation, ClassDescriptor descriptor)

INTERNAL: Updated to allow passing in of the object's descriptor Register the new object with the unit of work.

protected void
registerNewObjectClone(Object clone, Object original, ClassDescriptor descriptor)

INTERNAL: Register the working copy of a new object and its original.

public void
registerNewObjectForPersist(Object newObject, Map<K, V> visitedObjects)

INTERNAL: Register the new object with the unit of work.

protected void
registerNewObjectInIdentityMap(Object clone, Object original, ClassDescriptor descriptor)

INTERNAL: Add the new object to the cache if set to.

protected void
registerNotRegisteredNewObjectForPersist(Object newObject, ClassDescriptor descriptor)

INTERNAL: Called only by registerNewObjectForPersist method, and only if newObject is not already registered.

public Object

Returns:

the clone of the original object, the return value must be used for editing, ** Editing the original is not allowed in the unit of work. **
registerObject
(Object object)

Implements org.eclipse.persistence.sessions.UnitOfWork.registerObject.

PUBLIC: Register the object with the unit of work.
protected Object

Returns:

the clone of the original object, the return value must be used for editing,
registerObject
(Object object, ClassDescriptor descriptor)

INTERNAL: Allows for calling method to provide the descriptor information for this object.

public void
registerOriginalNewObjectFromNestedUnitOfWork(Object originalObject, Object backupClone, Object newInstance, ClassDescriptor descriptor)

INTERNAL: Register a new object from a nested unit of work into its parent.

public void
registerWithTransactionIfRequired()

INTERNAL: Register this UnitOfWork against an external transaction controller

public void
public void
releaseJTSConnection()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.releaseJTSConnection.

INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener.
public void
releaseReadConnection(Accessor connection)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.releaseReadConnection.

INTERNAL: Release the read connection to the read connection pool.
public void
releaseWriteLocks()

INTERNAL: Release the unit of work cache write locks, if acquired.

public void
public void
removeForceUpdateToVersionField(Object lockObject)

Implements org.eclipse.persistence.sessions.UnitOfWork.removeForceUpdateToVersionField.

ADVANCED: Remove optimistic read lock from the object See forceUpdateToVersionField(Object)
protected void
removeObjectFromPrimaryKeyToNewObjects(Object object)

INTERNAL: Extracts the primary key and removes an object from primaryKeyToNewObjects.

protected void
removeObjectFromPrimaryKeyToNewObjects(Object object, Object primaryKey)

INTERNAL: Removes an object from primaryKeyToNewObjects.

public void
removePrivateOwnedObject(DatabaseMapping mapping, Object privateOwnedObject)

INTERNAL: Remove a privately owned object from the privateOwnedObjects Map.

public void
removeReadOnlyClass(Class<?> theClass)

Implements org.eclipse.persistence.sessions.UnitOfWork.removeReadOnlyClass.

PUBLIC: Removes a Class from the receiver's set of read-only classes.
public void
resumeUnitOfWork()

INTERNAL: Resume the unit of work state after a flush, or resume operation.

public Object
retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery.

INTERNAL: A query execution failed due to an invalid query.
public void
revertAndResume()

Implements org.eclipse.persistence.sessions.UnitOfWork.revertAndResume.

PUBLIC: Revert all changes made to any registered object.
public Object

Returns:

the object reverted.
revertObject
(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.revertObject.

PUBLIC: Revert the object's attributes from the parent.
public Object
revertObject(Object clone, int cascadeDepth)

INTERNAL: Revert the object's attributes from the parent.

public void
rollbackTransaction()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.rollbackTransaction.

INTERNAL: This is internal to the uow, transactions should not be used explicitly in a uow.
protected void
rollbackTransaction(boolean
whether we were inside a commit or just trying to write out changes early.
intendedToCommitTransaction
)

INTERNAL: rollbackTransaction() with a twist for external transactions.

public Map<Object, Object>

Returns:

Map to facilitate merging with conforming instances returned from a query on the database.
scanForConformingInstances
(Expression
must be cloned and specially prepared for conforming
selectionCriteria
,
Class<?> referenceClass, AbstractRecord arguments, ObjectLevelReadQuery query)

INTERNAL: Scans the UnitOfWork identity map for conforming instances.

protected void
setAllClonesCollection(Map<K, V> objects)

INTERNAL: Used to set the collections of all objects in the UnitOfWork.

public void
setBatchQueries(Map<ReadQuery, ReadQuery> batchQueries)

INTERNAL: When in transaction batch read objects must use query local to the unit of work.

protected void
setCascadeDeleteObjects(Set<Object> cascadeDeleteObjects)

INTERNAL: Set any objects have been deleted through database cascade delete constraints.

protected void
setCloneMapping(Map<K, V> cloneMapping)

INTERNAL: Set the clone mapping.

public void
protected void
setContainerBeans(Map<K, V> containerBeans)

INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.

protected void
setContainerUnitOfWork(UnitOfWorkImpl containerUnitOfWork)

INTERNAL: This is only used for EJB entity beans to manage beans accessed in a transaction context.

public void
setDead()

INTERNAL: set UoW lifecycle state variable to DEATH

protected void
setDeletedObjects(Map<K, V> deletedObjects)

INTERNAL: The deleted objects stores any objects removed during the unit of work.

protected void
setLifecycle(int lifecycle)

INTERNAL: The life cycle tracks if the unit of work is active and is used for JTS.

public void
setMergeManager(MergeManager mergeManager)

INTERNAL: A reference to the last used merge manager.

protected void
setNewObjectsCloneToOriginal(Map<K, V> newObjects)

INTERNAL: The new objects stores any objects newly created during the unit of work.

protected void
setNewObjectsOriginalToClone(Map<K, V> newObjects)

INTERNAL: The new objects stores any objects newly created during the unit of work.

public void
setObjectsDeletedDuringCommit(Map<K, V> deletedObjects)

INTERNAL: Set the objects that have been deleted.

public void
setParent(AbstractSession parent)

INTERNAL: Set the parent.

public void
setPendingMerge()

INTERNAL: set UoW lifecycle state variable to PENDING_MERGE

public void
setPreDeleteComplete(boolean
the preDeleteComplete to set
preDeleteComplete
)

public void
setReadOnlyClasses(List<Class<?>> classes)

INTERNAL: Gives a new set of read-only classes to the receiver.

protected void
setRemovedObjects(Map<K, V> removedObjects)

INTERNAL: The removed objects stores any newly registered objects removed during the nested unit of work.

public void
setResumeUnitOfWorkOnTransactionCompletion(boolean resumeUnitOfWork)

INTERNAL: Set if this UnitofWork should be resumed after the end of the transaction Used when UnitOfWork is synchronized with external transaction control

public void
setShouldCascadeCloneToJoinedRelationship(boolean shouldCascadeCloneToJoinedRelationship)

INTERNAL: True if the value holder for the joined attribute should be triggered.

public void
setShouldDiscoverNewObjects(boolean shouldDiscoverNewObjects)

INTERNAL: Set if this UnitofWork should discover new objects on commit.

public void
setShouldNewObjectsBeCached(boolean shouldNewObjectsBeCached)

Implements org.eclipse.persistence.sessions.UnitOfWork.setShouldNewObjectsBeCached.

ADVANCED: By default new objects are not cached until the exist on the database.
public void
setShouldPerformDeletesFirst(boolean shouldPerformDeletesFirst)

Implements org.eclipse.persistence.sessions.UnitOfWork.setShouldPerformDeletesFirst.

ADVANCED: By default deletes are performed last in a unit of work.
public void
setShouldThrowConformExceptions(int shouldThrowExceptions)

Implements org.eclipse.persistence.sessions.UnitOfWork.setShouldThrowConformExceptions.

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;
public void
setShouldValidateExistence(boolean shouldValidateExistence)

Set the default to determine if does-exist should be performed on persist.

public static void
setSmartMerge(boolean option)

INTERNAL: Set smart merge flag.

public void
setSynchronized(boolean synched)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.setSynchronized.

INTERNAL: Set isSynchronized flag to indicate that this session is a synchronized unit of work.
public void
setTransaction(Object transaction)

INTERNAL: PERF: Set the associated external transaction.

public void
setUnitOfWorkChangeSet(UnitOfWorkChangeSet unitOfWorkChangeSet)

INTERNAL: Sets the current UnitOfWork change set to be the one passed in.

protected void
setUnregisteredExistingObjects(Map<K, V>
Map
newUnregisteredExistingObjects
)

INTERNAL: Used to set the unregistered existing objects vector used when validation has been turned off.

protected void
setUnregisteredNewObjects(Map<K, V> newObjects)

INTERNAL:

protected void
setUnregisteredNewObjectsInParent(Map<K, V> newObjects)

INTERNAL:

protected void
setupPrimaryKeyToNewObjects()

INTERNAL: Create the map of primary key to new objects used to speed up in-memory querying.

public void
setValidationLevel(int validationLevel)

Implements org.eclipse.persistence.sessions.UnitOfWork.setValidationLevel.

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.
public void
setWasNonObjectLevelModifyQueryExecuted(boolean wasNonObjectLevelModifyQueryExecuted)

INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed.

public void
setWasTransactionBegunPrematurely(boolean wasTransactionBegunPrematurely)

INTERNAL: Set a flag in the root UOW to indicate that a pess.

public Object

Returns:

the registered version for the clone being merged.
shallowMergeClone
(Object rmiClone)

Implements org.eclipse.persistence.sessions.UnitOfWork.shallowMergeClone.

PUBLIC: Merge the attributes of the clone into the unit of work copy.
public Object

Returns:

the object reverted.
shallowRevertObject
(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.shallowRevertObject.

PUBLIC: Revert the object's attributes from the parent.
public void
shallowUnregisterObject(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.shallowUnregisterObject.

ADVANCED: Unregister the object with the unit of work.
public boolean
shouldCascadeCloneToJoinedRelationship()

INTERNAL: True if the value holder for the joined attribute should be triggered.

public boolean
shouldClearForCloseOnRelease()

INTERNAL: Indicates whether clearForClose method should be called by release method.

public boolean
shouldDiscoverNewObjects()

INTERNAL: Set if this UnitofWork should discover new objects on commit.

public boolean
shouldForceReadFromDB(ObjectBuildingQuery query, Object primaryKey)

INTERNAL: Calculate whether we should read directly from the database to the UOW.

public boolean
shouldNewObjectsBeCached()

Implements org.eclipse.persistence.sessions.UnitOfWork.shouldNewObjectsBeCached.

ADVANCED: By default new objects are not cached until the exist on the database.
public boolean
shouldPerformDeletesFirst()

Implements org.eclipse.persistence.sessions.UnitOfWork.shouldPerformDeletesFirst.

ADVANCED: By default all objects are inserted and updated in the database before any object is deleted.
public boolean
shouldPerformFullValidation()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public boolean
shouldPerformNoValidation()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public boolean
shouldPerformPartialValidation()

Implements org.eclipse.persistence.sessions.UnitOfWork.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.
public boolean
shouldReadFromDB()

INTERNAL: Indicates whether readObject should return the object read from the db in case there is no object in uow cache (as opposed to fetching the object from parent's cache).

public boolean
shouldResumeUnitOfWorkOnTransactionCompletion()

INTERNAL: Returns true if this UnitofWork should be resumed after the end of the transaction Used when UnitOfWork is synchronized with external transaction control

public boolean
shouldStoreBypassCache()

INTERNAL: This is a JPA setting that is off by default in regular EclipseLink.

public boolean
shouldValidateExistence()

Return the default to determine if does-exist should be performed on persist.

public void
storeDeferredModifyAllQuery(DatabaseQuery query, AbstractRecord translationRow)

INTERNAL: Store the deferred UpdateAllQuery's from the UoW in the list for execution.

public void
storeModifyAllQuery(DatabaseQuery query)

INTERNAL: Store the ModifyAllQuery's from the UoW in the list.

public void
synchronizeAndResume()

INTERNAL Synchronize the clones and update their backup copies.

protected void
undeleteObject(Object object)

INTERNAL: This method is used to transition an object from the deleted objects list to be simply be register.

public void
unregisterObject(Object clone)

Implements org.eclipse.persistence.sessions.UnitOfWork.unregisterObject.

PUBLIC: Unregister the object with the unit of work.
public void
unregisterObject(Object clone, int cascadeDepth)

INTERNAL: Unregister the object with the unit of work.

public void
unregisterObject(Object clone, int cascadeDepth, boolean forDetach)

INTERNAL: Unregister the object with the unit of work.

public void
updateChangeTrackersIfRequired(Object objectToWrite, ObjectChangeSet changeSetToWrite, UnitOfWorkImpl uow, ClassDescriptor descriptor)

INTERNAL: This method is used internally to update the tracked objects if required

protected Object
updateDerivedIds(Object clone, ClassDescriptor descriptor)

INTERNAL: On persist and flush operations we must update any derived id fields.

public void
validateObjectSpace()

Implements org.eclipse.persistence.sessions.UnitOfWork.validateObjectSpace.

ADVANCED: This can be used to help debugging an object-space corruption.
private void
public boolean

Returns:

true if threads were switched
verifyMutexThreadIntegrityBeforeRelease
()

INTERNAL: 272022: Avoid releasing locks on the wrong server thread.

public boolean
wasDeleted(Object original)

INTERNAL: Return if the object was deleted previously (in a flush).

public boolean
wasNonObjectLevelModifyQueryExecuted()

INTERNAL: True if either DataModifyQuery or ModifyAllQuery was executed.

public boolean
wasTransactionBegunPrematurely()

INTERNAL: Indicates if a transaction was begun by a pessimistic locking or non-selecting query.

public void
writeChanges()

Implements org.eclipse.persistence.sessions.UnitOfWork.writeChanges.

ADVANCED: Writes all changes now before commit().
public void
writesCompleted()

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.writesCompleted.

INTERNAL: This method notifies the accessor that a particular sets of writes has completed.
Inherited from org.eclipse.persistence.internal.sessions.AbstractSession:
acquireNonSynchronizedUnitOfWorkacquireNonSynchronizedUnitOfWorkacquireRepeatableWriteUnitOfWorkacquireUnitOfWorkaddAliasaddJPAQueryaddJPATablePerTenantQueryaddMultitenantContextPropertyaddQueryaddQueryaddQueryaddStaticMetamodelClassaddTablePerTenantDescriptoraddTablePerTenantQuerybasicBeginTransactionbasicBeginTransactionbasicCommitTransactionbasicExecuteCallbasicRollbackTransactionbeginExternalTransactionbuildDefaultQueryBuildercheckAndRefreshInvalidObjectcheckHierarchyForDescriptorcleanUpInjectionManagerclearDescriptorsclearIntegrityCheckerclearLastDescriptorAccessedclearProfileclonecommitExternalTransactioncompareObjectscompareObjectsDontMatchconfigcontainsQuerycopycopycopyDescriptorNamedQueriescopyDescriptorsFromProjectcopyInternalcreateInjectionManagercreateProtectedInstanceFromCachedDatadeferEventdeleteAllObjectsdeleteObjectdoesObjectExistdontLogMessagesendOperationProfileendOperationProfileexecuteDeferredEventsexecuteNonSelectingCallexecuteNonSelectingSQLexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteSelectingCallexecuteSQLfinefinerfinestgetActiveCommandThreadsgetActiveSessiongetAliasDescriptorsgetAllQueriesgetAsOfClausegetAttributeGroupsgetBrokergetCacheKeyFromTargetSessionForMergegetClassDescriptorgetClassDescriptorgetClassDescriptorForAliasgetCommandManagergetDatasourceLogingetDatasourcePlatformgetDefaultReferenceModegetDescriptorgetDescriptorgetDescriptorForAliasgetDescriptorsgetEventManagergetExceptionHandlergetExceptionHandlerClassgetExternalTransactionControllergetIdgetIdentityMapAccessorgetIdentityMapAccessorInstancegetInjectionManagergetIntegrityCheckergetJPAQueriesgetJPATablePerTenantQueriesgetLoadergetLoggetLogingetLogLevelgetLogLevelgetLogSessionStringgetMappedSuperclassgetMultitenantContextPropertiesgetNamegetNextQueryIdgetNextSequenceNumberValuegetNumberOfActiveUnitsOfWorkgetParentIdentityMapSessiongetParentIdentityMapSessiongetPartitioningPolicygetPessimisticLockTimeoutDefaultgetPessimisticLockTimeoutUnitDefaultgetPlatformgetProfilergetProjectgetPropertiesgetQueriesgetQuerygetQuerygetQueryBuildergetQueryTimeoutDefaultgetQueryTimeoutUnitDefaultgetRefreshMetadataListenergetRootSessiongetSerializergetSessionForClassgetSessionForNamegetSessionLoggetStaticMetamodelClassgetTablePerTenantDescriptorsgetTablePerTenantQueriesgetTransactionMutexhandleExceptionhandleSeverehasBrokerhasCommitManagerhasDescriptorhasEventManagerhasExceptionHandlerhasExternalTransactionControllerhasPropertieshasTablePerTenantDescriptorshasTablePerTenantQueriesincrementProfileincrementProfileinfoinsertObjectisBrokerisClassReadOnlyisClientSessionisConcurrentisConnectedisDatabaseSessionisDistributedSessionisExclusiveConnectionRequiredisExclusiveIsolatedClientSessionisFinalizersEnabledisHistoricalSessionisInBrokerisInProfileisIsolatedClientSessionisJPAQueriesProcessedisLoggingOffisProtectedSessionisRemoteSessionisRemoteUnitOfWorkisServerSessionisSessionBrokerisSynchronizedkeyFromObjectloadloadlogloglogloglogloglogloglogMessagelogMessagelogThrowablepostAcquireConnectionprepareDatabaseQuerypreReleaseConnectionpriviledgedExecuteNonSelectingCallpriviledgedExecuteSelectingCallprocessCommandprocessJPAQueriesprocessJPAQueryreadAllObjectsreadAllObjectsreadAllObjectsreadAllObjectsreadObjectreadObjectreadObjectreadObjectreadObjectrefreshAndLockObjectrefreshAndLockObjectrefreshObjectregisterFinalizerreleaseConnectionAfterCallreleaseUnitOfWorkremovePropertyremoveQueryremoveQueryretrieveCacheKeyretryTransactionrollbackExternalTransactionsetAccessorsetBrokersetCommandManagersetCommitManagersetDatasourceLoginsetDefaultReferenceModesetEventManagersetExceptionHandlersetExternalTransactionControllersetInjectionManagersetIntegrityCheckersetIsConcurrentsetIsFinalizersEnabledsetIsInBrokersetIsInProfilesetJPAQueriesProcessedsetLogsetLoggingOffsetLoginsetLoginsetLogLevelsetNamesetNumberOfActiveUnitsOfWorksetPartitioningPolicysetPessimisticLockTimeoutDefaultsetPessimisticLockTimeoutUnitDefaultsetProfilersetProjectsetPropertiessetPropertysetQueriessetQueryBuildersetQueryTimeoutDefaultsetQueryTimeoutUnitDefaultsetRefreshMetadataListenersetSerializersetSessionLogsetShouldOptimizeResultSetAccesssetShouldPropagateChangessetTolerateInvalidJPQLsetTransactionMutexsetWasJTSTransactionInternallyStartedsevereshouldDisplayDatashouldLogshouldLogMessagesshouldLogMessagesshouldOptimizeResultSetAccessshouldPropagateChangesshouldTolerateInvalidJPQLstartOperationProfilestartOperationProfiletoStringunwrapObjectupdateObjectupdateProfileupdateTablePerTenantDescriptorsvalidateCachevalidateQueryverifyDeletewarningwasJTSTransactionInternallyStartedwrapObjectwriteAllObjectsWithChangeSetwriteObject