执行getJdbcTemplate().batchUpdate需要在ServiceImpl类中添加事务注解(@Transactional(rollbackFor=Exception.class))

@Transactional(rollbackFor=Exception.class)publicvoidupdateMenu(String[]objs)throwsException{repository.updateSomething(objs);//这里调用了批处理}