Add multi-datasource module: two databases with per-database DataSource, Flyway, EntityManagerFactory and transaction manager on Boot 4.1

Working setup plus one small application per way of getting it wrong (no @Primary, @Primary only, url vs jdbc-url, wrong repository package, Flyway auto-configuration), plain vs named @Transactional, and ChainedTransactionManager with a failing commit. Transcripts are written by the tests.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Uu7q8vPeREyT4218EJPzz1
This commit is contained in:
Claude
2026-09-24 09:38:27 +00:00
parent d6b76c57db
commit e59ff029a1
44 changed files with 1465 additions and 0 deletions
@@ -0,0 +1,13 @@
# ChainedTransactionManager over the customers and orders managers
--- 1. business exception after both writes: both roll back ---
rows: customers.customer=0 orders.purchase_order=0
--- 2. the orders database refuses to commit; orders is LAST in the list ---
thrown: org.springframework.transaction.HeuristicCompletionException (outcome: rolled back)
rows: customers.customer=0 orders.purchase_order=0
--- 3. the orders database refuses to commit; orders is FIRST in the list ---
thrown: org.springframework.transaction.HeuristicCompletionException (outcome: mixed)
rows: customers.customer=1 orders.purchase_order=0