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

public Class RemoteUnitOfWork

extends RepeatableWriteUnitOfWork
Class Inheritance
Imports
java.util.*, org.eclipse.persistence.config.ReferenceMode, org.eclipse.persistence.descriptors.ClassDescriptor, .DescriptorQueryManager, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.sessions.*, org.eclipse.persistence.internal.databaseaccess.Platform, org.eclipse.persistence.internal.helper.*, org.eclipse.persistence.platform.database.DatabasePlatform, org.eclipse.persistence.queries.DatabaseQuery, .ObjectLevelReadQuery, org.eclipse.persistence.sessions.SessionProfiler, org.eclipse.persistence.sessions.remote.*, org.eclipse.persistence.logging.SessionLog

Counter part of the unit of work which exists on the client side.

Field Summary

Modifier and TypeField and Description
protected boolean
protected boolean
protected List<E>
protected transient RemoteSessionController
protected List<E>
Inherited from org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork:
classesToBeInvalidatedcumulativeUOWChangeSetdiscoverUnregisteredNewObjectsWithoutPersistflushClearCacheisWithinFlushshouldStoreBypassCacheshouldTerminateTransaction

Constructor Summary

AccessConstructor and Description
public
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
public UnitOfWorkImpl
public UnitOfWorkImpl
acquireUnitOfWork(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.
referenceMode
)

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

Implements org.eclipse.persistence.sessions.Session.acquireUnitOfWork.

The nested unit of work must also be remote.
public void
public UnitOfWorkChangeSet
calculateChanges(Map<K, V> registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)

Overrides org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges.

INTERNAL: Changes are calculated on the client, so avoid recalculating them on the server.
protected List<E>
collectNewObjects()

This is done to maintain correspondence between local new objects and returned new objects from serialization.

protected List<E>
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.

public void
protected void
commitRootUnitOfWorkOnClient()

Merges remote unit of work to parent remote session.

public Object
executeQuery(String queryName)

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

Implements org.eclipse.persistence.sessions.Session.executeQuery.

PUBLIC: Execute the pre-defined query by name and return the result.
public Object
executeQuery(String queryName, Class<?> domainClass)

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

Implements org.eclipse.persistence.sessions.Session.executeQuery.

PUBLIC: Execute the pre-defined query by name and return the result.
public Object
executeQuery(String queryName, Class<?> domainClass, Vector<E> argumentValues)

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

PUBLIC: Execute the pre-defined query by name and return the result.
public Object
executeQuery(String queryName, Vector<E> argumentValues)

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

PUBLIC: Execute the pre-defined query by name and return the result.
protected void
fixRemoteChangeSet(UnitOfWorkChangeSet uowChangeSet, Map<K, V> cloneMap, AbstractSession session)

INTERNAL: Fix the transient fields in the serialized change set.

public Platform
public ClassDescriptor
public ClassDescriptor
public List<E>
getNewObjectsCache()

Returns a new object cache

public RemoteSessionController
getParentSessionController()

INTERNAL: Method returns the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client

public DatabasePlatform
getPlatform()

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

Implements org.eclipse.persistence.sessions.Session.getPlatform.

INTERNAL: Return the database platform currently connected to.
public List<E>
getUnregisteredNewObjectsCache()

Returns an unregistered new object cache

public Object
internalExecuteQuery(DatabaseQuery query, AbstractRecord Record)

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

INTERNAL: Return the results from exeucting the database query.
public boolean
protected boolean
public boolean
protected void
prepareForMergeIntoRemoteUnitOfWork()

The returned remote unit of work from the server is prepared to merge with local remote unit of work.

public void
reinitializeForSession(AbstractSession session, RemoteSessionController parentSessionController)

INTERNAL: Re-initialize for the server-side session.

public void
resumeUnitOfWork()

Overrides org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.resumeUnitOfWork.

INTERNAL: Resume is not required on the server.
public void
setIsFlush(boolean isFlush)

protected void
setIsOnClient(boolean isOnClient)

protected void
setNewObjectsCache(List<E> newObjectsCache)

Set a new object cache

public void
setParentSessionController(RemoteSessionController parentSessionController)

INTERNAL: Sets the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client

protected void
setUnregisteredNewObjectsCache(List<E> unregisteredNewObjectsCache)

Set unregistered new object cache

public String
toString()

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

Avoid the toString printing the accessor and platform.
public boolean
verifyDelete(Object domainObject)

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

