/
symmetric-database.xml
61 lines (51 loc) · 3.09 KB
/
symmetric-database.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" default-lazy-init="true">
<tx:annotation-driven transaction-manager="txManager" />
<!-- Support two different types of data sources: application server hosted and internal -->
<bean id="dataSource" class="org.jumpmind.symmetric.db.DataSourceFactoryBean">
<property name="jndiName" value="${db.jndi.name}" />
<property name="beanName" value="${db.spring.bean.name}" />
</bean>
<bean id="symmetricBasicDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" >
<property name="driverClassName" value="${db.driver}" />
<property name="url" value="${db.url}" />
<property name="username" value="${db.user}" />
<property name="password" value="${db.password}" />
<property name="initialSize" value="${db.pool.initial.size}"/>
<property name="maxActive" value="${db.pool.max.active}"/>
<property name="maxWait" value="${db.pool.max.wait.millis}"/>
<property name="minEvictableIdleTimeMillis" value="${db.pool.min.evictable.idle.millis}"/>
<property name="timeBetweenEvictionRunsMillis" value="120000"/>
<property name="numTestsPerEvictionRun" value="10"/>
<property name="validationQuery" value="${db.validation.query}"/>
</bean>
<bean id="jndiDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"
scope="prototype">
<property name="jndiName" value="${db.jndi.name}" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
<property name="queryTimeout" value="${db.sql.query.timeout.seconds}"/>
</bean>
<!-- Data Loader without query timeout to fix memory problems with MySQL 5 driver -->
<bean id="dataLoaderTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="txManager" />
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW" />
</bean>
<bean id="currentTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="txManager" />
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" />
</bean>
</beans>