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

public Class SessionBroker

extends DatabaseSessionImpl
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.sessions.factories.SessionBrokerPlaceHolder
Imports
java.util.*, java.io.Writer, org.eclipse.persistence.queries.*, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.history.*, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.sequencing.Sequence, org.eclipse.persistence.sessions.ExternalTransactionController, .SessionProfiler, org.eclipse.persistence.internal.databaseaccess.*, org.eclipse.persistence.internal.identitymaps.*, org.eclipse.persistence.sessions.server.*, org.eclipse.persistence.internal.sequencing.SequencingHome, .Sequencing, .SequencingFactory, org.eclipse.persistence.internal.sessions.*

Purpose: Provide a single view to a TopLink session that transparently accesses multple databases.

Responsibilities:

Field Summary

Modifier and TypeField and Description
protected SessionBroker
protected Sequencing
protected Map<Class<?>, String>
protected Map<String, AbstractSession>
protected boolean
Inherited from org.eclipse.persistence.internal.sessions.DatabaseSessionImpl:
connectedTimedatabaseEventListenerisLoggedInsequencingHomeserverPlatformtuner

Constructor Summary

AccessConstructor and Description
public
SessionBroker()

PUBLIC: Create and return a session broker.

protected
SessionBroker(Map<K, V> sessionNames)

INTERNAL: Create and return a session broker.

Method Summary

Modifier and TypeMethod and Description
public SessionBroker
acquireClientSessionBroker()

PUBLIC: Return a session broker that behaves as a client session broker.

public SessionBroker
acquireClientSessionBroker(Map<String, ConnectionPolicy>
maps session name to connectionPolicy to be used for this session;
connectionPolicies
,
Map<K, V>
maps session name to properties to be used for this session.
mapOfProperties
)

PUBLIC: Return a session broker that behaves as a client session broker.

public Session
acquireHistoricalSession(AsOfClause
Represents a valid snap shot time.
clause
)

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

Implements org.eclipse.persistence.sessions.Session.acquireHistoricalSession.

INTERNAL: Acquires a special historical session for reading objects as of a past time.
public UnitOfWorkImpl
public void
addDescriptor(ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addDescriptor.

Implements org.eclipse.persistence.sessions.DatabaseSession.addDescriptor.

PUBLIC: You cannot add a descriptor to a session broker, you must add it to its session.
public void
addDescriptors(Vector<E> descriptors)

PUBLIC: You cannot add descriptors to a session broker, you must add them to its session.

public void
addDescriptors(Project project)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addDescriptors.

Implements org.eclipse.persistence.sessions.DatabaseSession.addDescriptors.

PUBLIC: You cannot add a project to a session broker, you must add it to its session.
public void
addSequence(Sequence sequence)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addSequence.

Implements org.eclipse.persistence.sessions.DatabaseSession.addSequence.

PUBLIC: You cannot add a sequence to a session broker, you must add it to its session.
protected void
basicBeginTransaction()

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

INTERNAL: Begin the transaction on all child sessions.
protected void
basicCommitTransaction()

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

INTERNAL: Commit the transaction on all child sessions.
protected void
basicRollbackTransaction()

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

INTERNAL: Rollback the transaction on all child sessions.
public boolean
containsQuery(String queryName)

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

Implements org.eclipse.persistence.sessions.Session.containsQuery.

PUBLIC: Return true if the pre-defined query is defined on the session.
protected SessionBroker
copySessionBroker()

INTERNAL: Return a copy (not using clone) of a session broker.

public Collection<Accessor>
getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)

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

INTERNAL: Return the low-level database accessors.
public AsOfClause

Returns:

An immutable object representation of the past time. null if no clause set, or this a regular session.
getAsOfClause
()

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

Implements org.eclipse.persistence.sessions.Session.getAsOfClause.

ADVANCED: Answers the past time this session is as of.
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 SessionBroker
getParent()

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

