这个不是事务  那这是什么呢

解决方案 »

  1.   

    你这个配置的范围也太大了 基本上service 中所有的方法都一样了。一般我们查询的时候没必要 我项目中是这样配置的
    <tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
    <!-- 需要由交给spring的aop来进行代理的方法的集合,如果应用有自己的方法需有由spring来进行事务控制必须添加方法 --> <!-- 读取数据方法,一般采用只读事务 -->
    <tx:method name="get*" read-only="true" />
    <tx:method name="load*" read-only="true" />
    <tx:method name="select*" read-only="true" />
    <tx:method name="query*" read-only="true" />
    <tx:method name="criteria*" read-only="true" />
    <tx:method name="find*" read-only="true" />
    <tx:method name="count*" read-only="true" />
    <!--其他方法,如save,update,insert,monitor等对数据库进行写入操作的方法,当产生ServiceException进行回滚 -->
    <tx:method name="submit*" read-only="false" rollback-for="ServiceException" />
    <tx:method name="enable*" read-only="false" rollback-for="ServiceException" />
    <tx:method name="disable*" read-only="false" rollback-for="ServiceException" />
    <tx:method name="insert*" read-only="false" rollback-for="ServiceException" />
    <tx:method name="update*" read-only="false" rollback-for="ServiceException" />
    <tx:method name="lock*" read-only="false" rollback-for="ServiceException"
    propagation="REQUIRED" /><aop:config>
    <aop:pointcut id="serviceOperation"
    expression="execution(* com.jc.qrmp..*Service.*(..))" />
    <aop:pointcut id="approveInterceptor"
    expression="execution(* com.jc.qrmp.aop.ApproveInterceptor.*(..))" />
    <aop:advisor pointcut-ref="serviceOperation" advice-ref="txAdvice" />
    <aop:advisor pointcut-ref="approveInterceptor" advice-ref="txAdvice" />
    </aop:config>
    只是代码片断 ,供你参考