I am using JPA with Hibernate as my JPA provider. My application need to connect to database defined in persistence.xml (default persistence unit) grab multiple configured systems from table and create for each of them EntityManagerFactory (systems differ only in connection params, dialect and driver).
Is it possible to do it with "template" persistence unit? For now I'm using different copy persistence unit for each system but it's seems senseless.
You probably need to write your own JCA compliant connector that wraps the distinct DB connectors and expose that via JPA:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With