Class ClientSession
- 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.sessions.server.ClientSession
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>,CommandProcessor,Session
public class ClientSession extends org.eclipse.persistence.internal.sessions.AbstractSessionPurpose: 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:
- Allow units of work to be acquired and pass them the client login's exclusive connection.
- Forward all requests and queries to its parent server session.
This class is an implementation of
Session. Please refer to that class for a full API. The public interface should be used.- See Also:
Server,Session,UnitOfWork, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionPolicyconnectionPolicyprotected booleanisActiveprotected ServerSessionparentprotected org.eclipse.persistence.internal.sequencing.Sequencingsequencingprotected java.util.Map<java.lang.String,org.eclipse.persistence.internal.databaseaccess.Accessor>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 Modifier Constructor Description protectedClientSession(Project project)ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)INTERNAL: Create and return a new client session.ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, java.util.Map properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.persistence.internal.databaseaccess.AccessoraddWriteConnection(java.lang.String poolName, org.eclipse.persistence.internal.databaseaccess.Accessor writeConnection)INTERNAL: Add the connection to the client session.voidbasicCommitTransaction()INTERNAL: This is internal to the unit of work and should not be called otherwise.voidbasicRollbackTransaction()INTERNAL: This is internal to the unit of work and should not be called otherwise.voidconnect(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)INTERNAL: Connect the session only (this must be the write connection as the read is shared).booleancontainsQuery(java.lang.String queryName)INTERNAL: Was PUBLIC: customer will be redirected toSession.voiddisconnect(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)INTERNAL: Disconnect the accessor only (this must be the write connection as the read is shared).java.lang.ObjectexecuteCall(Call call, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, DatabaseQuery query)INTERNAL: Execute the call on the correct connection accessor.org.eclipse.persistence.internal.databaseaccess.AccessorgetAccessor()INTERNAL: This should normally not be used, getAccessors() should be used to support partitioning.java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor>getAccessors()INTERNAL: Return the write connections if in a transaction.CommandManagergetCommandManager()INTERNAL: Return the manager that allows this processor to receive or propagate commands from/to TopLink clusterConnectionPolicygetConnectionPolicy()ADVANCED: This method will return the connection policy that was used during the acquisition of this client session.java.util.Map<java.lang.Class,ClassDescriptor>getDescriptors()ADVANCED: Return all registered descriptors.org.eclipse.persistence.internal.sessions.AbstractSessiongetExecutionSession(DatabaseQuery query)INTERNAL: Gets the session which this query will be executed on.ServerSessiongetParent()INTERNAL: Return the parent.org.eclipse.persistence.internal.sessions.AbstractSessiongetParentIdentityMapSession(ClassDescriptor descriptor, boolean canReturnSelf, boolean terminalOnly)INTERNAL: Returns the appropriate IdentityMap session for this descriptor.java.lang.ObjectgetProperty(java.lang.String name)Search for and return the user defined property from this client session, if it not found then search for the property from parent.DatabaseQuerygetQuery(java.lang.String name)INTERNAL: Was PUBLIC: customer will be redirected toSession.DatabaseQuerygetQuery(java.lang.String name, java.util.Vector args)INTERNAL:org.eclipse.persistence.internal.sequencing.SequencinggetSequencing()INTERNAL: Return the Sequencing object used by the session.ServerPlatformgetServerPlatform()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)java.lang.StringgetSessionTypeString()INTERNAL: Returns the type of session, its class.org.eclipse.persistence.internal.databaseaccess.AccessorgetWriteConnection()INTERNAL: Return the connection to be used for database modification.java.util.Map<java.lang.String,org.eclipse.persistence.internal.databaseaccess.Accessor>getWriteConnections()INTERNAL: Return the map of write connections.booleanhasWriteConnection()INTERNAL: Return if this session has been connected.voidinitializeIdentityMapAccessor()INTERNAL: Set up the IdentityMapManager.voidinitializeSequencing()INTERNAL: was ADVANCED: Creates sequencing object for the session.booleanisActive()INTERNAL: Was PUBLIC: customer will be redirected toSession.booleanisClientSession()INTERNAL: Return if this session is a client session.booleanisConnected()INTERNAL: Was PUBLIC: customer will be redirected toSession.booleanisExclusiveConnectionRequired()INTERNAL: This method is called in case externalConnectionPooling is used.voidrelease()INTERNAL: Was PUBLIC: customer will be redirected toSession.voidreleaseConnectionAfterCall(DatabaseQuery query)INTERNAL: Release (if required) connection after call.voidreleaseJTSConnection()INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener.voidreleaseReadConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection)INTERNAL: Release the cursor query's connection.protected voidreleaseWriteConnection()INTERNAL: This is internal to the unit of work and should not be called otherwise.java.lang.ObjectretryQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, DatabaseException databaseException, int retryCount, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: A query execution failed due to an invalid query.DatabaseExceptionretryTransaction(org.eclipse.persistence.internal.databaseaccess.Accessor writeConnection, DatabaseException databaseException, int retryCount, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: A begin transaction failed.voidsetConnectionPolicy(ConnectionPolicy connectionPolicy)INTERNAL: Set the connection policy.protected voidsetIsActive(boolean isActive)INTERNAL: Set if the client session is active (has not been released).protected voidsetParent(ServerSession parent)INTERNAL: Set the parent.voidsetWriteConnection(org.eclipse.persistence.internal.databaseaccess.Accessor writeConnection)INTERNAL: Set the connection to be used for database modification.voidsetWriteConnections(java.util.Map<java.lang.String,org.eclipse.persistence.internal.databaseaccess.Accessor> writeConnections)INTERNAL: Set the connection to be used for database modification.booleanshouldPropagateChanges()INTERNAL: Return whether changes should be propagated to TopLink cluster.java.lang.StringtoString()INTERNAL: Print the connection status with the session.-
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, copyObject, copyObject, copyReadOnlyClasses, createCloneQueryValueHolder, createCloneTransformationValueHolder, createInjectionManager, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, 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, getCacheKeyFromTargetSessionForMerge, 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, isIsolatedClientSession, isJPAQueriesProcessed, isLoggingOff, isProtectedSession, isRemoteSession, 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, 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
-
-
-
-
Field Detail
-
parent
protected ServerSession parent
-
connectionPolicy
protected ConnectionPolicy connectionPolicy
-
writeConnections
protected java.util.Map<java.lang.String,org.eclipse.persistence.internal.databaseaccess.Accessor> writeConnections
-
isActive
protected boolean isActive
-
sequencing
protected org.eclipse.persistence.internal.sequencing.Sequencing sequencing
-
-
Constructor Detail
-
ClientSession
public ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)
INTERNAL: Create and return a new client session.
-
ClientSession
public ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy, java.util.Map properties)
-
ClientSession
protected ClientSession(Project project)
-
-
Method Detail
-
releaseJTSConnection
public void releaseJTSConnection()
INTERNAL: Called in the end of beforeCompletion of external transaction synchronization listener. Close the managed sql connection corresponding to the external transaction and releases accessor.- Overrides:
releaseJTSConnectionin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
basicCommitTransaction
public void basicCommitTransaction()
INTERNAL: This is internal to the unit of work and should not be called otherwise.- Overrides:
basicCommitTransactionin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
basicRollbackTransaction
public void basicRollbackTransaction()
INTERNAL: This is internal to the unit of work and should not be called otherwise.- Overrides:
basicRollbackTransactionin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
connect
public void connect(org.eclipse.persistence.internal.databaseaccess.Accessor accessor) throws DatabaseExceptionINTERNAL: Connect the session only (this must be the write connection as the read is shared).- Throws:
DatabaseException
-
containsQuery
public boolean containsQuery(java.lang.String queryName)
INTERNAL: Was PUBLIC: customer will be redirected toSession. Return true if the pre-defined query is defined on the session.- Specified by:
containsQueryin interfaceSession- Overrides:
containsQueryin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
disconnect
public void disconnect(org.eclipse.persistence.internal.databaseaccess.Accessor accessor) throws DatabaseExceptionINTERNAL: Disconnect the accessor only (this must be the write connection as the read is shared).- Throws:
DatabaseException
-
executeCall
public java.lang.Object executeCall(Call call, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException
INTERNAL: Execute the call on the correct connection accessor. Outside of a transaction the server session's read connection pool is used. In side a transaction, or for exclusive sessions the write connection is used. For partitioning there may be multiple write connections.- Overrides:
executeCallin classorg.eclipse.persistence.internal.sessions.AbstractSession- Throws:
DatabaseException
-
releaseConnectionAfterCall
public void releaseConnectionAfterCall(DatabaseQuery query)
INTERNAL: Release (if required) connection after call.- Overrides:
releaseConnectionAfterCallin classorg.eclipse.persistence.internal.sessions.AbstractSession- Parameters:
query-
-
getAccessors
public java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor> getAccessors()
INTERNAL: Return the write connections if in a transaction. These may be empty/null until the first query has been executed inside the transaction. This should only be called within a transaction. If outside of a transaction it will return null (unless using an exclusive connection).- Overrides:
getAccessorsin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getAccessor
public org.eclipse.persistence.internal.databaseaccess.Accessor getAccessor()
INTERNAL: This should normally not be used, getAccessors() should be used to support partitioning. To maintain backward compatibility, and to support certain cases that required a default accessor, if inside a transaction, then a default connection will be allocated. This is required for sequencing, and JPA connection unwrapping, and ordt mappings. Outside of a transaction, to maintain backward compatibility the server session's accessor will be returned.- Overrides:
getAccessorin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getConnectionPolicy
public ConnectionPolicy getConnectionPolicy()
ADVANCED: This method will return the connection policy that was used during the acquisition of this client session. The properties within the ConnectionPolicy may be used when acquiring an exclusive connection for an IsolatedSession.
-
getDescriptors
public java.util.Map<java.lang.Class,ClassDescriptor> getDescriptors()
ADVANCED: Return all registered descriptors.- Specified by:
getDescriptorsin interfaceCoreSession<ClassDescriptor,Login,org.eclipse.persistence.internal.databaseaccess.Platform,Project,SessionEventManager>- Specified by:
getDescriptorsin interfaceSession- Overrides:
getDescriptorsin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getParentIdentityMapSession
public org.eclipse.persistence.internal.sessions.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:
getParentIdentityMapSessionin classorg.eclipse.persistence.internal.sessions.AbstractSession- Parameters:
canReturnSelf- true when method calls itself. If the path starting atthisis 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
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Search for and return the user defined property from this client session, if it not found then search for the property from parent.- Specified by:
getPropertyin interfaceSession- Overrides:
getPropertyin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getExecutionSession
public org.eclipse.persistence.internal.sessions.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:
getExecutionSessionin classorg.eclipse.persistence.internal.sessions.AbstractSession- Parameters:
query- may store session name or reference class for brokers case- Returns:
- a session with a live accessor
-
getParent
public ServerSession getParent()
INTERNAL: Return the parent. This is a server session.- Overrides:
getParentin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getQuery
public DatabaseQuery getQuery(java.lang.String name)
INTERNAL: Was PUBLIC: customer will be redirected toSession. Return the query from the session pre-defined queries with the given name. This allows for common queries to be pre-defined, reused and executed by name.
-
getQuery
public DatabaseQuery getQuery(java.lang.String name, java.util.Vector args)
INTERNAL:- Overrides:
getQueryin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
initializeSequencing
public void initializeSequencing()
INTERNAL: was ADVANCED: Creates sequencing object for the session. Typically there is no need for the user to call this method - it is called from the constructor.
-
getSequencing
public org.eclipse.persistence.internal.sequencing.Sequencing getSequencing()
INTERNAL: Return the Sequencing object used by the session. Lazy init sequencing to defer from client session creation to improve creation performance.- Overrides:
getSequencingin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getServerPlatform
public ServerPlatform 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)- Specified by:
getServerPlatformin interfaceSession- Overrides:
getServerPlatformin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getSessionTypeString
public java.lang.String getSessionTypeString()
INTERNAL: Returns the type of session, its class.Override to hide from the user when they are using an internal subclass of a known class.
A user does not need to know that their UnitOfWork is a non-deferred UnitOfWork, or that their ClientSession is an IsolatedClientSession.
- Overrides:
getSessionTypeStringin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getWriteConnections
public java.util.Map<java.lang.String,org.eclipse.persistence.internal.databaseaccess.Accessor> getWriteConnections()
INTERNAL: Return the map of write connections. Multiple connections can be used for data partitioning and replication. The connections are keyed by connection pool name.
-
getWriteConnection
public org.eclipse.persistence.internal.databaseaccess.Accessor getWriteConnection()
INTERNAL: Return the connection to be used for database modification.
-
hasWriteConnection
public boolean hasWriteConnection()
INTERNAL: Return if this session has been connected.
-
initializeIdentityMapAccessor
public void initializeIdentityMapAccessor()
INTERNAL: Set up the IdentityMapManager. This method allows subclasses of Session to override the default IdentityMapManager functionality.- Overrides:
initializeIdentityMapAccessorin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
isActive
public boolean isActive()
INTERNAL: Was PUBLIC: customer will be redirected toSession. Return if the client session is active (has not been released).
-
isClientSession
public boolean isClientSession()
INTERNAL: Return if this session is a client session.- Specified by:
isClientSessionin interfaceSession- Overrides:
isClientSessionin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
isConnected
public boolean isConnected()
INTERNAL: Was PUBLIC: customer will be redirected toSession. Return if this session has been connected to the database.- Specified by:
isConnectedin interfaceSession- Overrides:
isConnectedin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
release
public void release() throws DatabaseExceptionINTERNAL: Was PUBLIC: customer will be redirected toSession. Release the client session. This releases the client session back to it server. Normally this will logout of the client session's connection, and allow the client session to garbage collect.- Specified by:
releasein interfaceSession- Overrides:
releasein classorg.eclipse.persistence.internal.sessions.AbstractSession- Throws:
DatabaseException
-
retryQuery
public java.lang.Object retryQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, DatabaseException databaseException, int retryCount, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: A query execution failed due to an invalid query. Re-connect and retry the query.- Overrides:
retryQueryin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
releaseWriteConnection
protected void releaseWriteConnection()
INTERNAL: This is internal to the unit of work and should not be called otherwise.
-
setConnectionPolicy
public void setConnectionPolicy(ConnectionPolicy connectionPolicy)
INTERNAL: Set the connection policy.
-
setIsActive
protected void setIsActive(boolean isActive)
INTERNAL: Set if the client session is active (has not been released).
-
setParent
protected void setParent(ServerSession parent)
INTERNAL: Set the parent. This is a server session.
-
addWriteConnection
public org.eclipse.persistence.internal.databaseaccess.Accessor addWriteConnection(java.lang.String poolName, org.eclipse.persistence.internal.databaseaccess.Accessor writeConnection)INTERNAL: Add the connection to the client session. Multiple connections are supported to allow data partitioning and replication. The accessor is returned, as if detected to be dead it may be replaced.
-
retryTransaction
public DatabaseException retryTransaction(org.eclipse.persistence.internal.databaseaccess.Accessor writeConnection, DatabaseException databaseException, int retryCount, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: A begin transaction failed. Re-connect and retry the begin transaction.- Overrides:
retryTransactionin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
setWriteConnections
public void setWriteConnections(java.util.Map<java.lang.String,org.eclipse.persistence.internal.databaseaccess.Accessor> writeConnections)
INTERNAL: Set the connection to be used for database modification.
-
setWriteConnection
public void setWriteConnection(org.eclipse.persistence.internal.databaseaccess.Accessor writeConnection)
INTERNAL: Set the connection to be used for database modification.
-
toString
public java.lang.String toString()
INTERNAL: Print the connection status with the session.- Overrides:
toStringin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
getCommandManager
public CommandManager getCommandManager()
INTERNAL: Return the manager that allows this processor to receive or propagate commands from/to TopLink cluster- Specified by:
getCommandManagerin interfaceCommandProcessor- Overrides:
getCommandManagerin classorg.eclipse.persistence.internal.sessions.AbstractSession- Returns:
- a remote command manager
- See Also:
CommandManager
-
shouldPropagateChanges
public boolean shouldPropagateChanges()
INTERNAL: Return whether changes should be propagated to TopLink cluster. This is one of the required cache synchronization setting- Overrides:
shouldPropagateChangesin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
releaseReadConnection
public void releaseReadConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection)
INTERNAL: Release the cursor query's connection.- Overrides:
releaseReadConnectionin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
isExclusiveConnectionRequired
public boolean isExclusiveConnectionRequired()
INTERNAL: This method is called in case externalConnectionPooling is used. If returns true, accessor used by the session keeps its connection open until released by the session.- Overrides:
isExclusiveConnectionRequiredin classorg.eclipse.persistence.internal.sessions.AbstractSession
-
-