Hibernate first level cache - does it Sync?
问题 I am aware of the fact that Session is first level cache used by Hibernate , and once we retrieve an entity from the session , the subsequent get calls for the same entity with same identifier is fetched from the session instead of DB, until the session is Open . Having said that, I have a doubt regarding how hibernate syncs the first level cache with DB? Consider the following scenario //Lets say I have created the session Session s1 = sessionFactory.getSession(); User u1 = s1.get(User.class