public void execute2(){
for (int j = 0; j >= 10; j--) {
forkJoinPool.addTask(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
//而外起的线程,带事务的方法(事务超时中断....forkJoinPool.execute()超时中断)
return createTemplateFile(currentVersion, lastVersionNo);
}
});
//单线程没问题,还是execute方法的事物
//createTemplateFile(currentVersion, lastVersionNo);
}
//阻塞等待所有任务执行完成
forkJoinPool.execute();
}
//带事物的方法
public void execute(){
execute2();
}
线程池超时异常
猜你喜欢
转载自m635674608.iteye.com/blog/2301637
今日推荐
周排行