INTERNAL: Gets the parent SessionBroker.
public Platform
getPlatform(Class<?> domainClass)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.getPlatform.

INTERNAL: Return the platform for a particular class.
public DatabaseQuery
getQuery(String name, Vector<E> arguments, boolean
indicates whether parent should be searched if query not found.
shouldSearchParent
)

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

PUBLIC: Return the query from the session pre-defined queries with the given name and argument types.
public Sequencing
getSequencing()

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

PUBLIC: Return the Sequencing object used by the session.
protected SequencingHome
getSequencingHome()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.getSequencingHome.

PROTECTED: Session broker doesn't have SequencingHome.
public AbstractSession
getSessionForClass(Class<?> domainClass)

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

INTERNAL: Return the session to be used for the class.
public AbstractSession
protected AbstractSession
getSessionForQuery(DatabaseQuery query)

INTERNAL: Answers the session to be used for the given query.

protected Map<Class<?>, String>
getSessionNamesByClass()

INTERNAL: Return sessions indexed by class, each class can only have one default session.

public Map<String, AbstractSession>
getSessionsByName()

INTERNAL: Return sessions indexed by name.

public int
howManySequencingCallbacks()

INTERNAL: Returns a number of member sessions that require sequencing callback.

public void
initializeDescriptors()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors.

INTERNAL: Allow each descriptor to initialize any dependencies on this session.
public void
public void
initializeSequencing()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeSequencing.

ADVANCED: Creates sequencing object for the session broker.
public Object
internalExecuteQuery(DatabaseQuery query, AbstractRecord row)

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

INTERNAL: Return the results from exeucting the database query.
public boolean
isBroker()

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

INTERNAL: Returns true if the session is a session Broker.
public boolean
isClientSessionBroker()

PUBLIC: Return if this session is a client session broker.

public boolean
isConnected()

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

Implements org.eclipse.persistence.sessions.Session.isConnected.

PUBLIC: Return if all sessions are still connected to the database.
public boolean
public boolean
isServerSessionBroker()

PUBLIC: Return if this session is a server session broker.

public boolean
public void
login()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login.

Implements org.eclipse.persistence.sessions.DatabaseSession.login.

PUBLIC: Connect to the database using the predefined login.
public void
login(String userName, String password)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login.

Implements org.eclipse.persistence.sessions.DatabaseSession.login.

PUBLIC: Connect to the database using the predefined login.
public void
loginAndDetectDatasource()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource.

PUBLIC: Connect to the database using the predefined login.
public void
public void
postLogin()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postLogin.

INTERNAL: Rise postLogin events for member sessions and the SessionBroker.
public void
registerSession(String name, AbstractSession session)

PUBLIC: Register the session under its name.

public void
registerSession(String name, Session session)

PUBLIC: Register the session under its name.

public void
public void
releaseJTSConnection()

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

INTERNAL: Called in the end of beforeCompletion of external transaction sychronization listener.
public Object
retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)

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

INTERNAL: A query execution failed due to an invalid query.
public void
public void
public void
public void
public void
protected void
setSessionNameByClass(HashMap<K, V> sessionNameByClass)

INTERNAL: Set sessions indexed by class, each class can only have one default session.

public void
setSessionsByName(Map<K, V> sessionsByName)

INTERNAL: Set sessions indexed by name.

public void
setShouldUseDescriptorAliases(boolean shouldUseDescriptorAliases)

PUBLIC: Indicates whether descriptors should use aliasDescriptors map.

public void
setSynchronized(boolean synched)

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

INTERNAL: Set isSynchronized flag to indicate that members of session broker are synchronized.
public boolean
shouldUseDescriptorAliases()

PUBLIC: Indicates whether descriptors should use aliasDescriptors map.

public void
writesCompleted()

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

