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

public Class ClientSession

extends AbstractSession
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.IsolatedClientSession
Imports
java.util.*, java.io.*, org.eclipse.persistence.platform.server.ServerPlatform, org.eclipse.persistence.queries.*, org.eclipse.persistence.descriptors.ClassDescriptor, .SchemaPerMultitenantPolicy, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.databaseaccess.*, org.eclipse.persistence.internal.sequencing.Sequencing, .SequencingFactory, org.eclipse.persistence.sessions.coordination.CommandManager, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.internal.sessions.*, org.eclipse.persistence.sessions.DatabaseLogin, .SessionProfiler

Purpose: Acts as a client to the server session.

Description: This session is brokered by the server session for use in three-tiered applications. It is used to store the context of the connection, i.e. the login to be used for this client. This allows each client connected to the server to contain its own user login.

Responsibilities:

This class is an implementation of org.eclipse.persistence.sessions.Session. Please refer to that class for a full API. The public interface should be used.

See Also
Server, org.eclipse.persistence.sessions.Session, org.eclipse.persistence.sessions.UnitOfWork

Field Summary

Modifier and TypeField and Description
protected ConnectionPolicy
protected boolean
protected ServerSession
protected Sequencing
protected Map<String, Accessor>
Inherited from org.eclipse.persistence.internal.sessions.AbstractSession:
accessorsactiveCommandThreadsattributeGroupsbrokercommandManagercommitManagerdefaultReferenceModedeferredEventsdescriptorseventManagerexceptionHandlerexternalTransactionControlleridentityMapAccessorinjectionManagerintegrityCheckerisConcurrentisExecutingEventsisFinalizersEnabledisInBrokerisInProfileisLoggingOffisSynchronizedjpaQueriesProcessedlastDescriptorAccessedlogSessionStringmetadatalistenermultitenantContextPropertiesnamenumberOfActiveUnitsOfWorkobjectsLockedForClonepartitioningPolicypessimisticLockTimeoutDefaultpessimisticLockTimeoutUnitDefaultplatformprofilerprojectpropertiesqueriesqueryBuilderqueryTimeoutDefaultqueryTimeoutUnitDefaultserializersessionLogshouldCheckWriteLockshouldOptimizeResultSetAccessshouldPropagateChangesstaticMetamodelClassestablePerTenantDescriptorstablePerTenantQueriestolerateInvalidJPQLtransactionMutexwasJTSTransactionInternallyStarted

Constructor Summary

AccessConstructor and Description
public
ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)

INTERNAL: Create and return a new client session.

public
ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, Map<K, V> properties)

protected

Method Summary

Modifier and TypeMethod and Description
public Accessor
addWriteConnection(String poolName, Accessor writeConnection)

INTERNAL: Add the connection to the client session.

public void
basicCommitTransaction()

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

INTERNAL: This is internal to the unit of work and should not be called otherwise.
public void
basicRollbackTransaction()

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

INTERNAL: This is internal to the unit of work and should not be called otherwise.
public void
connect(Accessor accessor)

INTERNAL: Connect the session only (this must be the write connection as the read is shared).

public boolean
public void
disconnect(Accessor accessor)

INTERNAL: Disconnect the accessor only (this must be the write connection as the read is shared).

public Object
executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query)

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

INTERNAL: Execute the call on the correct connection accessor.
public Accessor
getAccessor()

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

INTERNAL: This should normally not be used, getAccessors() should be used to support partitioning.
public Collection<Accessor>
getAccessors()

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

INTERNAL: Return the write connections if in a transaction.
public CommandManager

Returns:

a remote command manager
getCommandManager
()

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

Implements org.eclipse.persistence.sessions.coordination.CommandProcessor.getCommandManager.

INTERNAL: Return the manager that allows this processor to receive or propagate commands from/to TopLink cluster
public ConnectionPolicy
getConnectionPolicy()

ADVANCED: This method will return the connection policy that was used during the acquisition of this client session.

public Map<Class<?>, ClassDescriptor>
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.internal.sessions.AbstractSession.getExecutionSession.

INTERNAL: Gets the session which this query will be executed on.
public ServerSession
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.internal.sessions.AbstractSession.getParentIdentityMapSession.

INTERNAL: Returns the appropriate IdentityMap session for this descriptor.
public Object
getProperty(String name)

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

Implements org.eclipse.persistence.sessions.Session.getProperty.

