随笔分类 -  Spring

摘要:最近看到Medium上一篇讨论Spring Framework中事务传播的文章,解释了几种常见的问题,解释的不错,这里直接翻译吧(意译为主,粗体和斜体是我自己加上的)。 译文: 这是我的第一篇文章,我打算给大家总结一下开发者在使用Spring事务时,常常会犯的和事务传播相关的错误。 在这之前,我们先 阅读全文
posted @ 2019-02-16 13:41 赫尔修斯 阅读(789) 评论(0) 推荐(0)
摘要:Spring支持三种注册Bean及装配Bean的方式: 这三种方式可以混合使用。选择哪种更多地是看个人品味。 下文主要介绍第三种方式:自动扫描注册Bean及自动装配(Autowiring)Bean(在beans.xml中配置)。 1. <context: annotation-config/> 这个 阅读全文
posted @ 2018-01-03 14:51 赫尔修斯 阅读(1187) 评论(0) 推荐(0)
摘要:本文讨论 Spring 与 MyBatis 的整合。 在 beans.xml 中我们定义了两个 bean: SqlSessionFactoryBean、SqlSessionTemplate。 1、SqlSessionFactoryBean a、SqlSessionFactoryBean 是 Fact 阅读全文
posted @ 2017-04-19 17:22 赫尔修斯 阅读(171) 评论(0) 推荐(0)
摘要:Use AbstractRoutingDataSource to dynamicly switch datasources, see http://spring.io/blog/2007/01/23/dynamic-datasource-routing. PS: note the use of Th 阅读全文
posted @ 2015-12-10 12:11 赫尔修斯 阅读(685) 评论(0) 推荐(0)
摘要:报错信息: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire meth 阅读全文
posted @ 2015-11-25 12:58 赫尔修斯 阅读(4617) 评论(0) 推荐(0)