INTERNAL: This method notifies the accessor that a particular sets of writes has completed.
Inherited from org.eclipse.persistence.internal.sessions.DatabaseSessionImpl:
addDescriptorsaddDescriptorsToSequencingconnectdisconnectfinalizegetConnectedTimegetDatabaseEventListenergetDatasourcePlatformgetPlatformgetReadLogingetSequencingControlgetServerPlatformgetTunerinitializeConnectedTimeinitializeDescriptorIfSessionAliveinitializeDescriptorsinitializeDescriptorsinitializeDescriptorsinitializeDescriptorsisDatabaseSessionisLoggedInisProtectedSessionloginpostConnectDatasourcepreConnectDatasourcesetDatabaseEventListenersetDatasourceAndInitializesetOrDetectDatasourcesetSequencingHomesetServerPlatformsetTunerwriteAllObjectswriteAllObjects

Field Detail

parentback to summary
protected SessionBroker parent
sequencingback to summary
protected Sequencing sequencing
sessionNamesByClassback to summary
protected Map<Class<?>, String> sessionNamesByClass
sessionsByNameback to summary
protected Map<String, AbstractSession> sessionsByName
shouldUseDescriptorAliasesback to summary
protected boolean shouldUseDescriptorAliases

Constructor Detail

SessionBrokerback to summary
public SessionBroker()

PUBLIC: Create and return a session broker. Because a session broker has multiple sessions it does not used a login.

SessionBrokerback to summary
protected SessionBroker(Map<K, V> sessionNames)

INTERNAL: Create and return a session broker. Used internally to set the Names by Class from the parent. Reduces garbage.

Method Detail

acquireClientSessionBrokerback to summary
public SessionBroker acquireClientSessionBroker()

PUBLIC: Return a session broker that behaves as a client session broker. An acquire session broker is done under the covers on each session inside the session broker, and a new broker is returned.

Note

when finished with the client broker, it should be released.

acquireClientSessionBrokerback to summary
public SessionBroker acquireClientSessionBroker(Map<String, ConnectionPolicy> connectionPolicies, Map<K, V> mapOfProperties)

PUBLIC: Return a session broker that behaves as a client session broker. An acquire session broker is done under the covers on each session inside the session broker, and a new broker is returned.

Note

when finished with the client broker, it should be released.

Parameters
connectionPolicies:Map<String, ConnectionPolicy>

maps session name to connectionPolicy to be used for this session;

mapOfProperties:Map<K, V>

maps session name to properties to be used for this session.

acquireHistoricalSessionback to summary
public Session acquireHistoricalSession(AsOfClause clause) throws ValidationException

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

Implements org.eclipse.persistence.sessions.Session.acquireHistoricalSession.

INTERNAL: Acquires a special historical session for reading objects as of a past time.

Parameters
clause:AsOfClause

Doc from org.eclipse.persistence.sessions.Session.acquireHistoricalSession.

Represents a valid snap shot time.

Annotations
@Override
acquireUnitOfWorkback to summary
public UnitOfWorkImpl acquireUnitOfWork()

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

Implements org.eclipse.persistence.sessions.Session.acquireUnitOfWork.

PUBLIC: Return a unit of work for this session broker. Acquire a client session broker if is a server session broker.

