Class IsolatedClientSession
- java.lang.Object
-
- org.eclipse.persistence.internal.core.sessions.CoreAbstractSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
-
- org.eclipse.persistence.internal.sessions.AbstractSession
-
- org.eclipse.persistence.sessions.server.ClientSession
-
- org.eclipse.persistence.internal.sessions.IsolatedClientSession
-
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreSession<ClassDescriptor,Login,Platform,Project,SessionEventManager>
,CommandProcessor
,Session
- Direct Known Subclasses:
ExclusiveIsolatedClientSession
public class IsolatedClientSession extends ClientSession
Provides isolation support by allowing a client session to have a local cache of the subset of the classes. This can be used to avoid caching frequently changing data, or for security or VPD purposes.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.sessions.server.ClientSession
connectionPolicy, isActive, parent, sequencing, writeConnections
-
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 IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)
IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, Map properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CacheKey
getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager)
INTERNAL: For use within the merge process this method will get an object from the shared cache using a readlock.AbstractSession
getExecutionSession(DatabaseQuery query)
INTERNAL: Gets the session which this query will be executed on.AbstractSession
getParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)
INTERNAL: Returns the appropriate IdentityMap session for this descriptor.void
initializeIdentityMapAccessor()
INTERNAL: Set up the IdentityMapManager.boolean
isIsolatedClientSession()
PUBLIC: Return if this session is an isolated client session.protected boolean
isIsolatedQuery(DatabaseQuery query)
INTERNAL: Answers if this query is an isolated query and must be executed locally.boolean
isProtectedSession()
PUBLIC: Returns true if Protected Entities should be built within this sessionprotected boolean
shouldExecuteLocally(DatabaseQuery query)
INTERNAL: Helper method to calculate whether to execute this query locally or send it to the server session.-
Methods inherited from class org.eclipse.persistence.sessions.server.ClientSession
addWriteConnection, basicCommitTransaction, basicRollbackTransaction, connect, containsQuery, disconnect, executeCall, getAccessor, getAccessors, getCommandManager, getConnectionPolicy, getDescriptors, getParent, getProperty, getQuery, getQuery, getSequencing, getServerPlatform, getSessionTypeString, getWriteConnection, getWriteConnections, hasWriteConnection, initializeSequencing, isActive, isClientSession, isConnected, isExclusiveConnectionRequired, release, releaseConnectionAfterCall, releaseJTSConnection, releaseReadConnection, releaseWriteConnection, retryQuery, retryTransaction, setConnectionPolicy, setIsActive, setParent, setWriteConnection, setWriteConnections, shouldPropagateChanges, toString
-
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
acquireHistoricalSession, acquireNonSynchronizedUnitOfWork, acquireNonSynchronizedUnitOfWork, acquireRepeatableWriteUnitOfWork, acquireUnitOfWork, acquireUnitOfWork, addAlias, addJPAQuery, addJPATablePerTenantQuery, addMultitenantContextProperty, addQuery, addQuery, addQuery, addStaticMetamodelClass, addTablePerTenantDescriptor, addTablePerTenantQuery, basicBeginTransaction, basicBeginTransaction, basicExecuteCall, beginExternalTransaction, beginTransaction, buildDefaultQueryBuilder, checkAndRefreshInvalidObject, checkHierarchyForDescriptor, cleanUpInjectionManager, clearDescriptors, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitExternalTransaction, commitTransaction, compareObjects, compareObjectsDontMatch, config, copy, copy, copyDescriptorNamedQueries, copyDescriptorsFromProject, copyInternal, copyReadOnlyClasses, createCloneQueryValueHolder, createCloneTransformationValueHolder, createInjectionManager, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, endOperationProfile, executeDeferredEvents, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, fine, finer, finest, getAccessors, getActiveCommandThreads, getActiveSession, getActiveUnitOfWork, getAliasDescriptors, getAllQueries, getAsOfClause, getAttributeGroups, getBroker, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getCommitManager, getDatasourceLogin, getDatasourcePlatform, getDefaultReadOnlyClasses, getDefaultReferenceMode, getDescriptor, getDescriptor, getDescriptorForAlias, 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, getPlatform, getPlatform, 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, internalExecuteQuery, isBroker, isClassReadOnly, isClassReadOnly, isConcurrent, isConsideredInvalid, isDatabaseSession, isDistributedSession, isExclusiveIsolatedClientSession, isFinalizersEnabled, isHistoricalSession, isInBroker, isInProfile, isInTransaction, isJPAQueriesProcessed, isLoggingOff, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isSynchronized, isUnitOfWork, keyFromObject, load, load, log, log, log, log, log, log, log, log, logMessage, logMessage, logThrowable, postAcquireConnection, prepareDatabaseQuery, preReleaseConnection, priviledgedExecuteNonSelectingCall, priviledgedExecuteSelectingCall, processCommand, processJPAQueries, processJPAQuery, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshAndLockObject, refreshAndLockObject, refreshObject, registerFinalizer, releaseUnitOfWork, removeProperty, removeQuery, removeQuery, retrieveCacheKey, rollbackExternalTransaction, rollbackTransaction, 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, shouldTolerateInvalidJPQL, startOperationProfile, startOperationProfile, unwrapObject, updateObject, updateProfile, updateTablePerTenantDescriptors, validateCache, validateQuery, verifyDelete, warning, wasJTSTransactionInternallyStarted, wrapObject, writeAllObjectsWithChangeSet, writeObject, writesCompleted
-
-
-
-
Constructor Detail
-
IsolatedClientSession
public IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)
-
IsolatedClientSession
public IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, Map properties)
-
-
Method Detail
-
initializeIdentityMapAccessor
public void initializeIdentityMapAccessor()
INTERNAL: Set up the IdentityMapManager. This method allows subclasses of Session to override the default IdentityMapManager functionality.- Overrides:
initializeIdentityMapAccessor
in classClientSession
-
shouldExecuteLocally
protected boolean shouldExecuteLocally(DatabaseQuery query)
INTERNAL: Helper method to calculate whether to execute this query locally or send it to the server session.
-
isIsolatedQuery
protected boolean isIsolatedQuery(DatabaseQuery query)
INTERNAL: Answers if this query is an isolated query and must be executed locally.
-
getParentIdentityMapSession
public AbstractSession getParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)
INTERNAL: Returns the appropriate IdentityMap session for this descriptor. Sessions can be chained and each session can have its own Cache/IdentityMap. Entities can be stored at different levels based on Cache Isolation. This method will return the correct Session for a particular Entity class based on the Isolation Level and the attributes provided.- Overrides:
getParentIdentityMapSession
in classClientSession
- Parameters:
canReturnSelf
- true when method calls itself. If the path starting atthis
is acceptable. Sometimes true if want to move to the first valid session, i.e. executing on ClientSession when really should be on ServerSession.terminalOnly
- return the last session in the chain where the Enitity is stored.- Returns:
- Session with the required IdentityMap
-
getCacheKeyFromTargetSessionForMerge
protected CacheKey getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager)
INTERNAL: For use within the merge process this method will get an object from the shared cache using a readlock. If a readlock is unavailable then the merge manager will be transitioned to deferred locks and a deferred lock will be used.- Overrides:
getCacheKeyFromTargetSessionForMerge
in classAbstractSession
-
getExecutionSession
public AbstractSession getExecutionSession(DatabaseQuery query)
INTERNAL: Gets the session which this query will be executed on. Generally will be called immediately before the call is translated, which is immediately before session.executeCall.Since the execution session also knows the correct datasource platform to execute on, it is often used in the mappings where the platform is needed for type conversion, or where calls are translated.
Is also the session with the accessor. Will return a ClientSession if it is in transaction and has a write connection.
- Overrides:
getExecutionSession
in classClientSession
- Parameters:
query
- may store session name or reference class for brokers case- Returns:
- a session with a live accessor
-
isIsolatedClientSession
public boolean isIsolatedClientSession()
PUBLIC: Return if this session is an isolated client session.- Overrides:
isIsolatedClientSession
in classAbstractSession
-
isProtectedSession
public boolean isProtectedSession()
PUBLIC: Returns true if Protected Entities should be built within this session- Overrides:
isProtectedSession
in classAbstractSession
-
-