Skip to main content
Jump to: navigation, search

Difference between revisions of "Acquiring and Using Sessions at Run Time (ELUG)"

m (New page: ==Acquiring and Using Sessions at Run Time== After you create and configure sessions, you can use the session manager to acquire a session instance at run time. [[Category:EclipseLink De...)
 
m (sample page)
Line 1: Line 1:
 
==Acquiring and Using Sessions at Run Time==
 
==Acquiring and Using Sessions at Run Time==
 +
<div style="float:right;border:1px solid #000000;padding:5px">__TOC__
 +
[[Special:Whatlinkshere/Eclipse/Developer's Guide/Acquiring and using Sessions at Runtime|Related Topics]]
 +
</div>
 
After you create and configure sessions, you can use the session manager to acquire a session instance at run time.
 
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 <code>sessions.xml</code> files and then use the session manager to load sessions from these <code>sessions.xml</code> 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 <code>sessions.xml</code> 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 <code>sessions.xml</code> 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 <code>sessions.xml</code> 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]].
  
 
[[Category:EclipseLink Developer's Guide]]
 
[[Category:EclipseLink Developer's Guide]]
 
[[Category:Draft]]
 
[[Category:Draft]]

Revision as of 09:17, 19 October 2007

Acquiring and Using Sessions at Run Time

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.

Back to the top