Annotations
@Override
See Also
UnitOfWorkImpl
addDescriptorback to summary
public void addDescriptor(ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addDescriptor.

Implements org.eclipse.persistence.sessions.DatabaseSession.addDescriptor.

PUBLIC: You cannot add a descriptor to a session broker, you must add it to its session.

Annotations
@Override
addDescriptorsback to summary
public void addDescriptors(Vector<E> descriptors) throws ValidationException

PUBLIC: You cannot add descriptors to a session broker, you must add them to its session.

addDescriptorsback to summary
public void addDescriptors(Project project) throws ValidationException

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addDescriptors.

Implements org.eclipse.persistence.sessions.DatabaseSession.addDescriptors.

PUBLIC: You cannot add a project to a session broker, you must add it to its session.

Annotations
@Override
addSequenceback to summary
public void addSequence(Sequence sequence)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addSequence.

Implements org.eclipse.persistence.sessions.DatabaseSession.addSequence.

PUBLIC: You cannot add a sequence to a session broker, you must add it to its session.

Annotations
@Override
basicBeginTransactionback to summary
protected void basicBeginTransaction() throws DatabaseException

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

INTERNAL: Begin the transaction on all child sessions.

Annotations
@Override
basicCommitTransactionback to summary
protected void basicCommitTransaction() throws DatabaseException

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

INTERNAL: Commit the transaction on all child sessions. This assumes that the commit of the transaction will not fail because all of the modification has already taken place and no errors would have occurred.

Annotations
@Override
basicRollbackTransactionback to summary
protected void basicRollbackTransaction() throws DatabaseException

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

INTERNAL: Rollback the transaction on all child sessions.

Annotations
@Override
containsQueryback to summary
public boolean containsQuery(String queryName)

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

Implements org.eclipse.persistence.sessions.Session.containsQuery.

PUBLIC: Return true if the pre-defined query is defined on the session.

Annotations
@Override
copySessionBrokerback to summary
protected SessionBroker copySessionBroker()

INTERNAL: Return a copy (not using clone) of a session broker.

getAccessorsback to summary
public Collection<Accessor> getAccessors(Call call, AbstractRecord translationRow, DatabaseQuery query)

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

INTERNAL: Return the low-level database accessors. The database accessor is used for direct database access. The right accessor for this broker will be returned.

Annotations
@Override
getAsOfClauseback to summary
public AsOfClause getAsOfClause()

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

Implements org.eclipse.persistence.sessions.Session.getAsOfClause.

ADVANCED: Answers the past time this session is as of. Only meaningful for special historical sessions.

Returns:AsOfClause

An immutable object representation of the past time. null if no clause set, or this a regular session.

Annotations
@Override
See Also
AsOfClause, acquireHistoricalSession(AsOfClause), Expression.hasAsOfClause()
getExecutionSessionback to summary
public AbstractSession getExecutionSession(DatabaseQuery query)

Overrides org.eclipse.persistence.internal.sessions.AbstractSession.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
getParentback to summary
public SessionBroker getParent()

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

INTERNAL: Gets the parent SessionBroker.

Annotations
@Override
getPlatformback to summary
public Platform getPlatform(Class<?> domainClass)

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.getPlatform.

INTERNAL: Return the platform for a particular class.

Annotations
@Override
getQueryback to summary
public DatabaseQuery getQuery(String name, Vector<E> arguments, boolean shouldSearchParent)

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

PUBLIC: Return the query from the session pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. This method should be used if the Session has multiple queries with the same name but different arguments. The search order is: for ClientSessionBroker: the broker; it's member ClientSessions (but not their parent ServerSessions); the parent SessionBroker. for ServerSession or DatabaseSession SessionBroker: the broker; it's member ServerSessions (or DatabaseSessions).

Parameters
shouldSearchParent:boolean

Doc from org.eclipse.persistence.internal.sessions.AbstractSession.getQuery.

indicates whether parent should be searched if query not found.

Annotations
@Override
getSequencingback to summary
public Sequencing getSequencing()

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

PUBLIC: Return the Sequencing object used by the session.

Annotations
@Override
getSequencingHomeback to summary
protected SequencingHome getSequencingHome()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.getSequencingHome.

PROTECTED: Session broker doesn't have SequencingHome.

Annotations
@Override
getSessionForClassback to summary
public AbstractSession getSessionForClass(Class<?> domainClass) throws ValidationException

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

INTERNAL: Return the session to be used for the class.

Annotations
@Override
getSessionForNameback to summary
public AbstractSession getSessionForName(String name) throws ValidationException

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

INTERNAL: Return the session by name.

Annotations
@Override
getSessionForQueryback to summary
protected AbstractSession getSessionForQuery(DatabaseQuery query)

INTERNAL: Answers the session to be used for the given query.

getSessionNamesByClassback to summary
protected Map<Class<?>, String> getSessionNamesByClass()

INTERNAL: Return sessions indexed by class, each class can only have one default session.

getSessionsByNameback to summary
public Map<String, AbstractSession> getSessionsByName()

INTERNAL: Return sessions indexed by name.

howManySequencingCallbacksback to summary
public int howManySequencingCallbacks()

INTERNAL: Returns a number of member sessions that require sequencing callback. Always returns 0 if sequencing is not connected.

initializeDescriptorsback to summary
public void initializeDescriptors()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors.

INTERNAL: Allow each descriptor to initialize any dependencies on this session. This is done in two passes to allow the inheritance to be resolved first. Normally the descriptors are added before login, then initialized on login. Should not be called on client SessoionBroker

Annotations
@Override
initializeIdentityMapAccessorback to summary
public void initializeIdentityMapAccessor()

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

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

Annotations
@Override
initializeSequencingback to summary
public void initializeSequencing()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeSequencing.

ADVANCED: Creates sequencing object for the session broker. Typically there is no need for the user to call this method - it is called by login() and acquireClientSessionBroker.

Annotations
@Override
internalExecuteQueryback to summary
public Object internalExecuteQuery(DatabaseQuery query, AbstractRecord row) throws DatabaseException, QueryException

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

INTERNAL: Return the results from exeucting the database query. the arguments should be a database row with raw data values. Find the correct child session to broker the query to, and return the result of the session executing the query.

Annotations
@Override
isBrokerback to summary
public boolean isBroker()

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

INTERNAL: Returns true if the session is a session Broker.

Annotations
@Override
isClientSessionBrokerback to summary
public boolean isClientSessionBroker()

PUBLIC: Return if this session is a client session broker.

isConnectedback to summary
public boolean isConnected()

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

Implements org.eclipse.persistence.sessions.Session.isConnected.

PUBLIC: Return if all sessions are still connected to the database.

Annotations
@Override
isSequencingCallbackRequiredback to summary
public boolean isSequencingCallbackRequired()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.isSequencingCallbackRequired.

INTERNAL: Indicates whether SequencingCallback is required. Always returns false if sequencing is not connected.

Annotations
@Override
isServerSessionBrokerback to summary
public boolean isServerSessionBroker()

PUBLIC: Return if this session is a server session broker.

isSessionBrokerback to summary
public boolean isSessionBroker()

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

Implements org.eclipse.persistence.sessions.Session.isSessionBroker.

INTERNAL: Return if this session is a session broker.

Annotations
@Override
loginback to summary
public void login() throws DatabaseException

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login.

Implements org.eclipse.persistence.sessions.DatabaseSession.login.

PUBLIC: Connect to the database using the predefined login. This connects all of the child sessions and expects that they are in a valid state to be connected.

Annotations
@Override
loginback to summary
public void login(String userName, String password) throws DatabaseException

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login.

Implements org.eclipse.persistence.sessions.DatabaseSession.login.

PUBLIC: Connect to the database using the predefined login. This connects all of the child sessions and expects that they are in a valid state to be connected.

Annotations
@Override
loginAndDetectDatasourceback to summary
public void loginAndDetectDatasource() throws DatabaseException

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource.

PUBLIC: Connect to the database using the predefined login. During connection, attempt to auto detect the required database platform. This method can be used in systems where for ease of use developers have EclipseLink autodetect the platform. To be safe, however, the platform should be configured directly. The login must have been assigned when or after creating the session.

Annotations
@Override
logoutback to summary
public void logout() throws DatabaseException

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.logout.

Implements org.eclipse.persistence.sessions.DatabaseSession.logout.

PUBLIC: Disconnect from all databases.

Annotations
@Override
Exceptions
DatabaseException:
the database will also raise an error if their is an active transaction, or a general error occurs.
EclipseLinkException:
if a transaction is active, you must rollback any active transaction before logout.
postLoginback to summary
public void postLogin()

Overrides org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postLogin.

INTERNAL: Rise postLogin events for member sessions and the SessionBroker.

Annotations
@Override
registerSessionback to summary
public void registerSession(String name, AbstractSession session)

PUBLIC: Register the session under its name. All of the session's descriptors must have already been registered. DatabaseSession/ServerSession should not be connected and descriptors should not be initialized.

registerSessionback to summary
public void registerSession(String name, Session session)

PUBLIC: Register the session under its name. All of the session's descriptors must have already been registered. DatabaseSession/ServerSession should not be connected and descriptors should not be initialized.

releaseback to summary
public void release()

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

Implements org.eclipse.persistence.sessions.Session.release.

PUBLIC: Release the session. This does nothing by default, but allows for other sessions such as the ClientSession to do something.

Annotations
@Override
releaseJTSConnectionback to summary
public void releaseJTSConnection()

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

INTERNAL: Called in the end of beforeCompletion of external transaction sychronization listener. Close the managed sql connection corresponding to the external transaction, if applicable releases accessor.

Annotations
@Override
retryQueryback to summary
public Object retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)

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

