Updating optimistic concurrency tests to use transactions.

Also fixing bugs found in the process.
Will the tests still work even though ATS cannot support transactions/rollback?