Hi,
>I agree if conflicts conceptually with MVCC. However: is there an actual
>problem with the auto-refresh behaviour?
Yes. For example with queries. If changes are made while iterating over
the result of a query, the current behavior is problematic. Example code
(simplified):
RowIterator it = xxx.createQuery(...).execute().getRows();
while (it.hasNext()) {
otherSession.getNode(...).remove();
otherSession.save();
Row row = it.nextRow();
Node node = row.getNode();
-> node can be null here!
}
So basically the query result contains entries that get removed (by
another session) while iterating over the result. So this can lead to
NullPointerException and other strange behavior (you could get nodes that
no _longer_ match the query constraints), depending on what you do
exactly. Arguably it would be better if the session is isolated from
changes done in another session in the same thread. By the way if using
the same session to remove nodes and iterate over the result, the query
result has to reflect the changes done by the session (I think this is
required by the JCR spec).
Regards,
Thomas