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
10 lines
503 B
Java
10 lines
503 B
Java
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
|
|
|
// Two scans on ONE class, the natural first attempt. Does not compile: the annotation is not repeatable.
|
|
@Configuration
|
|
@EnableJpaRepositories(basePackages = "a.customers", entityManagerFactoryRef = "customersEntityManagerFactory")
|
|
@EnableJpaRepositories(basePackages = "a.orders", entityManagerFactoryRef = "ordersEntityManagerFactory")
|
|
class RepeatedEnable {
|
|
}
|