Transactional unit test over multiple datasources
Posted by Lars Vonk in the late evening: July 31, 2007
Recently I needed to write an integration test that covered a transaction over multiple SessionFactories and different datasources. I wanted it to be an outside-the-container-test and therefor I needed some ability to do transactions over multiple datasources without all the stuff a J2EE container would provide.
A good start for writing transactional tests can be found, as usual, in Spring. All you need to do is to extend the AbstractTransactionSpringContextTests class and the rest is a piece of cake. Now the question is how to wire this up for multiple datasources?
Filed under:
1 Comment