Class RemoteSession
- java.lang.Object
-
- org.eclipse.persistence.internal.core.sessions.CoreAbstractSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>
-
- org.eclipse.persistence.internal.sessions.AbstractSession
-
- org.eclipse.persistence.internal.sessions.DatabaseSessionImpl
-
- org.eclipse.persistence.sessions.remote.DistributedSession
-
- org.eclipse.persistence.sessions.remote.RemoteSession
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,CoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>
,CommandProcessor
,DatabaseSession
,Session
public class RemoteSession extends DistributedSession
Purpose: Provide transparent remote three-tiered replacation support. The remote session allows for complex three-tiered applications to be easily built. It gives the remote client the fully functionality of the TopLink api including,- Client side caching and object-identity maintainence.
- Complex query support
- Unit of work support
- Indirection support through remote value holders.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.persistence.internal.sequencing.Sequencing
sequencing
protected boolean
shouldEnableDistributedIndirectionGarbageCollection
-
Fields inherited from class org.eclipse.persistence.sessions.remote.DistributedSession
hasDefaultReadOnlyClasses, isMetadataRemote, remoteConnection
-
Fields inherited from class org.eclipse.persistence.internal.sessions.DatabaseSessionImpl
connectedTime, databaseEventListener, isLoggedIn, sequencingHome, serverPlatform, tuner
-
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 RemoteSession()
RemoteSession(org.eclipse.persistence.internal.sessions.remote.RemoteConnection remoteConnection)
PUBLIC: Creates a RemoteSession.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Session
acquireHistoricalSession(AsOfClause clause)
INTERNAL: Acquires a special historical session for reading objects as of a past time.org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork
acquireRepeatableWriteUnitOfWork(ReferenceMode referenceMode)
PUBLIC: Return a repeatable write unit of work for this session.org.eclipse.persistence.internal.sessions.UnitOfWorkImpl
acquireUnitOfWork()
PUBLIC: Return a unit of work for this session.org.eclipse.persistence.internal.sessions.UnitOfWorkImpl
acquireUnitOfWork(ReferenceMode referenceMode)
PUBLIC: Return a unit of work for this session.java.lang.Object
executeQuery(DatabaseQuery query)
PUBLIC: Execute the database query.Login
getDatasourceLogin()
PUBLIC: Return the login.java.lang.Object
getObjectCorrespondingTo(java.lang.Object serverSideDomainObject, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.java.lang.Object
getObjectsCorrespondingToAll(java.lang.Object serverSideDomainObjects, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.org.eclipse.persistence.internal.sequencing.Sequencing
getSequencing()
INTERNAL: Return the Sequencing object used by the session.void
initializeSequencing()
ADVANCED: Creates sequencing object for the session.java.lang.Object
instantiateRemoteValueHolderOnServer(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
INTERNAL: This will instantiate value holder on the server.boolean
isRemoteSession()
INTERNAL: Return if this session is remote.void
setShouldEnableDistributedIndirectionGarbageCollection(boolean shouldEnableDistributedIndirectionGarbageCollection)
ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.boolean
shouldEnableDistributedIndirectionGarbageCollection()
ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.-
Methods inherited from class org.eclipse.persistence.sessions.remote.DistributedSession
beginTransaction, commitTransaction, connect, cursorSelectObjects, cursorSelectObjects, disconnect, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getDefaultReadOnlyClasses, getDescriptor, getDescriptorCorrespondingTo, getDescriptorForAlias, getRemoteConnection, hasCorrespondingDescriptor, initializeIdentityMapAccessor, isConnected, isDistributedSession, isMetadataRemote, login, loginAndDetectDatasource, logout, privilegedAddDescriptor, rollbackTransaction, setIsMetadataRemote, setRemoteConnection, toString
-
Methods inherited from class org.eclipse.persistence.internal.sessions.DatabaseSessionImpl
addDescriptor, addDescriptors, addDescriptors, addDescriptorsToSequencing, addSequence, finalize, getConnectedTime, getDatabaseEventListener, getDatasourcePlatform, getPlatform, getPlatform, getReadLogin, getSequencingControl, getSequencingHome, getServerPlatform, getTuner, initializeConnectedTime, initializeDescriptorIfSessionAlive, initializeDescriptors, initializeDescriptors, initializeDescriptors, initializeDescriptors, initializeDescriptors, isDatabaseSession, isLoggedIn, isProtectedSession, isSequencingCallbackRequired, login, login, postConnectDatasource, postLogin, preConnectDatasource, releaseJTSConnection, retryQuery, setDatabaseEventListener, setDatasourceAndInitialize, setOrDetectDatasource, setSequencingHome, setServerPlatform, setTuner, writeAllObjects, writeAllObjects
-
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
acquireNonSynchronizedUnitOfWork, acquireNonSynchronizedUnitOfWork, addAlias, addJPAQuery, addJPATablePerTenantQuery, addMultitenantContextProperty, addQuery, addQuery, addQuery, addStaticMetamodelClass, addTablePerTenantDescriptor, addTablePerTenantQuery, basicBeginTransaction, basicBeginTransaction, basicCommitTransaction, basicExecuteCall, basicRollbackTransaction, beginExternalTransaction, buildDefaultQueryBuilder, checkAndRefreshInvalidObject, checkHierarchyForDescriptor, cleanUpInjectionManager, clearDescriptors, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitExternalTransaction, compareObjects, compareObjectsDontMatch, config, containsQuery, copy, copy, copyDescriptorNamedQueries, copyDescriptorsFromProject, copyInternal, copyObject, copyObject, copyReadOnlyClasses, createCloneQueryValueHolder, createCloneTransformationValueHolder, createInjectionManager, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, endOperationProfile, executeCall, executeDeferredEvents, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, fine, finer, finest, getAccessor, getAccessors, getAccessors, getActiveCommandThreads, getActiveSession, getActiveUnitOfWork, getAliasDescriptors, getAllQueries, getAsOfClause, getAttributeGroups, getBroker, getCacheKeyFromTargetSessionForMerge, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getCommandManager, getCommitManager, getDefaultReferenceMode, getDescriptor, getDescriptors, getEventManager, getExceptionHandler, getExceptionHandlerClass, getExecutionSession, getExternalTransactionController, getId, getIdentityMapAccessor, getIdentityMapAccessorInstance, getInjectionManager, getIntegrityChecker, getJPAQueries, getJPATablePerTenantQueries, getLoader, getLog, getLogin, getLogLevel, getLogLevel, getLogSessionString, getMappedSuperclass, getMultitenantContextProperties, getName, getNextQueryId, getNextSequenceNumberValue, getNumberOfActiveUnitsOfWork, getParent, getParentIdentityMapSession, getParentIdentityMapSession, getParentIdentityMapSession, getPartitioningPolicy, getPessimisticLockTimeoutDefault, getPessimisticLockTimeoutUnitDefault, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getQuery, getQuery, getQuery, getQueryBuilder, getQueryTimeoutDefault, getQueryTimeoutUnitDefault, getRefreshMetadataListener, getRootSession, getSerializer, getSessionForClass, getSessionForName, getSessionLog, getSessionTypeString, getStaticMetamodelClass, getTablePerTenantDescriptors, getTablePerTenantQueries, getTransactionMutex, handleException, handleSevere, hasBroker, hasCommitManager, hasDescriptor, hasEventManager, hasExceptionHandler, hasExternalTransactionController, hasProperties, hasTablePerTenantDescriptors, hasTablePerTenantQueries, incrementProfile, incrementProfile, info, insertObject, internalExecuteQuery, isBroker, isClassReadOnly, isClassReadOnly, isClientSession, isConcurrent, isConsideredInvalid, isExclusiveConnectionRequired, isExclusiveIsolatedClientSession, isFinalizersEnabled, isHistoricalSession, isInBroker, isInProfile, isInTransaction, isIsolatedClientSession, isJPAQueriesProcessed, isLoggingOff, isRemoteUnitOfWork, isServerSession, isSessionBroker, isSynchronized, isUnitOfWork, 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, release, releaseConnectionAfterCall, releaseReadConnection, 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, setSynchronized, setTolerateInvalidJPQL, setTransactionMutex, setWasJTSTransactionInternallyStarted, severe, shouldDisplayData, shouldLog, shouldLogMessages, shouldLogMessages, shouldOptimizeResultSetAccess, shouldPropagateChanges, shouldTolerateInvalidJPQL, startOperationProfile, startOperationProfile, unwrapObject, updateObject, updateProfile, updateTablePerTenantDescriptors, validateCache, validateQuery, verifyDelete, warning, wasJTSTransactionInternallyStarted, wrapObject, writeAllObjectsWithChangeSet, writeObject, writesCompleted
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.sessions.DatabaseSession
deleteAllObjects, deleteObject, getCommandManager, insertObject, isInTransaction, refreshAndLockObject, refreshAndLockObject, setCommandManager, setDatasourceLogin, setExternalTransactionController, setLogin, setShouldPropagateChanges, shouldPropagateChanges, updateObject, writeObject
-
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, executeSelectingCall, executeSQL, getActiveSession, getActiveUnitOfWork, getAsOfClause, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getDefaultReferenceMode, getDescriptor, getDescriptors, getEventManager, getExceptionHandler, getExternalTransactionController, getId, getIdentityMapAccessor, getIntegrityChecker, getJPAQueries, getLog, getLogin, getLogLevel, getLogLevel, getName, getNextSequenceNumberValue, getPartitioningPolicy, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getQuery, getSerializer, getSessionLog, handleException, handleSevere, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, isClientSession, isFinalizersEnabled, isInProfile, isRemoteUnitOfWork, isServerSession, isSessionBroker, isUnitOfWork, keyFromObject, log, logMessage, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, refreshObject, release, removeProperty, removeQuery, setDefaultReferenceMode, setExceptionHandler, setIntegrityChecker, setIsFinalizersEnabled, setLog, setLogLevel, setName, setPartitioningPolicy, setProfiler, setProperty, setQueryTimeoutDefault, setQueryTimeoutUnitDefault, setSerializer, setSessionLog, shouldLog, shouldLogMessages, validateCache
-
-
-
-
Constructor Detail
-
RemoteSession
public RemoteSession()
-
RemoteSession
public RemoteSession(org.eclipse.persistence.internal.sessions.remote.RemoteConnection remoteConnection)
PUBLIC: Creates a RemoteSession.- Parameters:
remoteConnection
- remote session requires a remote connection. This must be accessed remotely from the client through RMI or CORBA.
-
-
Method Detail
-
setShouldEnableDistributedIndirectionGarbageCollection
public void setShouldEnableDistributedIndirectionGarbageCollection(boolean shouldEnableDistributedIndirectionGarbageCollection)
ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.
-
shouldEnableDistributedIndirectionGarbageCollection
public boolean shouldEnableDistributedIndirectionGarbageCollection()
ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.
-
acquireHistoricalSession
public Session acquireHistoricalSession(AsOfClause clause) throws ValidationException
INTERNAL: Acquires a special historical session for reading objects as of a past time.- Specified by:
acquireHistoricalSession
in interfaceSession
- Overrides:
acquireHistoricalSession
in classorg.eclipse.persistence.internal.sessions.AbstractSession
- Parameters:
clause
- Represents a valid snap shot time.- Throws:
ValidationException
- ifthis
not a ClientSession, plain Session, or SessionBroker.- See Also:
AsOfClause
,Expression.asOf(org.eclipse.persistence.history.AsOfClause)
,ObjectLevelReadQuery.setAsOfClause(org.eclipse.persistence.history.AsOfClause)
,HistoryPolicy
-
acquireUnitOfWork
public org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork()
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.- Specified by:
acquireUnitOfWork
in interfaceSession
- Specified by:
acquireUnitOfWork
in classDistributedSession
- See Also:
UnitOfWorkImpl
-
acquireUnitOfWork
public org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.- Specified by:
acquireUnitOfWork
in interfaceSession
- Overrides:
acquireUnitOfWork
in classorg.eclipse.persistence.internal.sessions.AbstractSession
- 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 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
-
acquireRepeatableWriteUnitOfWork
public org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork acquireRepeatableWriteUnitOfWork(ReferenceMode referenceMode)
PUBLIC: Return a repeatable write unit of work for this session. A repeatable write unit of work allows multiple writeChanges (flushes).- Overrides:
acquireRepeatableWriteUnitOfWork
in classorg.eclipse.persistence.internal.sessions.AbstractSession
- See Also:
RepeatableWriteUnitOfWork
-
executeQuery
public java.lang.Object executeQuery(DatabaseQuery query)
PUBLIC: Execute the database query.- Specified by:
executeQuery
in interfaceSession
- Specified by:
executeQuery
in classDistributedSession
- See Also:
DatabaseQuery
-
getDatasourceLogin
public Login getDatasourceLogin()
PUBLIC: Return the login. This must retrieve the login information from the server this first time called. This is useful to be able to do things differently depending on the database platform.- Specified by:
getDatasourceLogin
in interfaceCoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>
- Specified by:
getDatasourceLogin
in interfaceSession
- Overrides:
getDatasourceLogin
in classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getObjectCorrespondingTo
public java.lang.Object getObjectCorrespondingTo(java.lang.Object serverSideDomainObject, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.- Specified by:
getObjectCorrespondingTo
in classDistributedSession
-
getObjectsCorrespondingToAll
public java.lang.Object getObjectsCorrespondingToAll(java.lang.Object serverSideDomainObjects, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.- Specified by:
getObjectsCorrespondingToAll
in classDistributedSession
-
instantiateRemoteValueHolderOnServer
public java.lang.Object instantiateRemoteValueHolderOnServer(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
INTERNAL: This will instantiate value holder on the server.- Specified by:
instantiateRemoteValueHolderOnServer
in classDistributedSession
-
isRemoteSession
public boolean isRemoteSession()
INTERNAL: Return if this session is remote.- Specified by:
isRemoteSession
in interfaceSession
- Overrides:
isRemoteSession
in classDistributedSession
-
getSequencing
public org.eclipse.persistence.internal.sequencing.Sequencing getSequencing()
INTERNAL: Return the Sequencing object used by the session. Sequences may be provided locally, or remotely.- Overrides:
getSequencing
in classorg.eclipse.persistence.internal.sessions.DatabaseSessionImpl
-
initializeSequencing
public void initializeSequencing()
ADVANCED: Creates sequencing object for the session. Sequences may be provided locally, or remotely.- Overrides:
initializeSequencing
in classorg.eclipse.persistence.internal.sessions.DatabaseSessionImpl
-
-