Visibility of objects in different Hibernate sessions
问题 FlushMode in both Sessions is set to AUTO. Session A : Session begins Session B : Session begins Session A : Session creates new objects, Session#flush() is called, Session ends. Session B : Session reads objects from database and Session#flush() is automatically performed before this operation. Will the newly created objects of Session A also be visible to Session B ? 回答1: It depends on your isolation level and the underlying database. Hibernate defaults the isolation level to the underlying