问题描述
我在Spring中使用休眠模式,也使用ENVERS进行审核.
I am using hibernate in Spring.I also use ENVERS for auditing.
我需要为一项特定交易禁用审核. ENVERS支持吗?
I need to disable auditing for one particular transaction. Does ENVERS support this?
推荐答案
是的,但是肯定不是很简单.
Yes, but it's certainly not very straight-forward.
您需要做的是实施条件审核,有关详细信息,请参阅文档.要点是,您需要展示自己的各种Envers侦听器实现,这些实现会触发并且需要检查在事务中设置的某些值以否决审计侦听器的操作.
What you need to do is to implement conditional auditing, see documentation for details. The gist is that you'll need to present your own various Envers listener implementations which would fire and need to check some value you've set as a part of the transaction to veto the audit listener's actions.
我确实有一个建议来增强条件审核流程, HHH-11326 .如有任何其他想法,请随时在此处发表评论.
I do have a proposal for enhancing the conditional auditing process, HHH-11326. Feel free to comment there with any additional thoughts you have on the feature.
这篇关于我可以使用ENVERS来使特定事务禁用审核吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!