So I was wondering how following problem would be solved best in a JPA/JavaEE enviroment:
Imagine you have multiple stores, each equipped with a separate database (but the same domain structure). Every night all databases are going to be interrogated by a main HQ Server and some calculations are done.
In my opinion, the best solution would be:
- Timer which schedules the interrogation.
- Multiple DataSources for each store
- Maybe some producers (for each store one) to use deltaspike data.
Is there a way to reduce the overhead of multiple configuration and PersistenceContexts to use the same operations on all databases? Like some sort of strategy pattern for JPA?