// First do a quick check to make sure the transaction is active.
// This allows us to throw an exception immediately.
// Cannot change flag to false inside an active optimistic tx
//
if (isActive() && optimistic && !flag)
throw new JDOUnsupportedOptionException(I18NHelper.getMessage(messages,
"transaction.transactionimpl.setoptimistic.notallowed")); // NOI18N
//
// Now get an exclusive lock so we can modify the nontransactionalRead flag.
//
persistenceManager.acquireExclusiveLock();
try {
// Cannot change flag to false inside an active optimistic tx
if (isActive() && optimistic && !flag)
throw new JDOUnsupportedOptionException(I18NHelper.getMessage(messages,
"transaction.transactionimpl.setoptimistic.notallowed")); // NOI18N
this.nontransactionalRead = flag;
persistenceManager.notifyNontransactionalRead(flag);