spring-boot - 从 Springboot 中过滤掉 Hibernate 引起的特殊错误日志
问题描述
我有一个 springboot 应用程序,并与 JPA for Oracle 数据库集成,目前我发现了一个问题,问题是,出于某种原因,休眠将抛出 HHH000315: Exception execution batch [org.hibernate.StaleStateException: Batch update returned unexpected来自更新 [0] 的行数;实际行数:0;预期:1;
这个异常将被休眠记录为错误
同时springboot框架会处理这个异常到这个org.springframework.orm.ObjectOptimisticLockingFailureException: Batch update returned unexpected row count from update[0]; 实际行数:0;预期:1;执行的语句:
因此,在我们的 ExceptionAdvice 中,我们处理了 ObjectOptimisticLockingFailureException 并登录到 INFO 级别。
所以,我的问题是,我怎样才能也将 StaleStateException 记录到 INFO 级别或忽略此异常记录?
解决方案
推荐阅读
- marklogic - 超时调整 SPARQL 查询 Marklogic
- flutter - Flutter:带有扩展磁贴的导航抽屉
- c# - 为什么我的 ef 核心数据上下文在用于被测服务之前被处置?
- laravel - Laravel 雄辩的构建器
- android - Android:Instagram 的隐含意图的附加功能:获取图像、视频、评论、图例?
- sql-server - 如何在 pandas 中解析 SQL 文件?
- python - celeryy 服务器错误:运行服务器时“无法将新设置名称与旧设置名称混合”
- r - 如何在 logit 粗略和调整后的 GAM 中找到 OR = 1 的 x 值
- c++ - `--defsym` 链接器标志如何将值传递给源代码?
- python - Python2.7 到 Python3 Ubuntu 切换