4.1.3.3 Transactions

Throughout this document, any discussion of “persistence of changes upon save” or “immediate persistence of changes through methods that do not require save” refers to cases in which the save is performed outside the scope of a transaction.

Within the scope of a transaction, save and other methods that act directly on the persistent workspace will not make changes visible to other sessions; this will only occur when the transaction is committed.

However, even within the scope of a transaction, save still performs validation and, if successful, clears pending changes from the Session. As well, refresh(false) still clears pending changes from the Session.

When a transaction commits, it persists only those changes that have been saved; it does not automatically save pending changes and then commit them as well. After a commit, pending changes remain in the Session and may be saved and committed later. Note that support for transactions is optional. See 8.1 Transactions.