![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
小学插班生
这个作者很懒,什么都没留下…
展开
-
Spring事务使用ThreadLocal绑定连接并通过动态代理增强
Spring默认的事务是自动开启的,我么们没执行一次DAO就是获取了一次连接,这样无法实现多条操作统一提交,比如转账,这时我们一种解决思路就是将connection连接与当前线程绑定,这样我们这么线程在操作时,获取的都是同一个连接。创建连接工具类/** * 连接的工具类,它用于从数据源中获取一个连接,并且实现和线程的绑定 */public class ConnectionUtils {...原创 2020-03-04 22:12:22 · 659 阅读 · 0 评论 -
Spring Boot 和thymeleaf获取项目路径得问题
Spring Boot 和thymeleaf获取项目路径得问题在thymeleaf中,我们在js上直接写${pageContext.request.contextPath}是获取不到项目路径的,所以我们可以采取行内表达式的写法:var deleteUrl = "[[@{/ep/delete}]]";var forwordUrl = "[[@{/ep/experimentproblems}]]...原创 2019-12-18 09:56:47 · 1450 阅读 · 0 评论 -
Spring整合mybatis时创建ClassPathXmlApplicationContext导入配置文件时抛出异常
Spring整合mybatis时创建ClassPathXmlApplicationContext导入配置文件时抛出异常创建ClassPathXmlApplicationContext导入配置文件时抛出异常创建ClassPathXmlApplicationContext导入配置文件时抛出异常 //1.加载spring的配置文件applicationContext.xml //加载...原创 2019-05-27 22:45:53 · 781 阅读 · 0 评论