我的日志中收到很多死锁错误消息,死锁本身的原因是可以接受的行为,并且这些错误消息正在“污染”日志。错误为“尝试获取锁时发现死锁;尝试重新启动事务”
在从表中读取时,我们正在获取该锁,并且该锁用于执行“ 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
我只想为消息“尝试获取锁时发现死锁;尝试重新启动事务”设置日志级别以进行调试或跟踪。这可能吗?