Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
JDO 2 final (2.0)
-
None
-
None
Description
The test IsTransactionalFalse.testIsTransactionalFalse mandates that an instance will be persistent-clean after a field is accessed in a transaction. However, when the transaction type is optimistic, it is also valid for the instance to be persistent-nontransactional after a field access.
The test can be fixed by ensuring that the transaction is a datastore transaction. E.g.:
public void testIsTransactionalFalse() {
pm = getPM();
Transaction tx = pm.currentTransaction();
tx.setOptimistic(false); // make sure the transaction is not optimisitic
tx.begin();