Quick question...how are you planning on handling transactions across these connections? Are you using XA?
Printable View
Quick question...how are you planning on handling transactions across these connections? Are you using XA?
Yes - Atomikos. Just used dbcp in my example to try and keep things simple.
Just a FYI for anybody thinking of doing something similar - I ended up going with the following:
Rather than committing to a dynamic database with XA (which I couldn't get to work with Atomikos) - created a RabbitMQ message with database details included in message.
Message sent to Manufacturer queue.
Consumer (local) bound to this queue reads message and configures database connection using boneCP (see boneCP blog for how to do this).
Message translated to domain object and inserted with jdbcTemplate.