| Convenient abstract implementation of the TopLinkCallback interface,
exposing either the plain TopLink Session or the TopLink UnitOfWork
(which extends the Session interface) to code that reads persistent objects.
Exposes the UnitOfWork if there is an active one (that is, if we're running
within a non-read-only transaction); else exposes the Session itself.
This allows to modify returned objects within a transaction, which is
often desired, while the same code will return shared cache objects
if running outside a transaction.
If "enforceReadOnly" is demanded, the callback will always expose the
Session itself, avoiding the UnitOfWork overhead in any case.
author: Juergen Hoeller since: 1.2 See Also: oracle.toplink.sessions.Session.getActiveUnitOfWork See Also: SessionReadCallback.readFromSession(oracle.toplink.sessions.Session) |