INTERNAL: A query execution failed due to an invalid query. Re-connect and retry the query.

Annotations
@Override
setExternalTransactionControllerback to summary
public void setExternalTransactionController(ExternalTransactionController externalTransactionController)

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

Implements org.eclipse.persistence.sessions.DatabaseSession.setExternalTransactionController, org.eclipse.persistence.sessions.Session.setExternalTransactionController.

INTERNAL: Used for JTS integration internally by ServerPlatform.

Annotations
@Override
setIntegrityCheckerback to summary
public void setIntegrityChecker(IntegrityChecker integrityChecker)

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

Implements org.eclipse.persistence.sessions.Session.setIntegrityChecker.

PUBLIC: set the integrityChecker. IntegrityChecker holds all the ClassDescriptor Exceptions.

Annotations
@Override
setLogback to summary
public void setLog(Writer log)

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

Implements org.eclipse.persistence.sessions.Session.setLog.

PUBLIC: Set the message log.

Annotations
@Override
See Also
logMessage
setProfilerback to summary
public void setProfiler(SessionProfiler profiler)

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

Implements org.eclipse.persistence.sessions.Session.setProfiler.

PUBLIC: Set the profiler for the session. This allows for performance operations to be profiled.

Annotations
@Override
setSessionLogback to summary
public void setSessionLog(SessionLog log)

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

