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

public Class IsolatedClientSession

extends ClientSession
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.ExclusiveIsolatedClientSession
Imports
java.util.Map, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.sessions.server.*, org.eclipse.persistence.queries.*, org.eclipse.persistence.internal.descriptors.ObjectBuilder, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.sessions.AbstractSession

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.

Field Summary

Inherited from org.eclipse.persistence.sessions.server.ClientSession:
connectionPolicyisActiveparentsequencingwriteConnections

Constructor Summary

AccessConstructor and Description
public
public
IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, Map<K, V> properties)

Method Summary

Modifier and TypeMethod and Description
protected CacheKey
getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager)

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

INTERNAL: For use within the merge process this method will get an object from the shared cache using a readlock.
public AbstractSession

Returns:

a session with a live accessor
getExecutionSession
(DatabaseQuery
may store session name or reference class for brokers case
query
)

Overrides org.eclipse.persistence.sessions.server.ClientSession.getExecutionSession.

INTERNAL: Gets the session which this query will be executed on.
public AbstractSession

Returns:

Session with the required IdentityMap
getParentIdentityMapSession
(ClassDescriptor descriptor, boolean
true when method calls itself. If the path starting at this is acceptable. Sometimes true if want to move to the first valid session, i.e. executing on ClientSession when really should be on ServerSession.
canReturnSelf
,
boolean
return the last session in the chain where the Enitity is stored.
terminalOnly
)

Overrides org.eclipse.persistence.sessions.server.ClientSession.getParentIdentityMapSession.

INTERNAL: Returns the appropriate IdentityMap session for this descriptor.
public void
public boolean
isIsolatedClientSession()

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

public boolean
isProtectedSession()

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

PUBLIC: Returns true if Protected Entities should be built within this session
protected boolean
shouldExecuteLocally(DatabaseQuery query)

INTERNAL: Helper method to calculate whether to execute this query locally or send it to the server session.

Inherited from org.eclipse.persistence.sessions.server.ClientSession:
addWriteConnectionbasicCommitTransactionbasicRollbackTransactionconnectcontainsQuerydisconnectexecuteCallgetAccessorgetAccessorsgetCommandManagergetConnectionPolicygetDescriptorsgetParentgetPropertygetQuerygetQuerygetSequencinggetServerPlatformgetSessionTypeStringgetWriteConnectiongetWriteConnectionshasWriteConnectioninitializeSequencingisActiveisClientSessionisConnectedisExclusiveConnectionRequiredreleasereleaseConnectionAfterCallreleaseJTSConnectionreleaseReadConnectionreleaseWriteConnectionretryQueryretryTransactionsetConnectionPolicysetIsActivesetParentsetWriteConnectionsetWriteConnectionsshouldPropagateChangestoString

Constructor Detail

IsolatedClientSessionback to summary
public IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)
IsolatedClientSessionback to summary
public IsolatedClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, Map<K, V> properties)

Method Detail

getCacheKeyFromTargetSessionForMergeback to summary
protected CacheKey getCacheKeyFromTargetSessionForMerge(Object implementation, ObjectBuilder builder, ClassDescriptor descriptor, MergeManager mergeManager)

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

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.

Annotations
@Override
getExecutionSessionback to summary
public AbstractSession getExecutionSession(DatabaseQuery query)

Overrides org.eclipse.persistence.sessions.server.ClientSession.getExecutionSession.

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.

Parameters
query:DatabaseQuery

may store session name or reference class for brokers case

Returns:AbstractSession

a session with a live accessor

Annotations
@Override
getParentIdentityMapSessionback to summary
public AbstractSession getParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)

Overrides org.eclipse.persistence.sessions.server.ClientSession.getParentIdentityMapSession.

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.

Parameters
canReturnSelf:boolean

true when method calls itself. If the path starting at this 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:boolean

return the last session in the chain where the Enitity is stored.

Returns:AbstractSession

Session with the required IdentityMap

Annotations
@Override
initializeIdentityMapAccessorback to summary
public void initializeIdentityMapAccessor()

Overrides org.eclipse.persistence.sessions.server.ClientSession.initializeIdentityMapAccessor.

INTERNAL: Set up the IdentityMapManager. This method allows subclasses of Session to override the default IdentityMapManager functionality.

Annotations
@Override
isIsolatedClientSessionback to summary
public boolean isIsolatedClientSession()

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

PUBLIC: Return if this session is an isolated client session.

Annotations
@Override
isIsolatedQueryback to summary
protected boolean isIsolatedQuery(DatabaseQuery query)

INTERNAL: Answers if this query is an isolated query and must be executed locally.

isProtectedSessionback to summary
public boolean isProtectedSession()

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

PUBLIC: Returns true if Protected Entities should be built within this session

Annotations
@Override
shouldExecuteLocallyback to summary
protected boolean shouldExecuteLocally(DatabaseQuery query)

INTERNAL: Helper method to calculate whether to execute this query locally or send it to the server session.