TESTING: This is used by testing code to ensure that a deletion was successful.
public void
Inherited from org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork:
checkHierarchyForDescriptorclearclearFlushClearCacheclearForClosecloneAndRegisterNewObjectcommitTransactiondiscoverUnregisteredNewObjectsgetClassesToBeInvalidatedgetCumulativeUOWChangeSetgetFlushClearCachegetUnregisteredDeletedCloneForOriginalisAfterWriteChangesButBeforeCommitisObjectDeletedissueSQLbeforeCompletionisWithinFlushmergeChangesIntoParentmergeCloneWithReferencesregisterNewObjectregisterNotRegisteredNewObjectForPersistrollbackTransactionrollbackTransactionsetCumulativeUOWChangeSetsetDiscoverUnregisteredNewObjectsWithoutPersistsetFlushClearCachesetShouldStoreByPassCachesetShouldTerminateTransactionshouldClearForCloseOnReleaseshouldDiscoverUnregisteredNewObjectsWithoutPersistshouldForceReadFromDBshouldStoreBypassCachesynchronizeAndResumeupdateChangeTrackersIfRequiredwasDeleted

Field Detail

isFlushback to summary
protected boolean isFlush
isOnClientback to summary
protected boolean isOnClient
newObjectsCacheback to summary
protected List<E> newObjectsCache
parentSessionControllerback to summary
protected transient RemoteSessionController parentSessionController
unregisteredNewObjectsCacheback to summary
protected List<E> unregisteredNewObjectsCache

Constructor Detail

RemoteUnitOfWorkback to summary
public RemoteUnitOfWork()
RemoteUnitOfWorkback to summary
public RemoteUnitOfWork(RemoteUnitOfWork parent)
RemoteUnitOfWorkback to summary
public RemoteUnitOfWork(DistributedSession parent)
RemoteUnitOfWorkback to summary
public RemoteUnitOfWork(RemoteUnitOfWork parent, ReferenceMode referenceMode)
RemoteUnitOfWorkback to summary
public RemoteUnitOfWork(DistributedSession parent, ReferenceMode referenceMode)

Method Detail

acquireUnitOfWorkback to summary
public UnitOfWorkImpl acquireUnitOfWork()

Overrides org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireUnitOfWork.

Implements org.eclipse.persistence.sessions.Session.acquireUnitOfWork.

The nested unit of work must also be remote.

Annotations
@Override
acquireUnitOfWorkback to summary
public UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)

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

Implements org.eclipse.persistence.sessions.Session.acquireUnitOfWork.

The nested unit of work must also be remote.

Parameters
referenceMode:ReferenceMode

Doc from org.eclipse.persistence.sessions.Session.acquireUnitOfWork.

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.

Annotations
@Override
beginEarlyTransactionback to summary
public void beginEarlyTransaction() throws DatabaseException

Overrides org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.beginEarlyTransaction.

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

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.

Annotations
@Override
See Also
commit(), release()
calculateChangesback to summary
public UnitOfWorkChangeSet calculateChanges(Map<K, V> registeredObjects, UnitOfWorkChangeSet changeSet, boolean assignSequences, boolean shouldCloneMap)

Overrides org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges.

INTERNAL: Changes are calculated on the client, so avoid recalculating them on the server.

Annotations
@Override
collectNewObjectsback to summary
protected List<E> 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.

collectUnregisteredNewObjectsback to summary
protected List<E> 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.

commitIntoRemoteUnitOfWorkback to summary
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.

commitRootUnitOfWorkback to summary
public void commitRootUnitOfWork()

Overrides org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.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.

Annotations
@Override
commitRootUnitOfWorkOnClientback to summary
protected void commitRootUnitOfWorkOnClient()

Merges remote unit of work to parent remote session.

executeQueryback to summary
public Object executeQuery(String queryName) throws DatabaseException

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

Implements org.eclipse.persistence.sessions.Session.executeQuery.

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.

Annotations
@Override
See Also
addQuery(String, DatabaseQuery)
executeQueryback to summary
public Object executeQuery(String queryName, Class<?> domainClass) throws DatabaseException

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

Implements org.eclipse.persistence.sessions.Session.executeQuery.

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.

Annotations
@Override
See Also
DescriptorQueryManager#addQuery(String, DatabaseQuery)
executeQueryback to summary
public Object executeQuery(String queryName, Class<?> domainClass, Vector<E> argumentValues) throws DatabaseException

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

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.

Annotations
@Override
See Also
DescriptorQueryManager#addQuery(String, DatabaseQuery)
executeQueryback to summary
public Object executeQuery(String queryName, Vector<E> argumentValues) throws DatabaseException

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

