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.Sequencingsequencingprotected booleanshouldEnableDistributedIndirectionGarbageCollection-
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 SessionacquireHistoricalSession(AsOfClause clause)INTERNAL: Acquires a special historical session for reading objects as of a past time.org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWorkacquireRepeatableWriteUnitOfWork(ReferenceMode referenceMode)PUBLIC: Return a repeatable write unit of work for this session.org.eclipse.persistence.internal.sessions.UnitOfWorkImplacquireUnitOfWork()PUBLIC: Return a unit of work for this session.org.eclipse.persistence.internal.sessions.UnitOfWorkImplacquireUnitOfWork(ReferenceMode referenceMode)PUBLIC: Return a unit of work for this session.java.lang.ObjectexecuteQuery(DatabaseQuery query)PUBLIC: Execute the database query.LogingetDatasourceLogin()PUBLIC: Return the login.java.lang.ObjectgetObjectCorrespondingTo(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.ObjectgetObjectsCorrespondingToAll(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.SequencinggetSequencing()INTERNAL: Return the Sequencing object used by the session.voidinitializeSequencing()ADVANCED: Creates sequencing object for the session.java.lang.ObjectinstantiateRemoteValueHolderOnServer(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)INTERNAL: This will instantiate value holder on the server.booleanisRemoteSession()INTERNAL: Return if this session is remote.voidsetShouldEnableDistributedIndirectionGarbageCollection(boolean shouldEnableDistributedIndirectionGarbageCollection)ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.booleanshouldEnableDistributedIndirectionGarbageCollection()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:
acquireHistoricalSessionin interfaceSession- Overrides:
acquireHistoricalSessionin classorg.eclipse.persistence.internal.sessions.AbstractSession- Parameters:
clause- Represents a valid snap shot time.- Throws:
ValidationException- ifthisnot 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:
acquireUnitOfWorkin interfaceSession- Specified by:
acquireUnitOfWorkin 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:
acquireUnitOfWorkin interfaceSession- Overrides:
acquireUnitOfWorkin 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:
acquireRepeatableWriteUnitOfWorkin classorg.eclipse.persistence.internal.sessions.AbstractSession- See Also:
RepeatableWriteUnitOfWork
-
executeQuery
public java.lang.Object executeQuery(DatabaseQuery query)
PUBLIC: Execute the database query.- Specified by:
executeQueryin interfaceSession- Specified by:
executeQueryin 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:
getDatasourceLoginin interfaceCoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>- Specified by:
getDatasourceLoginin interfaceSession- Overrides:
getDatasourceLoginin 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:
getObjectCorrespondingToin 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:
getObjectsCorrespondingToAllin 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:
instantiateRemoteValueHolderOnServerin classDistributedSession
-
isRemoteSession
public boolean isRemoteSession()
INTERNAL: Return if this session is remote.- Specified by:
isRemoteSessionin interfaceSession- Overrides:
isRemoteSessionin 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:
getSequencingin 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:
initializeSequencingin classorg.eclipse.persistence.internal.sessions.DatabaseSessionImpl
-
-