我试图在各种留言板上找到我的问题的解决方案。但是,我正在撞墙。我正在尝试在 Mysql INNODB 表上重新创建我们的数据库“LockWait Timeout”上发生的问题。(有关我正在尝试解决的问题的信息,请访问:http ://bugs.mysql.com/bug.php?id=10641 )我已经缩小了问题范围,并且有一个解决方案。但我无法在测试环境中重新创建问题,因此我可以测试我的解决方案。
这是我的代码:
public static void main(String[] args) {
System.out.println("Programm Starting");
int numberOfthreads = 2;
for(int x = 1; x <= numberOfthreads; x++){
//Create the object UpdateClass
// Create the Runable object
Runnable r = new Runnable() {
// Start the Runnable
public void run() {
System.out.println("Running");
}
};
Thread thr = new Thread(r);
System.out.println("Thread object created");
thr.start();
final UpdateClass session = new UpdateClass(x);
System.out.println("Thread object started");
try {
System.out.println("Starting UpdateClass.runProcess()");
session.runProcess();
Thread.sleep(1);
}
catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
thr.stop();
System.out.println("Thread stopped");
}
}
基本上,我试图将同步更新复制到 MySql 表以创建 LockWait Timeout 问题。
我的类 UpdateClass 按我需要的方式工作,但我无法重新创建同时事件来调用该类。
问题:如何更改我的代码以增加生成导致超时的条件的可能性?