Chapter 8. PersistenceManager
Prev | Part 3. Java Data Objects | Next

## Chapter 8. PersistenceManager

The diagram above presents an overview of the `PersistenceManager` interface. For a complete treatment of the `PersistenceManager` API, see the Javadoc documentation. Methods whose parameter signatures consist of an ellipsis (...) are overloaded to take multiple parameter types.

| Note
Kodo extends the standard `PersistenceManager` interface with the `KodoPersistenceManager` interface to provide additional functionality.

The `PersistenceManager` is the primary interface to the JDO runtime. Each `PersistenceManager` manages a cache of persistent and transactional objects, and has an association with a single `Transaction`.

We divide the methods of the `PersistenceManager` into the following functional categories:

- User object association.

- Configuration properties.

- `Transaction` association.

- `FetchPlan` association.

- Persistence-capable lifecycle management.

- Detach and attach functionality.

- JDO identity management.

- Cache management.

- `Extent`, `Query`, and `Sequence` factory.

- Connection access.

- Closing.

## 8.1. User Object Association

    public Object getUserObject ();
    public void setUserObject (Object obj);
    public Object putUserObject (Object key, Object obj);
    public Object getUserObject (Object key);
    public Object removeUserObject (Object key);

The `PersistenceManager`'s user objects allow you to associate arbitrary objects with each `PersistenceManager`. The given objects are not used in any way by the JDO implementation.

The `getUserObject` and `setUserObject` methods associate a primary user object with the `PersistenceManager`. The `putUserObject`, `getUserObject`, and `removeUserObject` methods, on the other hand, delegate to an internal map of secondary user objects. As in the `java.util.Map` APIs, the `put` and `remove` operations return the object formerly stored under the given key.

Prev | Up | Next
7.6. Closing the PersistenceManagerFactory | Home | 8.2. Configuration Properties