Hi,
I assume that the order is deterministic.
Take a look at the implementation of org.hibernate.engine.ActionQueue.java and convince yourself:
the collection updates are enqueued into a ArrayList with the add method,
which appends the specified element to the end of this list.
The executeAction method then performs the actions in the same order as they were enqueued.
Code:
private ArrayList collectionUpdates;
...
public void addAction(CollectionUpdateAction action) {
collectionUpdates.add( action );
}
...
private void executeActions(List list) throws HibernateException {
int size = list.size();
for ( int i = 0; i < size; i++ ) {
execute( ( Executable ) list.get( i ) );
}
list.clear();
session.getBatcher().executeBatch();
}
public void executeActions() throws HibernateException {
executeActions( insertions );
executeActions( updates );
executeActions( collectionRemovals );
executeActions( collectionUpdates );
executeActions( collectionCreations );
executeActions( deletions );
}
Exception is when a collection is created or removed. These actions are enqueued in separate arraylists
(see lines abobe).