|
Jörg von Frantzius made changes - 02/Mar/06 02:22 AM
I agree, the test is not correct.
I think we do not need multiple threads to test the assertion. Here is what I think the test should do: - Setup creates a new instance, commit the trsnaction and stores the oid in an instance variable. - Create a pm, start an optimistic transaction and read the object with pm.getObjectById using the stored oid. - Create another pm, start a new transaction, read the same object, update it and commit the second transaction. - The first transaction calls pm.refresh for the object, updates it and commits the transaction. The above should not result in an exception because the refresh call synchronizes the cache with the current state of the datastore, so there is no parallel update.
Craig Russell made changes - 04/Oct/06 08:52 PM
The attached file is a rewrite of the test per Michael's specification. Please review.
Michelle Caisse made changes - 19/Oct/06 05:02 PM
Looks good. Just a couple of comments.
1. The failOnError should be outside the try...finally block, to make sure you see the error messages. 2. The indentation of " if (pntVerify.getX() != 33 " block is off. 3. I think you need to verify the values when doRefresh is false. You might not catch an exception but commit the change. I'd put the retrieval of the value outside the if(doRefresh) and check the values: if (doRefresh) { pntVerify == 33, 33 } else { pntVerify == 22, 22 }
Michelle Caisse made changes - 19/Oct/06 08:08 PM
Checked in fix with revision: 465971
Michelle Caisse made changes - 20/Oct/06 03:57 AM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For now, I propose adding the three test cases to the exclude list and fix this later.