现在用起来没问题,就是不想让一个类的某个方法加入事务控制。不知道如何修改配置文件STRUTS2 SPRING HIBERNATE
我现在SPRING的配置如下<aop:config>
<aop:advisor id="managerTx" advice-ref="txAdvice" pointcut="execution(* com.test.web.action..*(..))" order="1" />
</aop:config><tx:annotation-driven /><aop:aspectj-autoproxy proxy-target-class="true"/><context:annotation-config /><context:component-scan base-package="com.test" />...其他省略
com.test.web.action里面所有类所有方法都加入事务控制,主要是方便。
现在我有一个类com.test.web.action.AddUser,里面的某个方法 addUser() 不想加入事务控制,如何修改SPRING的配置呢??
我现在SPRING的配置如下<aop:config>
<aop:advisor id="managerTx" advice-ref="txAdvice" pointcut="execution(* com.test.web.action..*(..))" order="1" />
</aop:config><tx:annotation-driven /><aop:aspectj-autoproxy proxy-target-class="true"/><context:annotation-config /><context:component-scan base-package="com.test" />...其他省略
com.test.web.action里面所有类所有方法都加入事务控制,主要是方便。
现在我有一个类com.test.web.action.AddUser,里面的某个方法 addUser() 不想加入事务控制,如何修改SPRING的配置呢??
解决方案 »
- axis2打aar包问题
- 关于return 的时候的疑问!
- struts2 分页问题
- 启动TOMCAT出现 报错:in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_08\bin;C:\Tomcat
- 关于WebService传递字符串参数的问题,高人进
- 在eclipse里看jsp写文件时的疑问?有些单词下显示是红色波浪线,但程序调用数据库等一切正常。
- CSDN还能不能开了
- 在ORACLE中查找XML数据(在线等待)
- 初学J2EE,希望高手推荐几本好书。
- 求Eclipse开发J2ee的步骤!
- eclipse发布web工程的问题
- 用jxl如何改变excel文件Sheet页名标签处的背景颜色?很急~
<!-- 定义事务管理者bean,并注入sessionFactory -->
<bean id="tranManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:advice id="txAdvice" transaction-manager="tranManager">
<tx:attributes>
<!-- 不使用事务 ,并设置为只读,效率更高-->
<tx:method name="get*" propagation="SUPPORTS" read-only="true" />
<tx:method name="list*" propagation="SUPPORTS" read-only="true" />
<tx:method name="load*" propagation="SUPPORTS" read-only="true" />
<!-- 使用事务,其它所有方法 -->
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="bizMethods"
expression="execution(* com.test.web.action..*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="bizMethods" />
</aop:config>