7.5. Multi-Threaded Applications

Many of the examples in the book so far have been of the simplest type of JDO application. The application runs, gets a PersistenceManager instance from a PersistenceManagerFactory, begins a transaction, does something, and ends the transaction. This is a single-threaded, single PersistenceManager application.

JDO supports much more sophisticated applications than this. An application can essentially get as many PersistenceManager instances at a time as available resources allow. Each PersistenceManager instance represents a connection to the datastore, a transaction context, and a cache of persistent objects. From the application perspective, each PersistenceManager instance is independent of the other, and from ...

Get Core Java™ Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.