We have the requirement to insert records into two data sources using JPA.
What is the correct approach to this problem?
How can we declare different persistence units with different data sources and manage two entity managers and inject with default persistence context for default unit name without mentioning the unit name in the generic dao for first datasource and overriding the context with the unit name in a separate dao for other tables in second datasource.
The spring documentation is very limited and has no example.
Examples would be of great help.