如何从SqlExceptionHelper降低死锁日志的日志级别?

时间:2019-06-24 10:08:52

标签: java mysql hibernate spring-boot

我的日志中收到很多死锁错误消息,死锁本身的原因是可以接受的行为,并且这些错误消息正在“污染”日志。错误为“尝试获取锁时发现死锁;尝试重新启动事务”

在从表中读取时,我们正在获取该锁,并且该锁用于执行“ upsert”的事务中,诸如此类;

-> start transaction with @Transactional on method
-> acquire the lock, and fetch entities with @Lock(LockModeType.PESSIMISTIC_WRITE) annotation on the repository
-> call repository.save for entities that need to be updated, and entities that need to be inserted
-> persist another entity through another repository (history)
-> end transaction

我只想为消息“尝试获取锁时发现死锁;尝试重新启动事务”设置日志级别以进行调试或跟踪。这可能吗?

0 个答案:

没有答案
相关问题