-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdatasource.xml
More file actions
67 lines (59 loc) · 3.08 KB
/
datasource.xml
File metadata and controls
67 lines (59 loc) · 3.08 KB
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
62
63
64
65
66
67
<!--
~ Copyright 2011 FuseSource
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
<reference id="platformTxManager" interface="org.springframework.transaction.PlatformTransactionManager" availability="mandatory"/>
<reference id="transactionManager" interface="javax.transaction.TransactionManager" />
<reference id="recoverableTxManager" interface="org.apache.geronimo.transaction.manager.RecoverableTransactionManager" availability="mandatory" />
<!-- NOTE: If you are running JBoss Fuse 6.0, please switch to the demo Camel-JMS-JDBC-XA-TX-JBossFuse6.0.
This version of the demo will not work due to bug http://fusesource.com/issues/browse/ENTESB-633.
The demo Camel-JMS-JDBC-XA-TX-JBossFuse6.0 presents a workaround solution for ENTESB-633
that can be used in JBoss Fuse 6.0.
-->
<!--
This defines the actual data source bean. It will instantiate a new
ClientXADataSource instance and will use the corresponding settings to set
the database and server name. In our case, we will be running Apache Derby
on the same machine so the server name is `localhost`. A database called
`transactions` has been created up-front as well (see README.md).
-->
<bean id="mysql-ds" class="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource">
<property name="databaseName" value="test"/>
<property name="url" value="jdbc:mysql://localhost/test?relaxAutoCommit=true" />
<property name="user" value="root"/>
<property name="password" value=""/>
</bean>
<!-- No pooling classes needed, pooling is provided by Aries wrapper
<bean id="tomcat-jdbc" class="org.apache.tomcat.jdbc.pool.XADataSource">
<property name="dataSource" ref="mysql-ds"/>
<property name="initialSize" value="1"/>
<property name="maxActive" value="5"/>
<property name="jmxEnabled" value="true"/>
</bean>
-->
<service interface="javax.sql.XADataSource" ref="mysql-ds">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/transactions"/>
<entry key="datasource.name" value="MySQL"/>
<!-- additional supported properties
https://github.com/apache/aries/blob/trunk/transaction/transaction-jdbc/src/main/java/org/apache/aries/transaction/jdbc/internal/ManagedDataSourceFactory.java#L94
-->
<entry key="aries.xa.pooling" value="true" />
<entry key="aries.xa.poolMinSize" value="0" />
<entry key="aries.xa.poolMaxSize" value="5" />
</service-properties>
</service>
</blueprint>