Hibernate EmptyInterceptor onFlushDirty() is not executing

▼魔方 西西 提交于 2019-12-06 15:42:41

The onFlushDirty method was not called because there was no entity being modified by the currently running Persistence Context.

As I explained in this article, only managed entities can generate automatic UPDATE statements. In your case, you are executing a manual SQL UPDATE, which is beyond the scope of Hibernate entity state transitions.

Therefore, you have two choices:

  1. Use Hibernate Envers as there is no need to write a homemade Audit Log on top of Hibernate.
  2. Use Debezium since the DB already features an Audit Log anyway (a.k.a. WAL, redo log, transaction log).
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!