Multiple entity saving

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:

  1. Get the data from DB1
  2. Do the treatements
  3. if situation = 1, than save in DB2
  4. Else save in DB3

Hi,

Jmix supports multiple databases by default on entity level. So you can simply create two entities that are mapped to two different data stores. See: Data Stores :: Jmix Documentation

If the structure is exactly the same, you might also be able to reuse one entity and dynamically determine the data store, but this might require more custom coding.

Cheers
Mario