将配置文件applicationContext-jdbc.xml中ref local改成ref bean           

修改前的配置文件applicationContext-jdbc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean > 
        <property name="jndiName"> 
            <value>java:comp/env/jdbc/dataSource</value> 
        </property> 
  </bean>
        <bean >
          <property name="dataSource"><ref local="dataSource"/></property>
        </bean>

 <bean >
  <property name="dataSource"><ref local="dataSource"/></property>
 </bean>

 <bean
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager"><ref local="transactionManager"/></property>
  <property name="transactionAttributes">
   <props>
    <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="add*">PROPAGATION_REQUIRED</prop>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="delete*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
   </props>
  </property>
 </bean>

</beans>


修改后的配置文件applicationContext-jdbc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean > 
        <property name="jndiName"> 
            <value>java:comp/env/jdbc/dataSource</value> 
        </property> 
  </bean>

        <bean >
          <property name="dataSource"><ref bean="dataSource"/></property>
        </bean>

 <bean >
  <property name="dataSource"><ref bean="dataSource"/></property>
 </bean>

 <bean
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager"><ref bean="transactionManager"/></property>
  <property name="transactionAttributes">
   <props>
    <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="add*">PROPAGATION_REQUIRED</prop>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="delete*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
   </props>
  </property>
 </bean>

</beans>

相关文章:

  • 2021-10-02
  • 2021-06-18
  • 2021-12-01
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-09-26
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-11-08
相关资源
相似解决方案