SSH中事务配置详解(所有Bean共享一个代理基类)
2013-05-29 09:10
399 查看
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="classpath:hibernate.cfg.xml" /> <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" /> </bean> <!-- 定义事务管理器(声明式的事务) --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="transactionBase" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" lazy-init="true" abstract="true"> <!-- 配置事务管理器 --> <property name="transactionManager" ref="transactionManager" /> <!-- 配置事务属性 --> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <!-- 配置DAO --> <bean id="userDaoTarget" class="com.bluesky.spring.dao.UserDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="userDao" parent="transactionBase" > <property name="target" ref="userDaoTarget" /> </bean> </beans>
相关文章推荐
- SSH中事务配置详解(每个Bean都有一个代理)
- Nginx反向代理一个80端口下配置多个微信项目详解
- SSH中事务配置详解(全注解)
- SSH中事务配置详解(使用拦截器)
- Nginx反向代理Tomcat实现现负载均衡(高可用)以及利用redis+Session同步会话共享配置详解
- 详解SSH注解配置,bean注解、事物注解等
- SSH中事务配置详解
- 详解SSH注解配置,bean注解、事物注解等
- SSH中事务配置详解
- SSH 事务管理配置详解
- SSH中事务配置详解(使用tx标签配置的拦截器)
- 详解SSH注解配置,bean注解、事物注解等
- SSH中事务配置详解
- spring事务配置方法(TransactionProxyFactoryBean)
- 解决nginx作为前端代理默认访问一个80端口虚拟主机配置问题
- ssh项目实战经验总结-在bean配置中加载外部的properties配置项
- SSH远程登录配置文件sshd_config详解
- SSH中的Spring事务代理的常用的两种方法
- Spring事务管理----声明式(1)利用TransactionProxyFactoryBean生成事务代理
- 多个工程共享一个配置文件