PUBLIC: Execute the pre-defined query by name and return the result. Queries can be pre-defined and named to allow for their reuse.

Annotations
@Override
See Also
addQuery(String, DatabaseQuery)
fixRemoteChangeSetback to summary
protected void fixRemoteChangeSet(UnitOfWorkChangeSet uowChangeSet, Map<K, V> cloneMap, AbstractSession session)

INTERNAL: Fix the transient fields in the serialized change set.

getDatasourcePlatformback to summary
public Platform getDatasourcePlatform()

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

Implements org.eclipse.persistence.sessions.Session.getDatasourcePlatform, org.eclipse.persistence.core.sessions.CoreSession.getDatasourcePlatform.

INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior.

Annotations
@Override
getDescriptorback to summary
public ClassDescriptor getDescriptor(Class<?> domainClass)

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

Implements org.eclipse.persistence.sessions.Session.getDescriptor, org.eclipse.persistence.core.sessions.CoreSession.getDescriptor.

Return the table descriptor specified for the class.

Annotations
@Override
getDescriptorForAliasback to summary
public ClassDescriptor getDescriptorForAlias(String alias)

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

Implements org.eclipse.persistence.sessions.Session.getDescriptorForAlias.

Return the table descriptor specified for the class.

Parameters
alias:String

Doc from org.eclipse.persistence.internal.sessions.AbstractSession.getDescriptorForAlias.

The descriptor alias.

Returns:ClassDescriptor

Doc from org.eclipse.persistence.internal.sessions.AbstractSession.getDescriptorForAlias.

The descriptor for the alias or null if no descriptor was found.

Annotations
@Override
getNewObjectsCacheback to summary
public List<E> getNewObjectsCache()

Returns a new object cache

getParentSessionControllerback to summary
public RemoteSessionController getParentSessionController()

INTERNAL: Method returns the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client

getPlatformback to summary
public DatabasePlatform getPlatform()

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

Implements org.eclipse.persistence.sessions.Session.getPlatform.

INTERNAL: Return the database platform currently connected to. The platform is used for database specific behavior.

Annotations
@Override
getUnregisteredNewObjectsCacheback to summary
public List<E> getUnregisteredNewObjectsCache()

Returns an unregistered new object cache

internalExecuteQueryback to summary
public Object internalExecuteQuery(DatabaseQuery query, AbstractRecord Record) throws DatabaseException, QueryException

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

INTERNAL: Return the results from exeucting the database query. the arguments should be a database row with raw data values.

Annotations
@Override
isFlushback to summary
public boolean isFlush()
isOnClientback to summary
protected boolean isOnClient()
isRemoteUnitOfWorkback to summary
public boolean isRemoteUnitOfWork()

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

Implements org.eclipse.persistence.sessions.Session.isRemoteUnitOfWork.

Return if this session is a unit of work.

Annotations
@Override
prepareForMergeIntoRemoteUnitOfWorkback to summary
protected void prepareForMergeIntoRemoteUnitOfWork()

The returned remote unit of work from the server is prepared to merge with local remote unit of work.

reinitializeForSessionback to summary
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.

resumeUnitOfWorkback to summary
public void resumeUnitOfWork()

Overrides org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.resumeUnitOfWork.

INTERNAL: Resume is not required on the server.

Annotations
@Override
setIsFlushback to summary
public void setIsFlush(boolean isFlush)
setIsOnClientback to summary
protected void setIsOnClient(boolean isOnClient)
setNewObjectsCacheback to summary
protected void setNewObjectsCache(List<E> newObjectsCache)

Set a new object cache

setParentSessionControllerback to summary
public void setParentSessionController(RemoteSessionController parentSessionController)

INTERNAL: Sets the parent RemoteSessionController for this Remote UnitOfWork Used to retrieve Valueholders that were used on the client

setUnregisteredNewObjectsCacheback to summary
protected void setUnregisteredNewObjectsCache(List<E> unregisteredNewObjectsCache)

Set unregistered new object cache

toStringback to summary
public String toString()

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

Avoid the toString printing the accessor and platform.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override
verifyDeleteback to summary
public boolean verifyDelete(Object domainObject)

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

TESTING: This is used by testing code to ensure that a deletion was successful.

Annotations
@Override
writeChangesback to summary
public void writeChanges()

Overrides org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges.

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

Simulate a flush, current just begins a transaction and commits.

Annotations
@Override