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:
java.io.Serializable,java.lang.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 booleanisFlushprotected booleanisOnClientprotected java.util.ListnewObjectsCacheprotected RemoteSessionControllerparentSessionControllerprotected java.util.ListunregisteredNewObjectsCache-
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, primaryKeyToNewObjects, 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 UnitOfWorkImplacquireUnitOfWork()The nested unit of work must also be remote.UnitOfWorkImplacquireUnitOfWork(ReferenceMode referenceMode)The nested unit of work must also be remote.voidbeginEarlyTransaction()PUBLIC: Tell the unit of work to begin a transaction now.UnitOfWorkChangeSetcalculateChanges(java.util.Map registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)INTERNAL: Changes are calculated on the client, so avoid recalculating them on the server.protected java.util.ListcollectNewObjects()This is done to maintain correspondence between local new objects and returned new objects from serialization.protected java.util.ListcollectUnregisteredNewObjects()This is done to maintain correspondence between local unregistered new objects and returned unregistered new objects from serialization.protected voidcommitIntoRemoteUnitOfWork()The remote unit of work returned after its commit on the server is merged with remote unit of work on the remote side.voidcommitRootUnitOfWork()Starts committing the remote unit of work.protected voidcommitRootUnitOfWorkOnClient()Merges remote unit of work to parent remote session.java.lang.ObjectexecuteQuery(java.lang.String queryName)PUBLIC: Execute the pre-defined query by name and return the result.java.lang.ObjectexecuteQuery(java.lang.String queryName, java.lang.Class domainClass)PUBLIC: Execute the pre-defined query by name and return the result.java.lang.ObjectexecuteQuery(java.lang.String queryName, java.lang.Class domainClass, java.util.Vector argumentValues)PUBLIC: Execute the pre-defined query by name and return the result.java.lang.ObjectexecuteQuery(java.lang.String queryName, java.util.Vector argumentValues)PUBLIC: Execute the pre-defined query by name and return the result.protected voidfixRemoteChangeSet(UnitOfWorkChangeSet uowChangeSet, java.util.Map cloneMap, AbstractSession session)INTERNAL: Fix the transient fields in the serialized change set.PlatformgetDatasourcePlatform()INTERNAL: Return the database platform currently connected to.ClassDescriptorgetDescriptor(java.lang.Class domainClass)Return the table descriptor specified for the class.ClassDescriptorgetDescriptorForAlias(java.lang.String alias)Return the table descriptor specified for the class.java.util.ListgetNewObjectsCache()Returns a new object cacheRemoteSessionControllergetParentSessionController()INTERNAL: Method returns the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the clientDatabasePlatformgetPlatform()INTERNAL: Return the database platform currently connected to.java.util.ListgetUnregisteredNewObjectsCache()Returns an unregistered new object cachejava.lang.ObjectinternalExecuteQuery(DatabaseQuery query, AbstractRecord Record)INTERNAL: Return the results from exeucting the database query.booleanisFlush()protected booleanisOnClient()booleanisRemoteUnitOfWork()Return if this session is a unit of work.protected voidprepareForMergeIntoRemoteUnitOfWork()The returned remote unit of work from the server is prepared to merge with local remote unit of work.voidreinitializeForSession(AbstractSession session, RemoteSessionController parentSessionController)INTERNAL: Re-initialize for the server-side session.voidresumeUnitOfWork()INTERNAL: Resume is not required on the server.voidsetIsFlush(boolean isFlush)protected voidsetIsOnClient(boolean isOnClient)protected voidsetNewObjectsCache(java.util.List newObjectsCache)Set a new object cachevoidsetParentSessionController(RemoteSessionController parentSessionController)INTERNAL: Sets the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the clientprotected voidsetUnregisteredNewObjectsCache(java.util.List unregisteredNewObjectsCache)Set unregistered new object cachejava.lang.StringtoString()Avoid the toString printing the accessor and platform.booleanverifyDelete(java.lang.Object domainObject)TESTING: This is used by testing code to ensure that a deletion was successful.voidwriteChanges()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, addNewObjectToPrimaryKeyToNewObjects, addNewObjectToPrimaryKeyToNewObjects, 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, getPrimaryKeyToNewObjects, 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, removeObjectFromPrimaryKeyToNewObjects, removeObjectFromPrimaryKeyToNewObjects, 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, setShouldOrderUpdates, setShouldPerformDeletesFirst, setShouldThrowConformExceptions, setShouldValidateExistence, setSmartMerge, setSynchronized, setTransaction, setUnitOfWorkChangeSet, setUnregisteredExistingObjects, setUnregisteredNewObjects, setUnregisteredNewObjectsInParent, setupPrimaryKeyToNewObjects, setValidationLevel, setWasNonObjectLevelModifyQueryExecuted, setWasTransactionBegunPrematurely, shallowMergeClone, shallowRevertObject, shallowUnregisterObject, shouldCascadeCloneToJoinedRelationship, shouldDiscoverNewObjects, shouldNewObjectsBeCached, shouldOrderUpdates, 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, copyObject, copyObject, createInjectionManager, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, endOperationProfile, executeDeferredEvents, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, 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, keyFromObject, load, load, log, log, log, log, log, log, log, log, log, log, logMessage, logMessage, logThrowable, postAcquireConnection, prepareDatabaseQuery, preReleaseConnection, priviledgedExecuteNonSelectingCall, priviledgedExecuteSelectingCall, processCommand, processJPAQueries, processJPAQuery, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshAndLockObject, refreshAndLockObject, refreshObject, registerFinalizer, releaseConnectionAfterCall, releaseUnitOfWork, removeProperty, removeQuery, removeQuery, retrieveCacheKey, retryTransaction, rollbackExternalTransaction, setAccessor, setBroker, setCommandManager, setCommitManager, setDatasourceLogin, setDefaultReferenceMode, setEventManager, setExceptionHandler, setExternalTransactionController, setInjectionManager, setIntegrityChecker, setIsConcurrent, setIsFinalizersEnabled, setIsInBroker, setIsInProfile, setJPAQueriesProcessed, setLog, setLoggingOff, setLogin, setLogin, setLogLevel, setName, setNumberOfActiveUnitsOfWork, setPartitioningPolicy, setPessimisticLockTimeoutDefault, setPessimisticLockTimeoutUnitDefault, setProfiler, setProject, setProperties, setProperty, setQueries, setQueryBuilder, setQueryTimeoutDefault, setQueryTimeoutUnitDefault, setRefreshMetadataListener, setSerializer, setSessionLog, setShouldOptimizeResultSetAccess, setShouldPropagateChanges, setTolerateInvalidJPQL, setTransactionMutex, setWasJTSTransactionInternallyStarted, severe, shouldDisplayData, shouldLog, shouldLogMessages, shouldLogMessages, shouldOptimizeResultSetAccess, shouldPropagateChanges, shouldTolerateInvalidJPQL, startOperationProfile, startOperationProfile, 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, copyObject, copyObject, 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, keyFromObject, log, logMessage, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, refreshObject, removeProperty, removeQuery, setDefaultReferenceMode, setExceptionHandler, setExternalTransactionController, setIntegrityChecker, setIsFinalizersEnabled, setLog, setLogLevel, setName, setPartitioningPolicy, setProfiler, setProperty, setQueryTimeoutDefault, setQueryTimeoutUnitDefault, setSerializer, setSessionLog, shouldLog, shouldLogMessages, validateCache
-
Methods inherited from interface org.eclipse.persistence.sessions.UnitOfWork
deleteAllObjects, deleteObject, isClassReadOnly, refreshAndLockObject, refreshAndLockObject
-
-
-
-
Field Detail
-
newObjectsCache
protected java.util.List newObjectsCache
-
unregisteredNewObjectsCache
protected java.util.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 DatabaseExceptionPUBLIC: Tell the unit of work to begin a transaction now. By default the unit of work will begin a transaction at commit time. The default is the recommended approach, however sometimes it is necessary to start the transaction before commit time. When the unit of work commits, this transaction will be committed.- Specified by:
beginEarlyTransactionin interfaceUnitOfWork- Overrides:
beginEarlyTransactionin classUnitOfWorkImpl- Throws:
DatabaseException- See Also:
UnitOfWorkImpl.commit(),UnitOfWorkImpl.release()
-
acquireUnitOfWork
public UnitOfWorkImpl acquireUnitOfWork()
The nested unit of work must also be remote.- Specified by:
acquireUnitOfWorkin interfaceSession- Overrides:
acquireUnitOfWorkin classUnitOfWorkImpl- See Also:
UnitOfWorkImpl
-
acquireUnitOfWork
public UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
The nested unit of work must also be remote.- Specified by:
acquireUnitOfWorkin interfaceSession- Overrides:
acquireUnitOfWorkin 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 java.util.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 java.util.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:
writeChangesin interfaceUnitOfWork- Overrides:
writeChangesin 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:
commitRootUnitOfWorkin classRepeatableWriteUnitOfWork
-
calculateChanges
public UnitOfWorkChangeSet calculateChanges(java.util.Map registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)
INTERNAL: Changes are calculated on the client, so avoid recalculating them on the server.- Overrides:
calculateChangesin classUnitOfWorkImpl
-
resumeUnitOfWork
public void resumeUnitOfWork()
INTERNAL: Resume is not required on the server.- Overrides:
resumeUnitOfWorkin classUnitOfWorkImpl
-
commitRootUnitOfWorkOnClient
protected void commitRootUnitOfWorkOnClient()
Merges remote unit of work to parent remote session.
-
executeQuery
public java.lang.Object executeQuery(java.lang.String queryName) throws DatabaseExceptionPUBLIC: 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:
executeQueryin interfaceSession- Overrides:
executeQueryin classAbstractSession- Throws:
DatabaseException- See Also:
AbstractSession.addQuery(String, DatabaseQuery)
-
executeQuery
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass) throws DatabaseExceptionPUBLIC: 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:
executeQueryin interfaceSession- Overrides:
executeQueryin classAbstractSession- Throws:
DatabaseException- See Also:
DescriptorQueryManager.addQuery(String, DatabaseQuery)
-
executeQuery
public java.lang.Object executeQuery(java.lang.String queryName, java.lang.Class domainClass, java.util.Vector argumentValues) throws DatabaseExceptionPUBLIC: 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:
executeQueryin classAbstractSession- Throws:
DatabaseException- See Also:
DescriptorQueryManager.addQuery(String, DatabaseQuery)
-
executeQuery
public java.lang.Object executeQuery(java.lang.String queryName, java.util.Vector argumentValues) throws DatabaseExceptionPUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.- Overrides:
executeQueryin classAbstractSession- Throws:
DatabaseException- See Also:
AbstractSession.addQuery(String, DatabaseQuery)
-
getDescriptor
public ClassDescriptor getDescriptor(java.lang.Class domainClass)
Return the table descriptor specified for the class.- Specified by:
getDescriptorin interfaceCoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>- Specified by:
getDescriptorin interfaceSession- Overrides:
getDescriptorin classAbstractSession
-
getDescriptorForAlias
public ClassDescriptor getDescriptorForAlias(java.lang.String alias)
Return the table descriptor specified for the class.- Specified by:
getDescriptorForAliasin interfaceSession- Overrides:
getDescriptorForAliasin classAbstractSession- Parameters:
alias- The descriptor alias.- Returns:
- The descriptor for the alias or
nullif no descriptor was found.
-
getNewObjectsCache
public java.util.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:
getPlatformin interfaceSession- Overrides:
getPlatformin classAbstractSession
-
getDatasourcePlatform
public Platform getDatasourcePlatform()
INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior.- Specified by:
getDatasourcePlatformin interfaceCoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>- Specified by:
getDatasourcePlatformin interfaceSession- Overrides:
getDatasourcePlatformin classAbstractSession
-
getUnregisteredNewObjectsCache
public java.util.List getUnregisteredNewObjectsCache()
Returns an unregistered new object cache
-
internalExecuteQuery
public java.lang.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:
internalExecuteQueryin classUnitOfWorkImpl- Throws:
DatabaseExceptionQueryException
-
isOnClient
protected boolean isOnClient()
-
isRemoteUnitOfWork
public boolean isRemoteUnitOfWork()
Return if this session is a unit of work.- Specified by:
isRemoteUnitOfWorkin interfaceSession- Overrides:
isRemoteUnitOfWorkin 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, java.util.Map cloneMap, AbstractSession session)
INTERNAL: Fix the transient fields in the serialized change set.
-
setIsOnClient
protected void setIsOnClient(boolean isOnClient)
-
setNewObjectsCache
protected void setNewObjectsCache(java.util.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(java.util.List unregisteredNewObjectsCache)
Set unregistered new object cache
-
toString
public java.lang.String toString()
Avoid the toString printing the accessor and platform.- Overrides:
toStringin classAbstractSession
-
verifyDelete
public boolean verifyDelete(java.lang.Object domainObject)
TESTING: This is used by testing code to ensure that a deletion was successful.- Overrides:
verifyDeletein classAbstractSession
-
-