![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
彦楠
写程序也挺有意思
展开
-
java线程池管理工具类
1,这是线程池管理工具类,在系统关闭时确保任务执行完毕,自定义抛弃策略默认使用了CallerRunsPolicy拒绝策略。原创 2023-11-29 18:56:54 · 525 阅读 · 0 评论 -
spring 定时任务
1 在springboot下执行 import org.apache.log4j.Logger; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @Service @EnableScheduling publ原创 2021-03-01 11:41:37 · 249 阅读 · 0 评论 -
spring @Transactional
使用注意事项 1,加上@Transactional(rollbackFor=Exception.class) 1 让checked例外也回滚:在整个方法前加上 @Transactional(rollbackFor=Exception.class) 2 让unchecked例外不回滚: @Transactional(notRollbackFor=RunTimeException.class) 3...原创 2019-01-16 11:11:08 · 348 阅读 · 0 评论