<p> <b>Purpose</b>: Define the implementation for a single user/single connection EclipseLink session. <p> <b>Description</b>: The session is the primary interface into EclipseLink, the application should do all of its reading and writing of objects through the session. The session also manages transactions and units of work. The database session is intended for usage in two-tier client-server applications. Although it could be used in a server situation, it is limited to only having a single database connection and only allows a single open database transaction. <p> <b>Responsibilities</b>: <ul> <li> Connecting/disconnecting. <li> Reading and writing objects. <li> Transaction and unit of work support. <li> Identity maps and caching. </ul>
| Modifier and Type | Field and Description |
|---|---|
| protected long | connectedTime
INTERNAL: connectedTime indicates the exact time this session was logged in. |
| protected DatabaseEventListener | databaseEventListener
Database event listener, this allows database events to invalidate the cache. |
| protected volatile boolean | isLoggedIn
INTERNAL Indicate if this session is logged in. |
| protected SequencingHome | sequencingHome
INTERNAL: sequencingHome for this session. |
| protected ServerPlatform | serverPlatform
Used to store the server platform that handles server-specific functionality for Oc4j, WLS, etc. |
| protected SessionTuner | tuner
Stores the tuner used to tune the configuration of this session. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addDescriptor(ClassDescriptor descriptor)
Implements org. |
| public void | addDescriptors(final Collection<E>
The descriptors to be added to the session and project. descriptors)Implements org. |
| public void | addDescriptors(Project project)
Implements org. |
| public void | addDescriptorsToSequencing(Collection<ClassDescriptor>
class descriptors descriptors)INTERNAL: If sequencing is connected then initializes sequences referenced by the passed descriptors, otherwise connects sequencing. |
| public void | addSequence(Sequence sequence)
Implements org. |
| public void | |
| public void | |
| protected void | |
| public long | |
| public DatabaseEventListener | getDatabaseEventListener()
Implements org. |
| public Platform | getDatasourcePlatform()
Overrides org. Implements org. |
| public DatabasePlatform | getPlatform()
Overrides org. Implements org. |
| public Platform | getPlatform(Class<?> domainClass)
Overrides org. |
| protected Login | |
| public Sequencing | getSequencing()
Overrides org. |
| public SequencingControl | getSequencingControl()
Implements org. |
| protected SequencingHome | getSequencingHome()
INTERNAL: Return SequencingHome which used to obtain all sequence-related interfaces for DatabaseSession |
| public ServerPlatform | getServerPlatform()
Overrides org. Implements org. |
| public SessionTuner | |
| public void | |
| public void | initializeDescriptorIfSessionAlive(ClassDescriptor descriptor)
INTERNAL: A descriptor may have been added after the session is logged in. In this case the descriptor must be allowed to initialize any dependencies on this session. |
| public void | initializeDescriptors()
INTERNAL: Allow each descriptor to initialize any dependencies on this session. |
| public void | initializeDescriptors(Map<K, V> descriptors)
INTERNAL: Allow each descriptor to initialize any dependencies on this session. |
| public void | |
| public void | initializeDescriptors(Map<K, V> descriptors, boolean shouldInitializeSequencing)
INTERNAL: Allow each descriptor to initialize any dependencies on this session. |
| public void | |
| public void | |
| public boolean | isDatabaseSession()
Overrides org. Implements org. |
| public boolean | isLoggedIn()
INTERNAL: Return if the session was logged in. This may slight differ to isConnected which asks the JDBC Connection if it is connected. |
| public boolean | isProtectedSession()
Overrides org. |
| public boolean | |
| public void | login()
Implements org. |
| public void | login(String userName, String password)
Implements org. |
| public void | login(Login login)
Implements org. |
| public void | |
| public void | logout()
Implements org. |
| protected void | postConnectDatasource()
INTERNAL: This method includes all of the code that is issued after the datasource is connected to. |
| public void | |
| protected void | preConnectDatasource()
INTERNAL: This method includes all of the code that is issued before the datasource is connected to. |
| public void | releaseJTSConnection()
Overrides org. |
| public Object | retryQuery(DatabaseQuery query, AbstractRecord row, DatabaseException databaseException, int retryCount, AbstractSession executionSession)
Overrides org. |
| public void | setDatabaseEventListener(DatabaseEventListener databaseEventListener)
Implements org. |
| public void | setDatasourceAndInitialize()
INTERNAL: Issue any pre connect and post connect without an actual connection to the database. |
| protected void | setOrDetectDatasource(boolean
- set to true if the caller cares to throw exceptions, false to swallow them. throwException)INTERNAL: Will set the platform from specified schema generation properties or by detecting it through the connection (if one is available). |
| protected void | setSequencingHome(SequencingHome sequencingHome)
INTERNAL: Set the SequencingHome object used by the session. |
| public void | setServerPlatform(ServerPlatform newServerPlatform)
Implements org. |
| public void | |
| public void | writeAllObjects(Collection<E> domainObjects)
Implements org. |
| public void | writeAllObjects(Vector<E> domainObjects)
PUBLIC: Write all of the objects and all of their privately owned parts in the database. |