I am working in a project where, depending on the situation, i need to save some entity in a different database. The service gets the initial data in one DB, but after some data treatments, I need to save in a different DB. I was trying to use the EntityManager to create a new one. How can I access different data stores in this case?
I can resume the situation like this:
- Get the data from DB1
- Do the treatements
- if situation = 1, than save in DB2
- Else save in DB3