简体   繁体   English

从Java检测mysql表锁定

[英]Detecting mysql table lock from java

I have a web application based on Java EE and MYSQL. 我有一个基于Java EE和MYSQL的Web应用程序。

The problem which I am facing right now is, there is an event getting fired online, which is updating a table entry for a large number of rows. 我现在面临的问题是,有一个事件被在线激发,该事件正在更新大量行的表条目。

There is also a batch job scheduled in the environment, say for every 6 minutes, which is also updating the same table entry, as mentioned above. 如上所述,在环境中还计划有一个批处理作业,例如每6分钟执行一次,它还会更新同一表条目。

So the situation is that, when the online event is getting fired in the time range of the batch run, the table is getting locked. 因此,情况是,在批处理运行的时间范围内触发在线事件时,表将被锁定。

So, experts please provide your ideas, on how to prevent the lock to take place. 因此,请专家提供您关于如何防止发生锁定的想法。

看起来像一个设计问题,看看使用临时表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM