1.开启async
<!-- Async -->
<context:annotation-config />
<!-- 支持异步方法执行 -->
<task:annotation-driven />
<!-- Package Scan -->
<context:component-scan base-package="com" />
2.在service来加@Transactional,异步的方法加@Async
1.开启async
<!-- Async -->
<context:annotation-config />
<!-- 支持异步方法执行 -->
<task:annotation-driven />
<!-- Package Scan -->
<context:component-scan base-package="com" />
2.在service来加@Transactional,异步的方法加@Async