I have run into a scenario during development and am trying to understand if I am doing something wrong or if this is a current limitation to the CAP framework. The problem is specific to running locally in development and the usage of sqlite.
The scenario is where there are two independent CAP services that both use a shared common CodeList definition (sap.common.Countries in this example), and also share some portion of the dataset (say both have Germany as a country in their related CSV files). Both of these services are then consumed by a third CAP Service. Here is the scenario visually:
I have recreated this scenario in a very simple project containing all three services (each running at a separate port via the .env file). This project can be found at the following public repository: ext-srv-conflict
If I run each of these apps individually (cds watch app-1, cds watch app-2, cds watch app-3) on my local development system, I get an error when attempting to run App 3 giving the following error message: [ERROR] in cds.deploy(): ENTITY_ALREADY_EXISTS
It appears that although these services are running independently, the third service is still trying to load the countries CSV files for the two service dependencies in its own database schema. This also occurs when you only run App 3 independently and the framework attempts to mock App 1 and App 2.
It appears that even though App-3 is not mocking the services, it still attempts to load the database entries and it is using a shared database entity between the App1 and App 2 services.
Any suggestions on how to address this issue? All help greatly appreciated!