<?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:jee="http://www.springframework.org/schema/jee"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
                           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd"
       >

	<!-- biosserver-specific start -->
	<bean id="dataSourceXDb" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">
		<property name="minPoolSize" value="5"></property>
		<property name="maxPoolSize" value="50"></property>
		<property name="acquisitionTimeout" value="30"></property>
		<property name="maxIdleTime" value="900"></property>
		<property name="testQuery" value="select 1"></property>
		<property name="className" value="org.postgresql.xa.PGXADataSource"></property>
		<property name="driverProperties">
			<props>
				<prop key="ServerName">marketing.geniogroup.it</prop>
<prop key="PortNumber">5432</prop>
<prop key="DatabaseName">bxi</prop>
				<prop key="User">xdata</prop>
				<prop key="Password">xdata</prop>
			</props>
		</property>
		<property name="uniqueName" value="dataSourceXDb"/>
	</bean>

	<bean id="dataSourceBbi" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">
		<property name="minPoolSize" value="5"></property>
		<property name="maxPoolSize" value="50"></property>
		<property name="acquisitionTimeout" value="30"></property>
		<property name="maxIdleTime" value="900"></property>
		<property name="testQuery" value="select 1"></property>
		<property name="className" value="org.postgresql.xa.PGXADataSource"></property>
		<property name="driverProperties">
			<props>
				<prop key="ServerName">marketing.geniogroup.it</prop>
<prop key="PortNumber">5432</prop>
<prop key="DatabaseName">bxi</prop>
				<prop key="User">bxi</prop>
				<prop key="Password">bxi</prop>
			</props>
		</property>
		<property name="uniqueName" value="dataSourceBbi"/>
	</bean>

	<bean id="dataSourceAccounting" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">
		<property name="minPoolSize" value="5"></property>
		<property name="maxPoolSize" value="50"></property>
		<property name="acquisitionTimeout" value="30"></property>
		<property name="maxIdleTime" value="900"></property>
		<property name="testQuery" value="select 1"></property>
		<property name="className" value="org.postgresql.xa.PGXADataSource"></property>
		<property name="driverProperties">
			<props>
				<prop key="ServerName">marketing.geniogroup.it</prop>
<prop key="PortNumber">5432</prop>
<prop key="DatabaseName">bxi</prop>
				<prop key="User">accounting</prop>
				<prop key="Password">accounting</prop>
			</props>
		</property>
		<property name="uniqueName" value="dataSourceAccounting"/>
	</bean>

	<bean id="BitronixTransactionManager" factory-method="getTransactionManager"
		  class="bitronix.tm.TransactionManagerServices" 
		  depends-on="dataSourceXDb,dataSourceBbi,dataSourceAccounting" destroy-method="shutdown" />
	
	<bean id="txManagerXDb" class="org.springframework.transaction.jta.JtaTransactionManager" >
		<property name="transactionManager" ref="BitronixTransactionManager" />
		<property name="userTransaction" ref="BitronixTransactionManager" />
	</bean>
	<!-- biosserver-specific end -->
	
	<!-- j2ee-specific start 
	<jee:jndi-lookup id="dataSourceXDb" jndi-name="java:ra/bbi-oraclexa-xdb"/>
	<jee:jndi-lookup id="dataSourceBbi" jndi-name="java:ra/bbi-oraclexa-bquadro2"/>
	<jee:jndi-lookup id="dataSourceAccounting" jndi-name="java:ra/bbi-authdb"/>

	<bean id="txManagerXDb" class="org.springframework.transaction.jta.JtaTransactionManager">
   		<property name="userTransactionName"><null/></property>
	    <property name="transactionManagerName" value="null"/>
	</bean>	
	j2ee-specific end -->

	<alias name="txManagerXDb" alias="txManagerBbi"/>
	<alias name="txManagerXDb" alias="txManagerAccounting"/>

</beans>
