Workbook 3 delta

Exercise 5.1: Interacting with EntityManager



While AUTO and COMMIT have the described properties, the behavior of AUTO and COMMIT are not visible outside the manager.

When the AUTO value is selected the new cabin is found using a query on the same entity manager, the cabin is not visible however by another entity manager yet, as the transaction on the database has not been commited yet. In case the COMMIT value is selected, the query fails, as the new cabin is not visible in the search for the own entity manager yet.

This behaviour on GlassFish / Oracle is clearly different from the behaviour in JBOSS / Hypersonic.

The Client_3 exercise has been updated to reflect the differences.

Also the EJB query must, according to the specs, use a SELECT statement, not just starting at FROM.

Exercise 5.2: Standalone Persistence

In the updated example use is made of the toplink entity manager and the oracle database.

The persistence.xml file is updated to include the properties needed for the oracle database with toplink instead of hibernate with hypersonic. As can be seen the class needs to be explicitly named.

The application tries to drop any table already in place, but it will not clean up the database.

To cleanup the database, go to the database home page and login as the user used in the persistence.xml file, then manually drop the table via the object browser.


Back to the index Further to Workbook 4


UUIDs and information about UUIDs
If you have improvements, contact information on the homepage of this host.
The uptime of this host


Search for more information :
Google
`