赞
踩
提示:最近项目中频繁出现 Lock wait timeout exceeded; try restarting transaction这个错误,把我们弄得痛苦不堪啊,为了解决问题,上网上找好多资料。
终于把问题复现了。具体操作步骤如下(我使用的mysql工具是 navicat):
UPDATE TABLENAME set time=null where id=29163;(切记不要 提交(commit;))
运行程序
public class StTest implements Runnable{ private static ApplicationContext applicationContext=null; private static AtomicInteger a=new AtomicInteger(0); static { applicationContext=new ClassPathXmlApplicationContext("classpath:application.xml"); } public static void main(String[] args) throws Exception { ExecutorService executorService = Executors.newFixedThreadPool(10); for (int i = 0; i <10 ; i++) { executorService.execute(new aaaa()); } if(!executorService.isTerminated()){ executorService.shutdown(); } } @Override public void run()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。