Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Acquiring and Using Sessions at Run Time (ELUG)
Acquiring and Using Sessions at Run Time
Contents
- 1 Acquiring and Using Sessions at Run Time
- 1.1 Introduction to Session Acquisition
- 1.2 Acquiring the Session Manager
- 1.3 Acquiring a Session from the Session Manager
- 1.4 Acquiring a Client Session
- 1.5 Acquiring a Historical Session
- 1.6 Logging In to a Session
- 1.7 Using Session API
- 1.8 Logging Out of a Session
- 1.9 Storing Sessions in the Session Manager Instance
- 1.10 Destroying Sessions in the Session Manager Instance
After you create and configure sessions, you can use the session manager to acquire a session instance at run time.
Introduction to Session Acquisition
We recommend that you export session instances from the EclipseLink Workbench to one or more uniquely named sessions.xml
files and then use the session manager to load sessions from these sessions.xml
files.
The EclipseLink session manager lets you build a series of sessions that are maintained under a single entity. The session manager is a static utility class that loads EclipseLink sessions from the sessions.xml
file, caches the sessions by name in memory, and provides a single access point for EclipseLink sessions. The session manager supports the following session types:
- Server Session
- Database Session
- SessionBroker
Session Manager
When a client application requires a session, it requests the session from the EclipseLink session manager. The two main functions of the session manager are to instantiate EclipseLink sessions for the server, and to hold the sessions for the life of the application. The session manager instantiates database sessions, server sessions, or session brokers based on the configuration information in the sessions.xml
file.
The session manager instantiates sessions as follows:
- The client application requests a session by name.
- The session manager looks up the session name in the
sessions.xml
file. If the session name exists, the session manager instantiates the specified session; otherwise, it throws an exception. - After instantiation, the session remains viable until the application is shut down.
Acquiring the Session Manager
Acquiring a Session from the Session Manager
Acquiring a Client Session
Acquiring a Historical Session
Logging In to a Session
Using Session API
Logging Out of a Session
Storing Sessions in the Session Manager Instance
Destroying Sessions in the Session Manager Instance
Copyright © 2007 Oracle. EclipseLink Developer's Guide License.