PDA

View Full Version : AbstractRoutingDatasource in transactional mode



pavithra
Feb 17th, 2010, 01:00 PM
Hi,

I have a requirement to update more than one datasource in the same transaction. I am using AbstractRoutingDatasource and JtaTransactionManager[JOTM (user transaction)] for my unit testing.

When I inject my DAO classes with their own datasource, the transaction over multiple datasource works fine.
But when I provide my DAO with the AbstractRoutingDatasource and try to dynamically identify the datasource at runtime the first switch in datasource causes "nested exception is java.sql.SQLException: ORA-00942: table or view does not exist"

For some reason it looks like the transaction manager is not able to handle switching datasource with in AbstractRoutingDatasoruce in SimpleJdbcTemplate. :confused:

Can someone please help me with this issue or correct me if I am making a mistake.

Thanks,
Pavi