cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to connect to Shared HDI Container in different Space.

thomasnguyen1
Explorer
0 Kudos

Hi Experts,

We have a case like below:

thomasnguyen1_0-1715823555857.png

We have 2 spaces, Dev and Test.

After I develop the APP in the Dev space, I deploy it to the Test space, but I don't want to create additional Hana DB instances in the Test space and want to reuse the ones from the DEV space.

Is there any way to do that? (As far as I know, it's not possible).

I tried following the approach by @MioYasutake , Scenario 4.

Link: https://community.sap.com/t5/technology-blogs-by-members/how-to-share-tables-across-different-cap-pr...

Git: https://github.com/miyasuta/cap-cross-container

But encountered an error during the deployment process, as shown below:

Spoiler
Error: Database error 7feature not supported: grantor and grantee are identical [8201003]
Error: Granting schema roles in the container "CAPM_PROJECT_SCHEMA" and the parameters "[]"... failed [8214221
 ErrorError executing: CALL "CAPM_PROJECT_SCHEMA#DI".GRANT_CONTAINER_SCHEMA_ROLES(#CONTAINER_ROLES, #CONTAINER_ROLES_PARAMETERS, ?, ?, ?); (STDERR, APP/TASK/deploy)#
Please give me advice.
Thanks so much,
Thomas.
View Entire Topic
MioYasutake
Active Contributor

@thomasnguyen1 

In the scenario 4 of my blog, two HDI containers are introduced. One HDI container is used to deploy tables and views defined within CAP, and the other HDI container contains existing tables and views, which are accessed by the first HDI container.

In your scenario, you only need one HDI container, so the definitions for roles and grants may not be necessary. This might be causing the "grantor and grantee are identical" error.

What I suggest is to use the user-provided-service in the mta.yaml file as if it were a regular HDI container. However, I have not tried this scenario myself, so I am not sure if it will work as expected.

thomasnguyen1
Explorer
0 Kudos
Thanks for your reply,
thomasnguyen1
Explorer
0 Kudos

Thank you for your reply. I have also tried removing .hdbgrant and deploying the app. The deployment was successful, but when testing the service, it reported the error "No database credentials provided". I think my scenario is impossible, however, I don't have any document to confirm that.