basic-test-context.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 1999-2019 Seata.io Group.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
  18. http://www.springframework.org/schema/beans/spring-beans.xsd">
  19. <bean name="mysqlDataSource" class="com.alibaba.druid.pool.DruidDataSource"
  20. init-method="init" destroy-method="close">
  21. <property name="url" value="jdbc:mysql://xxx:3306/demo"/>
  22. <property name="username" value="xxx"/>
  23. <property name="password" value="xxx"/>
  24. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  25. <property name="initialSize" value="0" />
  26. <property name="maxActive" value="180" />
  27. <property name="minIdle" value="0" />
  28. <property name="maxWait" value="60000" />
  29. <property name="validationQuery" value="Select 'x' from DUAL" />
  30. <property name="testOnBorrow" value="false" />
  31. <property name="testOnReturn" value="false" />
  32. <property name="testWhileIdle" value="true" />
  33. <property name="timeBetweenEvictionRunsMillis" value="60000" />
  34. <property name="minEvictableIdleTimeMillis" value="25200000" />
  35. <property name="removeAbandoned" value="true" />
  36. <property name="removeAbandonedTimeout" value="1800" />
  37. <property name="logAbandoned" value="true" />
  38. <property name="filters" value="mergeStat" />
  39. </bean>
  40. <bean id="dataSourceProxy" class="io.seata.rm.datasource.DataSourceProxy">
  41. <constructor-arg ref="mysqlDataSource" />
  42. </bean>
  43. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  44. <property name="dataSource" ref="dataSourceProxy" />
  45. </bean>
  46. <bean id="directJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  47. <property name="dataSource" ref="mysqlDataSource" />
  48. </bean>
  49. </beans>