@Override @Transactional public void testTransactional1() { Dict dict=baseMapper.selectOne(new QueryWrapper<Dict>().eq("d_code", "AAA")); dict.setDValue("2"); baseMapper.updateById(dict); try { Thread.sleep(10000); // 10 s } catch (InterruptedException e) { e.printStackTrace(); } Dict dictSS=baseMapper.selectOne(new QueryWrapper<Dict>().eq("d_code", "AAA")); System.out.println("dictSS="+ JSON.toJSONString(dict)); System.out.println("testTransactional1"); }
@Override @Transactional public void testTransactional2() { Dict dict=baseMapper.selectOne(new QueryWrapper<Dict>().eq("d_code", "AAA")); System.out.println("dict="+ JSON.toJSONString(dict)); }
Executor threadPool = Executors.newFixedThreadPool(5); threadPool.execute(n