| Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
If you do not store the project.xml or sessions.xml files at the root of the JAR file, then you must provide the full resource path to the files when accessing them. Ensure that you use "/" in resources paths, not "\". Using "\" will not work in Java.
For example, in the jar element, reference the project.xml and sessions.xml files as:
<jar>/myapp/ordersys/persist/sessions.xml <jar>/myapp/ordersys/persist/project.xml
In the sessions.xml file, reference the project.xml as:
myapp/ordersys/persist/project.xml
To acquire the session, use:
SessionManager.getManager().getSession(
new XMLSessionConfigLoader("myapp/ordersys/persist/sessions.xml"),
"OrdersysSession",
getClass().getClassLoader()
);
For more information about acquiring sessions at run time, see "Acquiring a Session from the Session Manager".