请问用spring2.5的事务增强,他的事务提交是针对service里面的一个方法,还是针对Controller里面的一个方法
[b]问题补充:[/b]
请问用spring2.5的事务增强,他的事务提交是针对service里面的一个方法,还是针对Controller里面的一个方法
<aop:config>
<aop:pointcut id="serviceMethod"
expression="within(com.cti.base.service.BaseService+)"/>
<aop:advisor pointcut-ref="serviceMethod" advice-ref="txAdvice"/>
</aop:config>
<!-- Transactional advice -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- methods starting with 'save', 'update' or 'remove' use the default transaction settings -->
<!-- 这里的方法名是针对control里面的方法名而言的 -->
<tx:method name="save*"/>
<tx:method name="update*"/>
<tx:method name="remove*"/>
<tx:method name="transition*"/>
<tx:method name="do*"/>
<tx:method name="create*"/>
<tx:method name="add*"/>
<tx:method name="load*"/>
<tx:method name="query*"/>
<!-- other methods are set to read only -->
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
这个问答没法提问者也回复吗,呵呵
上面是我的配置内容,看的出也是针对service层控制的,那要怎么才能对controller控制呢,除了@Transational的办法外
[b]问题补充:[/b]
[quote]jones (资深程序员)[/quote]
哥们,你还是没回答我的问题哈
[b]问题补充:[/b]
[quote]jones (资深程序员)[/quote]
谢谢了哈
另外小心的问一个问题,把controller的一个request对象保存到一个业务map中这种做法你是怎么看的,