SSH中事务配置详解(使用拦截器)
2013-05-29 09:08
561 查看
<?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="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager" ref="transactionManager" /> <!-- 配置事务属性 --> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <property name="beanNames"> <list> <value>*Dao</value> </list> </property> <property name="interceptorNames"> <list> <value>transactionInterceptor</value> </list> </property> </bean> <!-- 配置DAO --> <bean id="userDao" class="com.bluesky.spring.dao.UserDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> </beans>
相关文章推荐
- SSH中事务配置详解(使用tx标签配置的拦截器)
- 详解SpringMVC拦截器配置及使用方法
- Spring、Spring事务详解;使用XML配置事务
- SSH中事务配置详解(全注解)
- Linux下SSH安装配置使用详解
- SSH中事务配置详解(所有Bean共享一个代理基类)
- SSH中事务配置详解(每个Bean都有一个代理)
- ssh使用拦截器详解
- SSH中事务配置详解
- 最简单使用的配置登录拦截器(过滤器)的方法(SSH)
- 为什么说JAVA中要慎重使用继承 C# 语言历史版本特性(C# 1.0到C# 8.0汇总) SQL Server事务 事务日志 SQL Server 锁详解 软件架构之 23种设计模式 Oracle与Sqlserver:Order by NULL值介绍 asp.net MVC漏油配置总结
- SSH中事务配置详解
- Spring 事务的配置和使用详解(包括手动对事务的控制部分)
- FreeBSD系统SSH配置详解并能使用su
- Struts2拦截器的使用(详解) ----全局配置
- Spring使用tx标签配置拦截器动态为指定方法添加事务
- Linux下SSH安装配置使用详解
- 最简单使用的配置登录拦截器(过滤器)的方法(SSH)
- SSH中事务配置详解
- SSH 事务管理配置详解