To obtain a reference to a session in TopLink Essentials(as in Oracle TopLink) you use the SessionManager. Once you have the session you need, you can use it as you would in Oracle TopLink:
Session session = SessionManager.getManager().getSession("library");
List books = session.readAllObjects(BookImpl.class);
assertEquals("num books", 1, books.size());
The "library" session is the TopLink object underlying the JPA "library" persistence unit as defined in my persistence.xml. But, to make the library session available through the SessionManager you have to add a property to your persistence unit:
<?xml version="1.0" encoding="UTF-8"?>
<persistence>
<persistence-unit name="library">
<properties>
<property name="toplink.session-name" value="library">
...
By adding this declaration you're effectively publishing your "library" persistence unit under a session name of "library". You could publish your persistence unit under a different session name but why confuse matters.