I am aware of the fact that Session
is first level
You'll need to call Session.evict(Object) on s1
with u1
as an argument in order to get a fresh lookup. Alternatively, for this case, you could also call Session.clear() on s1
as well to get the same effect. You could also call Session.refresh(Object object) to just refresh the state of u1
as well.
Note that transactions can take an undefined amount of time (usually not very long though) to be seen by other clients after they are committed. The update may not be visible immediately to other sessions using different connections.