nickvajberg wrote:
...when I save() on an object referrering to the previously cached priority object, despite the fact that the priority object has a valid ID.
...
Thought saveOrUpdate would help, but it didn't
Since the object has been saved previously, then you must update it instead of saving it. So saveOrUpdate would help if unsaved-value is set properly and the id is not assigned.
However, the first session must be flushed before the second one access to it. Otherwise, the second session will query a non updated DB