Making Instances Transactional
When an optimistic transaction is in progress, a
persistent-nontransactional instance transitions to persistent-clean if
it is a parameter of makeTransactional( ).
The values in managed fields of the instance in memory are unchanged. To
minimize the possibility of a verification failure at commit, you can
first call refresh( ) or refreshAll( ) with the instance as a parameter
before making the instance transactional.
It does not matter at what time during the transaction the instance is made transactional. If the verification policy is to compare field values, the values that are compared include at a minimum all of the fields accessed during the transaction.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access