我一直用spring的注释来管理事务
@Transactional就能解决了

解决方案 »

  1.   

    找到原因了,代理bean没注入到业务层。
    <bean id="userdaoProxy"class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
          <property name="transactionManager" ref="tm"> </property>
          <property name="target" ref="userdao"> </property>
          <property name="transactionAttributes">
            <props>
              <prop key="insert*">PROPAGATION_REQUIRED </prop>
              <prop key="save*">PROPAGATION_REQUIRED </prop>
              <prop key="update*">PROPAGATION_REQUIRED </prop>
              <prop key="delete*">PROPAGATION_REQUIRED </prop>
              <prop key="get*">PROPAGATION_REQUIRED,readOnly </prop>
              <prop key="find*">PROPAGATION_REQUIRED,readOnly </prop>
              <prop key="load*">PROPAGATION_REQUIRED,readOnly </prop>
            </props>
          </property>
     </bean> <bean id="userserv" class="shs.serviceimpl.UserinfoServiceImpl">
      <property name="userdao" ref="userdaoProxy"></property>
    </bean>