When Hibernate flushes a Session, how does it decide which objects in the session are dirty?

前端 未结 5 1173
渐次进展
渐次进展 2020-12-02 21:11

My understanding of Hibernate is that as objects are loaded from the DB they are added to the Session. At various points, depending on your configuration, the session is flu

5条回答
  •  感动是毒
    2020-12-02 21:46

    Take a look to org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck Every element in the session goes to this method to determine if it is dirty or not by comparing with an untouched version (one from the cache or one from the database).

提交回复
热议问题