Class RemoteUnitOfWork
- 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
-
- org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork
-
- org.eclipse.persistence.internal.sessions.remote.RemoteUnitOfWork
-
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
,CommandProcessor
,Session
,UnitOfWork
public class RemoteUnitOfWork extends RepeatableWriteUnitOfWork
Counter part of the unit of work which exists on the client side.- See Also:
- 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 protected boolean
isFlush
protected boolean
isOnClient
protected List
newObjectsCache
protected RemoteSessionController
parentSessionController
protected List
unregisteredNewObjectsCache
-
Fields inherited from class org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork
classesToBeInvalidated, cumulativeUOWChangeSet, discoverUnregisteredNewObjectsWithoutPersist, flushClearCache, isWithinFlush, shouldStoreBypassCache, shouldTerminateTransaction
-
Fields inherited from class org.eclipse.persistence.internal.sessions.UnitOfWorkImpl
AfterExternalTransactionRolledBack, allClones, batchQueries, Birth, cascadeDeleteObjects, changeTrackedHardList, cloneDepth, cloneMapping, cloneToOriginals, commitOrder, CommitPending, CommitTransactionPending, containerBeans, containerUnitOfWork, CREATION_THREAD_HASHCODE, CREATION_THREAD_ID, CREATION_THREAD_NAME, Death, deferredModifyAllQueries, deletedObjects, deletedPrivateOwnedObjects, deletionDependencies, DO_NOT_THROW_CONFORM_EXCEPTIONS, Full, isNestedUnitOfWork, lastUsedMergeManager, lifecycle, LOCK_QUERIES_PROPERTY, mergeManagerForActiveMerge, MergePending, modifyAllQueries, newAggregates, newObjectsCloneToMergeOriginal, newObjectsCloneToOriginal, newObjectsInParent, newObjectsInParentOriginalToClone, newObjectsOriginalToClone, None, objectsDeletedDuringCommit, optimisticReadLockObjects, parent, Partial, pessimisticLockedObjects, preDeleteComplete, privateOwnedObjects, ReadLockOnly, ReadLockUpdateVersion, readOnlyClasses, referenceMode, removedObjects, resumeOnTransactionCompletion, shouldCascadeCloneToJoinedRelationship, shouldDiscoverNewObjects, shouldNewObjectsBeCached, shouldPerformDeletesFirst, shouldThrowConformExceptions, shouldValidateExistence, SmartMerge, THROW_ALL_CONFORM_EXCEPTIONS, transaction, unitOfWorkChangeSet, unregisteredDeletedObjectsCloneToBackupAndOriginal, unregisteredExistingObjects, unregisteredNewObjects, unregisteredNewObjectsInParent, validationLevel, wasNonObjectLevelModifyQueryExecuted, wasTransactionBegunPrematurely, WriteChangesFailed
-
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 RemoteUnitOfWork()
RemoteUnitOfWork(RemoteUnitOfWork parent)
RemoteUnitOfWork(RemoteUnitOfWork parent, ReferenceMode referenceMode)
RemoteUnitOfWork(DistributedSession parent)
RemoteUnitOfWork(DistributedSession parent, ReferenceMode referenceMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnitOfWorkImpl
acquireUnitOfWork()
The nested unit of work must also be remote.UnitOfWorkImpl
acquireUnitOfWork(ReferenceMode referenceMode)
The nested unit of work must also be remote.void
beginEarlyTransaction()
PUBLIC: Tell the unit of work to begin a transaction now.UnitOfWorkChangeSet
calculateChanges(Map registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)
INTERNAL: Changes are calculated on the client, so avoid recalculating them on the server.protected List
collectNewObjects()
This is done to maintain correspondence between local new objects and returned new objects from serialization.protected List
collectUnregisteredNewObjects()
This is done to maintain correspondence between local unregistered new objects and returned unregistered new objects from serialization.protected void
commitIntoRemoteUnitOfWork()
The remote unit of work returned after its commit on the server is merged with remote unit of work on the remote side.void
commitRootUnitOfWork()
Starts committing the remote unit of work.protected void
commitRootUnitOfWorkOnClient()
Merges remote unit of work to parent remote session.Object
executeQuery(String queryName)
PUBLIC: Execute the pre-defined query by name and return the result.Object
executeQuery(String queryName, Class domainClass)
PUBLIC: Execute the pre-defined query by name and return the result.Object
executeQuery(String queryName, Class domainClass, Vector argumentValues)
PUBLIC: Execute the pre-defined query by name and return the result.Object
executeQuery(String queryName, Vector argumentValues)
PUBLIC: Execute the pre-defined query by name and return the result.protected void
fixRemoteChangeSet(UnitOfWorkChangeSet uowChangeSet, Map cloneMap, AbstractSession session)
INTERNAL: Fix the transient fields in the serialized change set.Platform
getDatasourcePlatform()
INTERNAL: Return the database platform currently connected to.ClassDescriptor
getDescriptor(Class domainClass)
Return the table descriptor specified for the class.ClassDescriptor
getDescriptorForAlias(String alias)
Return the table descriptor specified for the class.List
getNewObjectsCache()
Returns a new object cacheRemoteSessionController
getParentSessionController()
INTERNAL: Method returns the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the clientDatabasePlatform
getPlatform()
INTERNAL: Return the database platform currently connected to.List
getUnregisteredNewObjectsCache()
Returns an unregistered new object cacheObject
internalExecuteQuery(DatabaseQuery query, AbstractRecord Record)
INTERNAL: Return the results from exeucting the database query.boolean
isFlush()
protected boolean
isOnClient()
boolean
isRemoteUnitOfWork()
Return if this session is a unit of work.protected void
prepareForMergeIntoRemoteUnitOfWork()
The returned remote unit of work from the server is prepared to merge with local remote unit of work.void
reinitializeForSession(AbstractSession session, RemoteSessionController parentSessionController)
INTERNAL: Re-initialize for the server-side session.void
resumeUnitOfWork()
INTERNAL: Resume is not required on the server.void
setIsFlush(boolean isFlush)
protected void
setIsOnClient(boolean isOnClient)
protected void
setNewObjectsCache(List newObjectsCache)
Set a new object cachevoid
setParentSessionController(RemoteSessionController parentSessionController)
INTERNAL: Sets the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the clientprotected void
setUnregisteredNewObjectsCache(List unregisteredNewObjectsCache)
Set unregistered new object cacheString
toString()
Avoid the toString printing the accessor and platform.boolean
verifyDelete(Object domainObject)
TESTING: This is used by testing code to ensure that a deletion was successful.void
writeChanges()
Simulate a flush, current just begins a transaction and commits.-
Methods inherited from class org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork
checkHierarchyForDescriptor, clear, clearFlushClearCache, clearForClose, cloneAndRegisterNewObject, commitTransaction, discoverUnregisteredNewObjects, getClassesToBeInvalidated, getCumulativeUOWChangeSet, getFlushClearCache, getUnregisteredDeletedCloneForOriginal, isAfterWriteChangesButBeforeCommit, isObjectDeleted, issueSQLbeforeCompletion, isWithinFlush, mergeChangesIntoParent, mergeCloneWithReferences, registerNewObject, registerNotRegisteredNewObjectForPersist, rollbackTransaction, rollbackTransaction, setCumulativeUOWChangeSet, setDiscoverUnregisteredNewObjectsWithoutPersist, setFlushClearCache, setShouldStoreByPassCache, setShouldTerminateTransaction, shouldClearForCloseOnRelease, shouldDiscoverUnregisteredNewObjectsWithoutPersist, shouldForceReadFromDB, shouldStoreBypassCache, synchronizeAndResume, updateChangeTrackersIfRequired, wasDeleted
-
Methods inherited from class org.eclipse.persistence.internal.sessions.UnitOfWorkImpl
acquireHistoricalSession, acquireWriteLocks, addDeletedPrivateOwnedObjects, addDeletionDependency, addNewAggregate, addObjectDeletedDuringCommit, addPessimisticLockedClone, addPrivateOwnedObject, addReadOnlyClass, addReadOnlyClasses, addRemovedObject, addToChangeTrackedHardList, afterExternalTransactionRollback, assignSequenceNumber, assignSequenceNumber, assignSequenceNumbers, assignSequenceNumbers, basicPrintRegisteredObjects, beginTransaction, buildOriginal, canChangeReadOnlySet, checkExistence, checkForUnregisteredExistingObject, checkIfAlreadyRegistered, cloneAndRegisterObject, cloneAndRegisterObject, cloneMap, collectAndPrepareObjectsForNestedMerge, commit, commitAfterWriteChanges, commitAndResume, commitAndResumeAfterWriteChanges, commitAndResumeOnFailure, commitAndResumeWithPreBuiltChangeSet, commitInternallyStartedExternalTransaction, commitNestedUnitOfWork, commitRootUnitOfWorkWithPreBuiltChangeSet, commitToDatabase, commitToDatabaseWithChangeSet, commitToDatabaseWithPreBuiltChangeSet, commitTransactionAfterWriteChanges, copyReadOnlyClasses, createCloneQueryValueHolder, createCloneTransformationValueHolder, createMap, createMap, deepMergeClone, deepRevertObject, deepUnregisterObject, discoverAllUnregisteredNewObjects, discoverAllUnregisteredNewObjectsInParent, discoverAndPersistUnregisteredNewObjects, dontPerformValidation, executeCall, forceUpdateToVersionField, getAccessor, getAccessors, getAccessors, getActiveUnitOfWork, getAllFromNewObjects, getBackupClone, getBackupClone, getBackupCloneForCommit, getBackupCloneForCommit, getBatchQueries, getCascadeDeleteObjects, getChangeTrackedHardList, getCloneMapping, getCloneToOriginals, getCommitManager, getCommitOrder, getContainerBeans, getContainerUnitOfWork, getCurrentChanges, getDefaultReadOnlyClasses, getDeletedObjects, getDeletionDependencies, getDeletionDependencies, getExecutionSession, getLifecycle, getMergeManager, getNewAggregates, getNewObjectsCloneToMergeOriginal, getNewObjectsCloneToOriginal, getNewObjectsInParentOriginalToClone, getNewObjectsOriginalToClone, getObjectFromNewObjects, getObjectFromNewObjects, getObjectsDeletedDuringCommit, getOptimisticReadLockObjects, getOriginalVersionOfNewObject, getOriginalVersionOfObject, getOriginalVersionOfObjectOrNull, getOriginalVersionOfObjectOrNull, getParent, getParentIdentityMapSession, getPessimisticLockedObjects, getPlatform, getProperty, getQuery, getQuery, getReadOnlyClasses, getReference, getReferenceMode, getRemovedObjects, getSequencing, getServerPlatform, getSessionTypeString, getShouldThrowConformExceptions, getState, getTransaction, getUnitOfWorkChangeSet, getUnregisteredExistingObjects, getUnregisteredNewObjects, getUnregisteredNewObjectsInParent, getValidationLevel, hasCascadeDeleteObjects, hasChanges, hasCloneMapping, hasCloneToOriginals, hasContainerBeans, hasDeferredModifyAllQueries, hasDeletedObjects, hasModifications, hasModifyAllQueries, hasNewObjects, hasNewObjectsInParentOriginalToClone, hasObjectsDeletedDuringCommit, hasOptimisticReadLockObjects, hasPessimisticLockedObjects, hasPrivateOwnedObjects, hasRemovedObjects, hasUnregisteredNewObjects, initializeIdentityMapAccessor, internalRegisterObject, isActive, isAfterWriteChangesFailed, isClassReadOnly, isCloneNewObject, isCloneNewObjectFromParent, isCommitPending, isConsideredInvalid, isDead, isInTransaction, isMergePending, isNestedUnitOfWork, isNewObjectInParent, isObjectNew, isObjectRegistered, isOriginalNewObject, isPessimisticLocked, isPreDeleteComplete, isSmartMerge, issueModifyAllQueryList, issueSQLbeforeCompletion, isUnitOfWork, isUnregisteredExistingObject, isUnregisteredNewObjectInParent, mergeBmpAndWsEntities, mergeClone, mergeClone, mergeClonesAfterCompletion, mergeCloneWithReferences, mergeCloneWithReferences, mergeCloneWithReferences, newInstance, performFullValidation, performPartialValidation, performRemove, performRemovePrivateOwnedObjectFromChangeSet, populateAndRegisterObject, postMergeChanges, preMergeChanges, printRegisteredObjects, processDeleteObjectQuery, registerAllObjects, registerAllObjects, registerExistingObject, registerExistingObject, registerExistingObject, registerNewContainerBean, registerNewContainerBeanForCMP, registerNewObject, registerNewObjectClone, registerNewObjectForPersist, registerNewObjectInIdentityMap, registerObject, registerObject, registerOriginalNewObjectFromNestedUnitOfWork, registerWithTransactionIfRequired, release, releaseJTSConnection, releaseReadConnection, releaseWriteLocks, removeAllReadOnlyClasses, removeForceUpdateToVersionField, removePrivateOwnedObject, removeReadOnlyClass, retryQuery, revertAndResume, revertObject, revertObject, scanForConformingInstances, setAllClonesCollection, setBatchQueries, setCascadeDeleteObjects, setCloneMapping, setCommitOrder, setContainerBeans, setContainerUnitOfWork, setDead, setDeletedObjects, setLifecycle, setMergeManager, setNewObjectsCloneToOriginal, setNewObjectsOriginalToClone, setObjectsDeletedDuringCommit, setParent, setPendingMerge, setPreDeleteComplete, setReadOnlyClasses, setRemovedObjects, setResumeUnitOfWorkOnTransactionCompletion, setShouldCascadeCloneToJoinedRelationship, setShouldDiscoverNewObjects, setShouldNewObjectsBeCached, setShouldPerformDeletesFirst, setShouldThrowConformExceptions, setShouldValidateExistence, setSmartMerge, setSynchronized, setTransaction, setUnitOfWorkChangeSet, setUnregisteredExistingObjects, setUnregisteredNewObjects, setUnregisteredNewObjectsInParent, setValidationLevel, setWasNonObjectLevelModifyQueryExecuted, setWasTransactionBegunPrematurely, shallowMergeClone, shallowRevertObject, shallowUnregisterObject, shouldCascadeCloneToJoinedRelationship, shouldDiscoverNewObjects, shouldNewObjectsBeCached, shouldPerformDeletesFirst, shouldPerformFullValidation, shouldPerformNoValidation, shouldPerformPartialValidation, shouldReadFromDB, shouldResumeUnitOfWorkOnTransactionCompletion, shouldValidateExistence, storeDeferredModifyAllQuery, storeModifyAllQuery, undeleteObject, unregisterObject, unregisterObject, unregisterObject, updateDerivedIds, validateObjectSpace, verifyMutexThreadIntegrityBeforeRelease, wasNonObjectLevelModifyQueryExecuted, wasTransactionBegunPrematurely, writesCompleted
-
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
acquireNonSynchronizedUnitOfWork, acquireNonSynchronizedUnitOfWork, acquireRepeatableWriteUnitOfWork, addAlias, addJPAQuery, addJPATablePerTenantQuery, addMultitenantContextProperty, addQuery, addQuery, addQuery, addStaticMetamodelClass, addTablePerTenantDescriptor, addTablePerTenantQuery, basicBeginTransaction, basicBeginTransaction, basicCommitTransaction, basicExecuteCall, basicRollbackTransaction, beginExternalTransaction, buildDefaultQueryBuilder, checkAndRefreshInvalidObject, cleanUpInjectionManager, clearDescriptors, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitExternalTransaction, compareObjects, compareObjectsDontMatch, config, containsQuery, copy, copy, copyDescriptorNamedQueries, copyDescriptorsFromProject, copyInternal, createInjectionManager, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, endOperationProfile, executeDeferredEvents, executeNonSelectingCall, executeNonSelectingSQL, 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, getDefaultReferenceMode, getDescriptor, 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, 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, isServerSession, isSessionBroker, isSynchronized, keyFromObject, load, load, 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, unwrapObject, updateObject, updateProfile, updateTablePerTenantDescriptors, validateCache, validateQuery, 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
addJPAQuery, addQuery, clearIntegrityChecker, clearProfile, containsQuery, copy, copy, doesObjectExist, dontLogMessages, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getActiveSession, getAsOfClause, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getDatasourceLogin, getDefaultReferenceMode, getDescriptor, getDescriptors, getEventManager, getExceptionHandler, getExternalTransactionController, getId, getIdentityMapAccessor, getIntegrityChecker, getJPAQueries, getLog, getLogin, getLogLevel, getLogLevel, getName, getNextSequenceNumberValue, getPartitioningPolicy, getProfiler, getProject, getProperties, getQueries, getQuery, getSerializer, getSessionLog, handleException, handleSevere, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, isClientSession, isConnected, isDatabaseSession, isDistributedSession, isFinalizersEnabled, isInProfile, isRemoteSession, isServerSession, isSessionBroker, 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
-
newObjectsCache
protected List newObjectsCache
-
unregisteredNewObjectsCache
protected List unregisteredNewObjectsCache
-
isOnClient
protected boolean isOnClient
-
parentSessionController
protected transient RemoteSessionController parentSessionController
-
isFlush
protected boolean isFlush
-
-
Constructor Detail
-
RemoteUnitOfWork
public RemoteUnitOfWork()
-
RemoteUnitOfWork
public RemoteUnitOfWork(RemoteUnitOfWork parent)
-
RemoteUnitOfWork
public RemoteUnitOfWork(DistributedSession parent)
-
RemoteUnitOfWork
public RemoteUnitOfWork(RemoteUnitOfWork parent, ReferenceMode referenceMode)
-
RemoteUnitOfWork
public RemoteUnitOfWork(DistributedSession parent, ReferenceMode referenceMode)
-
-
Method Detail
-
isFlush
public boolean isFlush()
-
setIsFlush
public void setIsFlush(boolean isFlush)
-
beginEarlyTransaction
public void beginEarlyTransaction() throws DatabaseException
PUBLIC: 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:
beginEarlyTransaction
in interfaceUnitOfWork
- Overrides:
beginEarlyTransaction
in classUnitOfWorkImpl
- Throws:
DatabaseException
- See Also:
UnitOfWorkImpl.commit()
,UnitOfWorkImpl.release()
-
acquireUnitOfWork
public UnitOfWorkImpl acquireUnitOfWork()
The nested unit of work must also be remote.- Specified by:
acquireUnitOfWork
in interfaceSession
- Overrides:
acquireUnitOfWork
in classUnitOfWorkImpl
- See Also:
UnitOfWorkImpl
-
acquireUnitOfWork
public UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
The nested unit of work must also be remote.- Specified by:
acquireUnitOfWork
in interfaceSession
- Overrides:
acquireUnitOfWork
in classAbstractSession
- Parameters:
referenceMode
- The reference type the UOW should use internally when referencing Working clones. Setting this to WEAK means the UOW will use weak references to reference clones that support active object change tracking and hard references for deferred change tracked objects. Setting to FORCE_WEAK means that all objects will be referenced by weak references and if the application no longer references the clone the clone may be garbage collected. If the clone has uncommitted changes then those changes will be lost.- See Also:
UnitOfWorkImpl
-
collectNewObjects
protected List collectNewObjects()
This is done to maintain correspondence between local new objects and returned new objects from serialization. Object correspondence is maintained by comparing primary keys but for new objects it is possible that primary key value is null as it is still not inserted. The returned new objects from serialization will have primary key value which will be inserted into corresponding local new objects.
-
collectUnregisteredNewObjects
protected List collectUnregisteredNewObjects()
This is done to maintain correspondence between local unregistered new objects and returned unregistered new objects from serialization. Object correspondence is maintained by comparing primary keys but for unregistered new objects it is possible that primary key value is null as it is still not inserted. The returned unregistered new objects from serialization will have primary key value which will be inserted into corresponding local new objects.
-
commitIntoRemoteUnitOfWork
protected void commitIntoRemoteUnitOfWork()
The remote unit of work returned after its commit on the server is merged with remote unit of work on the remote side.
-
writeChanges
public void writeChanges()
Simulate a flush, current just begins a transaction and commits.- Specified by:
writeChanges
in interfaceUnitOfWork
- Overrides:
writeChanges
in classRepeatableWriteUnitOfWork
-
commitRootUnitOfWork
public void commitRootUnitOfWork()
Starts committing the remote unit of work. This must serialize the unit of work across to the server, commit the unit of work on the server, serialize it back and merge any server-side changes (such as sequence numbers) it into itself, then merge into the parent remote session.- Overrides:
commitRootUnitOfWork
in classRepeatableWriteUnitOfWork
-
calculateChanges
public UnitOfWorkChangeSet calculateChanges(Map registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)
INTERNAL: Changes are calculated on the client, so avoid recalculating them on the server.- Overrides:
calculateChanges
in classUnitOfWorkImpl
-
resumeUnitOfWork
public void resumeUnitOfWork()
INTERNAL: Resume is not required on the server.- Overrides:
resumeUnitOfWork
in classUnitOfWorkImpl
-
commitRootUnitOfWorkOnClient
protected void commitRootUnitOfWorkOnClient()
Merges remote unit of work to parent remote session.
-
executeQuery
public Object executeQuery(String queryName) throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The named query can be defined on the remote session or the server-side session.- Specified by:
executeQuery
in interfaceSession
- Overrides:
executeQuery
in classAbstractSession
- Throws:
DatabaseException
- See Also:
AbstractSession.addQuery(String, DatabaseQuery)
-
executeQuery
public Object executeQuery(String queryName, Class domainClass) throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined. The query is executed on the server-side session.- Specified by:
executeQuery
in interfaceSession
- Overrides:
executeQuery
in classAbstractSession
- Throws:
DatabaseException
- See Also:
DescriptorQueryManager.addQuery(String, DatabaseQuery)
-
executeQuery
public Object executeQuery(String queryName, Class domainClass, Vector argumentValues) throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse. The class is the descriptor in which the query was pre-defined.- Overrides:
executeQuery
in classAbstractSession
- Throws:
DatabaseException
- See Also:
DescriptorQueryManager.addQuery(String, DatabaseQuery)
-
executeQuery
public Object executeQuery(String queryName, Vector argumentValues) throws DatabaseException
PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Overrides:
executeQuery
in classAbstractSession
- Throws:
DatabaseException
- See Also:
AbstractSession.addQuery(String, DatabaseQuery)
-
getDescriptor
public ClassDescriptor getDescriptor(Class domainClass)
Return the table descriptor specified for the class.- Specified by:
getDescriptor
in interfaceCoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
- Specified by:
getDescriptor
in interfaceSession
- Overrides:
getDescriptor
in classAbstractSession
-
getDescriptorForAlias
public ClassDescriptor getDescriptorForAlias(String alias)
Return the table descriptor specified for the class.- Specified by:
getDescriptorForAlias
in interfaceSession
- Overrides:
getDescriptorForAlias
in classAbstractSession
- Parameters:
alias
- The descriptor alias.- Returns:
- The descriptor for the alias or
null
if no descriptor was found.
-
getNewObjectsCache
public List getNewObjectsCache()
Returns a new object cache
-
getParentSessionController
public RemoteSessionController getParentSessionController()
INTERNAL: Method returns the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client
-
getPlatform
public DatabasePlatform getPlatform()
INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior.- Specified by:
getPlatform
in interfaceSession
- Overrides:
getPlatform
in classAbstractSession
-
getDatasourcePlatform
public Platform getDatasourcePlatform()
INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior.- Specified by:
getDatasourcePlatform
in interfaceCoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
- Specified by:
getDatasourcePlatform
in interfaceSession
- Overrides:
getDatasourcePlatform
in classAbstractSession
-
getUnregisteredNewObjectsCache
public List getUnregisteredNewObjectsCache()
Returns an unregistered new object cache
-
internalExecuteQuery
public Object internalExecuteQuery(DatabaseQuery query, AbstractRecord Record) throws DatabaseException, QueryException
INTERNAL: Return the results from exeucting the database query. the arguments should be a database row with raw data values.- Overrides:
internalExecuteQuery
in classUnitOfWorkImpl
- Throws:
DatabaseException
QueryException
-
isOnClient
protected boolean isOnClient()
-
isRemoteUnitOfWork
public boolean isRemoteUnitOfWork()
Return if this session is a unit of work.- Specified by:
isRemoteUnitOfWork
in interfaceSession
- Overrides:
isRemoteUnitOfWork
in classAbstractSession
-
prepareForMergeIntoRemoteUnitOfWork
protected void prepareForMergeIntoRemoteUnitOfWork()
The returned remote unit of work from the server is prepared to merge with local remote unit of work.
-
reinitializeForSession
public void reinitializeForSession(AbstractSession session, RemoteSessionController parentSessionController)
INTERNAL: Re-initialize for the server-side session. This is done when the uow is passed back to the server for committing.
-
fixRemoteChangeSet
protected void fixRemoteChangeSet(UnitOfWorkChangeSet uowChangeSet, Map cloneMap, AbstractSession session)
INTERNAL: Fix the transient fields in the serialized change set.
-
setIsOnClient
protected void setIsOnClient(boolean isOnClient)
-
setNewObjectsCache
protected void setNewObjectsCache(List newObjectsCache)
Set a new object cache
-
setParentSessionController
public void setParentSessionController(RemoteSessionController parentSessionController)
INTERNAL: Sets the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client
-
setUnregisteredNewObjectsCache
protected void setUnregisteredNewObjectsCache(List unregisteredNewObjectsCache)
Set unregistered new object cache
-
toString
public String toString()
Avoid the toString printing the accessor and platform.- Overrides:
toString
in classAbstractSession
-
verifyDelete
public boolean verifyDelete(Object domainObject)
TESTING: This is used by testing code to ensure that a deletion was successful.- Overrides:
verifyDelete
in classAbstractSession
-
-