Skip to Content
0
Jan 05, 2023 at 09:57 PM

1 Node js module connecting to 2 database modules in SAP Hana

295 Views

Hello All,

I have a Node js Module, 1 SAP UI5 module and 4 database modules. My UI5 module connects to 1 Node js module which connects to only 1 database module and it all works fine.

Now I have a new requirement where in I need to connect the Nodejs module to 2 database modules. So I changed the mta.yaml file as shown below to include db_2 resource and module.

- name: Node_1

type: nodejs

path: Node_1

provides:

- name: Node_base_api

properties:

url: '${default-url}'

requires:

- name: hdi_1

- name: UAA-service

- name: db_1

- name: hdi_2

- name: db_2

I also included a new xsodata file in xsodata folder in Node js module which has a calc view in the new db_2 module.

After building and running the Nodejs and SAP UI5 module, my previous Odata services are also not working. When I try to access the previous xsodata files in xsodata folder, I get the below error.

500 Invalid HANA settings provided. OData services are disabled.

Error: Invalid HANA settings provided. OData services are disabled.
    at /hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/lib/index.js:144:14
    at Layer.handle [as handle_request] (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/index.js:317:13)
    at /hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/index.js:335:12)
    at next (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/index.js:275:10)
    at urlRewriteMiddleware (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/lib/middleware.js:54:5)
    at Layer.handle [as handle_request] (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/index.js:317:13)   at /hana/shared/EHD/xs/app_working/r3dbehd.sempra.com/executionroot/ab4c3200-b9d9-42c0-a9b1-6407c588c02c/app/node_modules/@sap/xsjs/node_modules/express/lib/router/index.js:284:7

Now that we get the error , even if we change the mta.yaml file to remove the new db2 module and resource and also delete the new .XSODATA files, the error comes for the old .xsodata files.

Is it that one Nodejs module can only connect to one database module in Hana.