try {
Iterator it = readWriteObjects.iterator();
// First revert all objects
while (it.hasNext()) {
Object object = it.next();
LockEngine engine = _tracker.getMolderForObject(object).getLockEngine();
oid = _tracker.getOIDForObject(object);
if (!_tracker.isCreating(object)) {
engine.revertObject(this, oid, object);
}
}
// then forget object or release lock on them
it = readWriteObjects.iterator();
while (it.hasNext()) {
Object object = it.next();
ClassMolder molder = _tracker.getMolderForObject(object);
LockEngine engine = molder.getLockEngine();
oid = _tracker.getOIDForObject(object);
if (!_tracker.isCreating(object)) {
if (_tracker.isCreated(object)) {
// Object has been created in this transaction,
// it no longer exists, forget about it in the engine.
engine.forgetObject(this, oid);
} else {
// Object has been queried (possibly) deleted in this
// transaction and release the lock.
engine.releaseLock(this, oid);
}
}
if (_callback != null) {
_callback.releasing(object, false);