应该不可以吧
spring事务管理的基础是java代理类proxy
代理生成的类只能转换为接口

解决方案 »

  1.   


       <aop:config proxy-target-class="true">  
           <aop:advisor pointcut="execution(* yourpackagename..*Manager.*(..))" advice-ref="txAdvice"/>  
           <aop:advisor pointcut="execution(* yourpackagename..*Manager.save(..))" advice-ref="fooAdvice"/>  
        </aop:config><tx:advice id="txAdvice" transaction-manager="transactionManager">  
           <tx:attributes>  
             <tx:method name="save*"/>  
             <tx:method name="remove*"/>  
               <tx:method name="*" read-only="true"/>  
          </tx:attributes>  
       </tx:advice>  
         
       <bean id="bookManager" class="org.springside.bookstore.commons.service.BookManager"/>  proxy-target-class="true"是关键
      

  2.   

    设为true后  就是用cglib代理了罗时飞的书上有提到过  
      

  3.   

    应该是GCLIB,本质上还是代理类
      

  4.   

    抱歉,前面写错了应该是cglib
    GCLIB也是一种动态代理实现
      

  5.   

    CGLIB生成别需要事物管理的类(target)类的子类,然后拦截所有对父类方法的调用,通过这种方式实现的
      

  6.   

    <tx:advice id="txAdvice" transaction-manager="myHibTxManager">
    <tx:attributes>
    <!-- 对get/load/search开头的方法要求只读事务 -->
    <tx:method name="get*" propagation="SUPPORTS"
    read-only="true" />
    <tx:method name="load*" propagation="SUPPORTS"
    read-only="true" />
    <tx:method name="search*" propagation="SUPPORTS"
    read-only="true" />
    <tx:method name="findMenu*" propagation="SUPPORTS"
    read-only="true" />
    <!-- 对其它方法要求事务 -->
    <tx:method name="*" propagation="REQUIRED" />
    </tx:attributes>
    </tx:advice>
    <aop:config>
    <!-- 
    只对GoodsBiz添加事务支持,因为前面配置的transactionManager
    是专对Hibernate的事务管理器 。
    -->
    <aop:pointcut id="serviceMethods"
    expression="execution(* common.biz.*.*(..))" />
    <aop:pointcut id="Methods"
    expression="execution(* biz.*.*(..))" />
    <!-- 织入 -->
    <aop:advisor advice-ref="txAdvice"
    pointcut-ref="serviceMethods" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="Methods" />
    </aop:config>