//
// 3. Delete is done in descending order: C(2) -> B(1) -> A(0)
// Persists in ascending order.
for (int i = 0; i < _txEntitiesTop; i++) {
Entity entity = _txEntities[i];
if (entity.__caucho_getEntityState().isPersist()) {
try {
entity.__caucho_flush();
} catch (SQLException e) {
throwPersistException(e, entity);
}
}
}
// jpa/0h25
// Deletes in descending order.
for (int i = _txEntitiesTop - 1; i >= 0; i--) {
Entity entity = _txEntities[i];
if (! entity.__caucho_getEntityState().isPersist()) {
entity.__caucho_flush();
}
}
if (! isInTransaction()) {
if (_completionList.size() > 0) {
_persistenceUnit.complete(_completionList);
}
_completionList.clear();
for (int i = 0; i < _txEntitiesTop; i++) {
Entity entity = _txEntities[i];
entity.__caucho_afterCommit();
}
_txEntitiesTop = 0;
}
}