开发者社区 问答 正文

ssh中事务处理 spring配置:报错

如题~~网上学习了下,配置方式 ,大体有些了解,但是还是很懵懂~进行了下面的配置,网上说就可以了?我觉得还是少什么东西 ~求大神指导,应该怎样呢~需要在其他地方配置什么呢 ~能具体点解释下吗?

<!-- 事物管理 -->
 <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory">
   <ref bean="sessionFactory"/>
  </property>
  </bean>
 
<!-- 那些类那些方法使用事务 -->     
    <bean id="transactionInterceptor" 
         class="org.springframework.transaction.interceptor.TransactionInterceptor"> 
         <property name="transactionManager" ref="transactionManager" /> 
         <!-- 配置事务属性 --> 
         <property name="transactionAttributes"> 
             <props> 
                 <prop key="*">PROPAGATION_REQUIRED</prop> 
             </props> 
         </property> 
     </bean>
      
     <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> 
         <property name="beanNames"> 
             <list> 
                 <value>*Dao</value>
             </list> 
         </property> 
         <property name="interceptorNames"> 
             <list> 
                 <value>transactionInterceptor</value> 
             </list> 
         </property> 
     </bean> 

展开
收起
kun坤 2020-06-06 23:13:13 520 分享 版权
1 条回答
写回答
取消 提交回答
  • <value>transactionInterceptor</value>  加日志拦截

    2020-06-06 23:13:21
    赞同 展开评论