Search for and return the user defined property from this client session, if it not found then search for the property from parent.
public DatabaseQuery
public DatabaseQuery
public Sequencing
getSequencing()

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

INTERNAL: Return the Sequencing object used by the session.
public ServerPlatform
getServerPlatform()

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

Implements org.eclipse.persistence.sessions.Session.getServerPlatform.

INTERNAL: Marked internal as this is not customer API but helper methods for accessing the server platform from within other sessions types (i.e. not DatabaseSession)
public String
public Accessor
getWriteConnection()

INTERNAL: Return the connection to be used for database modification.

public Map<String, Accessor>
getWriteConnections()

INTERNAL: Return the map of write connections.

public boolean
hasWriteConnection()

INTERNAL: Return if this session has been connected.

public void
public void
initializeSequencing()

INTERNAL: was ADVANCED: Creates sequencing object for the session.

public boolean
isActive()

INTERNAL: Was PUBLIC: customer will be redirected to org.eclipse.persistence.sessions.Session.

public boolean
public boolean
public boolean
isExclusiveConnectionRequired()

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

INTERNAL: This method is called in case externalConnectionPooling is used.
public void
public void
public void
releaseJTSConnection()

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

INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener.
public void
releaseReadConnection(Accessor connection)

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

INTERNAL: Release the cursor query's connection.
protected void
releaseWriteConnection()

INTERNAL: This is internal to the unit of work and should not be called otherwise.

public Object
retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)

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

INTERNAL: A query execution failed due to an invalid query.
public DatabaseException
retryTransaction(Accessor writeConnection, DatabaseException databaseException, int retryCount, AbstractSession executionSession)

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

INTERNAL: A begin transaction failed.
public void
setConnectionPolicy(ConnectionPolicy connectionPolicy)

INTERNAL: Set the connection policy.

protected void
setIsActive(boolean isActive)

INTERNAL: Set if the client session is active (has not been released).

protected void
setParent(ServerSession parent)

INTERNAL: Set the parent.

public void
setWriteConnection(Accessor writeConnection)

INTERNAL: Set the connection to be used for database modification.

public void
setWriteConnections(Map<String, Accessor> writeConnections)

INTERNAL: Set the connection to be used for database modification.

public boolean
shouldPropagateChanges()

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

INTERNAL: Return whether changes should be propagated to TopLink cluster.
public String
toString()

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

