An ObjectManager has its own Level 1 cache. This stores objects against their identity. The Level 1 Cache is typically a weak referenced map and so cached objects can be garbage collected. Objects are similarly placed in the Level 2 cache of the owning PersistenceManagerFactory. This Level 2 cache caches objects across multiple ObjectManagers, and so we can use this to get objects retrieved by other ObjectManagers. The Caches exist for performance enhancement.
Has a single transaction (the "current" transaction).
When an object involved in the current transaction it is enlisted (calling enlistInTransaction()). Its' identity is saved (in "txEnlistedIds") for use later in any "persistenceByReachability" process run at commit. Any object that is passed via makePersistent() will be stored (as an identity) in "txKnownPersistedIds" and objects persisted due to reachability from these objects will also have their identity stored (in "txFlushedNewIds"). All of this information is used in the "persistence-by-reachability-at-commit" process which detects if some objects originally persisted are no longer reachable and hence should not be persistent after all.
ALl queries run during a transaction are registered here. When the transaction commits/rolls back then all queries are notified that the connection is closing so that they can read in any remaining results (and the queries remain usable after). When this manager closes all queries registered here will also be closed meaning that a query has its lifetime defined by the owning PersistenceManager.
@version $Revision: 1.100 $
|
|