Q:

How to create single transaction manager for two oracle different datasources in jdbctemplate

I am newbie to spring jdbc template.I want to create a single transaction manager for two different datasources.Below is my configuration details
<bean id="dataSource1"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName">
            <value>oracle.jdbc.driver.OracleDriver</value>
        </property>
        <property name="url">
            <value>jdbc racle:thin:@localhost:1527/Hardua</value>
        </property>
        <property name="username">
            <value>selva</value>
        </property>
        <property name="password">
            <value>selva</value>
        </property>
</bean>
<bean id="dataSource2"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName">
            <value>oracle.jdbc.driver.OracleDriver</value>
        </property>
        <property name="url">
            <value>jdbc racle:thin:@localhost:1527/Jaise</value>
        </property>
        <property name="username">
            <value>selva</value>
        </property>
        <property name="password">
            <value>selva</value>
        </property>
</bean>

<bean id="transactionManager"
        class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource1"></property>
        <property name="dataSource" ref="dataSource2"></property>
</bean>

<bean id="jdbcTemplate1 class="org.springframework.jdbc.core.JdbcTemplate">
        <property name="dataSource" ref="dataSource1"></property>
</bean>
<bean id="jdbcTemplate2 class="org.springframework.jdbc.core.JdbcTemplate">
        <property name="dataSource" ref="dataSource2"></property>
</bean>

I tried the above but rollback is not happening in database.Is it the right way of achieving the transaction?
Any help will be greatly appreciated!!!!

A:

Well in this case ,you need to have a 
JTA Transaction Manager (Global transaction Manager- 2 phase commit).

You have to use JTA implementations such as spring's own JtaTransactionManager instead of DatasourceTransactionManager which is a local transaction manager.