INTERNAL: Print the connection status with the session.
Inherited from org.eclipse.persistence.internal.sessions.AbstractSession:
acquireHistoricalSessionacquireNonSynchronizedUnitOfWorkacquireNonSynchronizedUnitOfWorkacquireRepeatableWriteUnitOfWorkacquireUnitOfWorkacquireUnitOfWorkaddAliasaddJPAQueryaddJPATablePerTenantQueryaddMultitenantContextPropertyaddQueryaddQueryaddQueryaddStaticMetamodelClassaddTablePerTenantDescriptoraddTablePerTenantQuerybasicBeginTransactionbasicBeginTransactionbasicExecuteCallbeginExternalTransactionbeginTransactionbuildDefaultQueryBuildercheckAndRefreshInvalidObjectcheckHierarchyForDescriptorcleanUpInjectionManagerclearDescriptorsclearIntegrityCheckerclearLastDescriptorAccessedclearProfileclonecommitExternalTransactioncommitTransactioncompareObjectscompareObjectsDontMatchconfigcopycopycopyDescriptorNamedQueriescopyDescriptorsFromProjectcopyInternalcopyReadOnlyClassescreateCloneQueryValueHoldercreateCloneTransformationValueHoldercreateInjectionManagercreateProtectedInstanceFromCachedDatadeferEventdeleteAllObjectsdeleteObjectdoesObjectExistdontLogMessagesendOperationProfileendOperationProfileexecuteDeferredEventsexecuteNonSelectingCallexecuteNonSelectingSQLexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteQueryexecuteSelectingCallexecuteSQLfinefinerfinestgetAccessorsgetActiveCommandThreadsgetActiveSessiongetActiveUnitOfWorkgetAliasDescriptorsgetAllQueriesgetAsOfClausegetAttributeGroupsgetBrokergetCacheKeyFromTargetSessionForMergegetClassDescriptorgetClassDescriptorgetClassDescriptorForAliasgetCommitManagergetDatasourceLogingetDatasourcePlatformgetDefaultReadOnlyClassesgetDefaultReferenceModegetDescriptorgetDescriptorgetDescriptorForAliasgetEventManagergetExceptionHandlergetExceptionHandlerClassgetExternalTransactionControllergetIdgetIdentityMapAccessorgetIdentityMapAccessorInstancegetInjectionManagergetIntegrityCheckergetJPAQueriesgetJPATablePerTenantQueriesgetLoadergetLoggetLogingetLogLevelgetLogLevelgetLogSessionStringgetMappedSuperclassgetMultitenantContextPropertiesgetNamegetNextQueryIdgetNextSequenceNumberValuegetNumberOfActiveUnitsOfWorkgetParentIdentityMapSessiongetParentIdentityMapSessiongetPartitioningPolicygetPessimisticLockTimeoutDefaultgetPessimisticLockTimeoutUnitDefaultgetPlatformgetPlatformgetProfilergetProjectgetPropertiesgetQueriesgetQuerygetQuerygetQueryBuildergetQueryTimeoutDefaultgetQueryTimeoutUnitDefaultgetRefreshMetadataListenergetRootSessiongetSerializergetSessionForClassgetSessionForNamegetSessionLoggetStaticMetamodelClassgetTablePerTenantDescriptorsgetTablePerTenantQueriesgetTransactionMutexhandleExceptionhandleSeverehasBrokerhasCommitManagerhasDescriptorhasEventManagerhasExceptionHandlerhasExternalTransactionControllerhasPropertieshasTablePerTenantDescriptorshasTablePerTenantQueriesincrementProfileincrementProfileinfoinsertObjectinternalExecuteQueryisBrokerisClassReadOnlyisClassReadOnlyisConcurrentisConsideredInvalidisDatabaseSessionisDistributedSessionisExclusiveIsolatedClientSessionisFinalizersEnabledisHistoricalSessionisInBrokerisInProfileisInTransactionisIsolatedClientSessionisJPAQueriesProcessedisLoggingOffisProtectedSessionisRemoteSessionisRemoteUnitOfWorkisServerSessionisSessionBrokerisSynchronizedisUnitOfWorkkeyFromObjectloadloadlogloglogloglogloglogloglogMessagelogMessagelogThrowablepostAcquireConnectionprepareDatabaseQuerypreReleaseConnectionpriviledgedExecuteNonSelectingCallpriviledgedExecuteSelectingCallprocessCommandprocessJPAQueriesprocessJPAQueryreadAllObjectsreadAllObjectsreadAllObjectsreadAllObjectsreadObjectreadObjectreadObjectreadObjectreadObjectrefreshAndLockObjectrefreshAndLockObjectrefreshObjectregisterFinalizerreleaseUnitOfWorkremovePropertyremoveQueryremoveQueryretrieveCacheKeyrollbackExternalTransactionrollbackTransactionsetAccessorsetBrokersetCommandManagersetCommitManagersetDatasourceLoginsetDefaultReferenceModesetEventManagersetExceptionHandlersetExternalTransactionControllersetInjectionManagersetIntegrityCheckersetIsConcurrentsetIsFinalizersEnabledsetIsInBrokersetIsInProfilesetJPAQueriesProcessedsetLogsetLoggingOffsetLoginsetLoginsetLogLevelsetNamesetNumberOfActiveUnitsOfWorksetPartitioningPolicysetPessimisticLockTimeoutDefaultsetPessimisticLockTimeoutUnitDefaultsetProfilersetProjectsetPropertiessetPropertysetQueriessetQueryBuildersetQueryTimeoutDefaultsetQueryTimeoutUnitDefaultsetRefreshMetadataListenersetSerializersetSessionLogsetShouldOptimizeResultSetAccesssetShouldPropagateChangessetSynchronizedsetTolerateInvalidJPQLsetTransactionMutexsetWasJTSTransactionInternallyStartedsevereshouldDisplayDatashouldLogshouldLogMessagesshouldLogMessagesshouldOptimizeResultSetAccessshouldTolerateInvalidJPQLstartOperationProfilestartOperationProfileunwrapObjectupdateObjectupdateProfileupdateTablePerTenantDescriptorsvalidateCachevalidateQueryverifyDeletewarningwasJTSTransactionInternallyStartedwrapObjectwriteAllObjectsWithChangeSetwriteObjectwritesCompleted