Implements org.eclipse.persistence.sessions.Session.setSessionLog.

PUBLIC: Set the session log.

Annotations
@Override
See Also
logMessage
setSessionNameByClassback to summary
protected void setSessionNameByClass(HashMap<K, V> sessionNameByClass)

INTERNAL: Set sessions indexed by class, each class can only have one default session.

setSessionsByNameback to summary
public void setSessionsByName(Map<K, V> sessionsByName)

INTERNAL: Set sessions indexed by name.

setShouldUseDescriptorAliasesback to summary
public void setShouldUseDescriptorAliases(boolean shouldUseDescriptorAliases)

PUBLIC: Indicates whether descriptors should use aliasDescriptors map. If aliasDescriptors is used then descriptors' aliases should be unique.

setSynchronizedback to summary
public void setSynchronized(boolean synched)

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

INTERNAL: Set isSynchronized flag to indicate that members of session broker are synchronized. This method should only be called by setSynchronized method of UnitOfWork obtained from either DatabaseSession Broker or ClientSession Broker.

Annotations
@Override
shouldUseDescriptorAliasesback to summary
public boolean shouldUseDescriptorAliases()

PUBLIC: Indicates whether descriptors should use aliasDescriptors map. If aliasDescriptors is used then descriptors' aliases should be unique.

writesCompletedback to summary
public void writesCompleted()

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

INTERNAL: This method notifies the accessor that a particular sets of writes has completed. This notification can be used for such thing as flushing the batch mechanism

Annotations
@Override