applicationContext中事物的使用
来源:互联网 发布:长岛的雪 内涵 知乎 编辑:程序博客网 时间:2024/05/19 11:48
最近项目中用到了事务,所以把项目中用到的写出来:
<!-- 事务的定义 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 定义具体到方法的事务处理 -->
<bean id="txAttributeSource"
class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
<property name="properties">
<props>
<prop key="add*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="update*">
PROPAGATION_REQUIRED,-Exception
</prop>
<prop key="del*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="query*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="txInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributeSource"
ref="txAttributeSource" />
</bean>
<!-- 根据名称注入事务 -->
<bean id="autoProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<list>
<idref local="txInterceptor" />
</list>
</property>
<property name="beanNames">
<!-- 将事务注入到相应的业务处理类中去!(将你们每个模块的业务写入 -->
<list>
<idref bean="logService"/>
<idref bean="uploadAudioService"/>
</list>
</property>
</bean>
- applicationContext中事物的使用
- spring中ApplicationContext的获取与使用
- spring中使用ApplicationContext
- 事物处理 applicationContext.xml
- 事物的使用
- JDBC事物的使用
- tp5的事物使用
- Spring中Bean的管理及ApplicationContext的使用
- Spring 中ApplicationContext使用 <02>
- Spring中ClassPathXmlApplicationContext和ApplicationContext 的简单使用
- STRUTS2 中使用事物需要注意的一点
- sqlserver 并发处理中基础--事物和锁的使用
- C#中使用事物需要注意的地方
- Hibernate中编程式事物的简单使用
- ApplicationContext中Bean的生命周期
- Spring中ApplicationContext的说明
- Spring中ApplicationContext的使用说明
- ApplicationContext中Bean的生命周期
- 将GridView中的数据导出到Excel,Word,Html
- wwwwwwwwwwwwwwwwwww
- 如何正确地在Axis、Axis2和Apache CXF之间抉择?
- 我所收藏的开源代码网址
- 移动项目总结
- applicationContext中事物的使用
- 老婆的最后一条信息``看完了`哭了
- 什么是Scrum
- 法国wysistat网站监测系统登陆中国
- Hadoop 安装的几个关键点
- “勒紧裤带”过日子
- 在GridView中插入行
- JavaScript document.forms[]
- 别人的东西(好我就收)