7.2. Transaction interface

A JDO persistence manager has at most one active transaction at any point in time. The PersistenceManager interface defines the currentTransaction() method, which returns an instance of the transaction interface. This transaction instance is the application developer’s means for demarcating transaction boundaries within JDO.

From the time a persistence manager is obtained until the time it is closed, calls to currentTransaction() will return the identical Transaction instance. Thus it is common practice, in single-threaded client-server applications that typically maintain a single persistence manager instance for an extended period, to obtain the transaction as soon as the persistence manager is available. This object ...

Get 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.