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

前端 未结 5 1167
渐次进展
渐次进展 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:44

    These answers are incomplete (at best -- I am not an expert here). If you have an hib man entity in your session, you do NOTHING to it, you can still get an update issued when you call save() on it. when? when another session updates that object between your load() and save(). here is my example of this: hibernate sets dirty flag (and issues update) even though client did not change value

提交回复
热议问题