saphanaacademy/XSA

$.hdb.getConnection() undefined

Closed this issue · 1 comments

Hi everyone,

im facing different issues trying to do this tinyworld exercice, and hope someone please help:

#1
In section 5 of this tutorial : "Add business logic" there's a step to create a function in javascript called "saveCountry" and this is it:

function saveCountry(country){
    var conn = $.hdb.getConnection();
    var output = JSON.strigify(countr);
    // TRUNCATED...
}

Then, running this tinyjs module, i got this error: 500 Cannot read property 'getConnection' of undefined

Do i need another library in order to use $.hdb object?

#2

Once i have created the tinyjs_api and in order to consume data from hdi-container, by running "tinyui" module, i need to run this "tinyjs" module first, otherwise, tinyui in the table object, said: "No data".
mta.yaml is wrong?

#3
Once i have created this module called "tinyjs", automatically create this file: "server.js", on it there's this code:

try{
    options = Object.assign(options, xsenv.getServices({hana: {tag: "hana"}});
    // also tried with {hana : {tag: "myhana"}}
   console.log(options); // i add this line
}catch(err){
   console.log("[WARN]: " + err.message);
}

And i always got: [WARN] : No service matches hana

I have created a service using this command line:
xs create-service hana hdi-shared myhana

This third issue, is more like an un-related issue to this tutorial, since im trying to do the same tutorial directly from cli, creating by myself all tutorial's steps.

Thanks for all the help!

PS.- Im running this HANA Version:

HDB version info:
  version:             2.00.030.00.1522210459
  branch:              hanaws
  machine config:      linuxx86_64
  git hash:            bb2ff6b25b8eab5ab382c170a43dc95ae6ce298f
  git merge time:      2018-03-28 06:14:19
  weekstone:           2018.13.0
  cloud edition:       0000.00.00
  compile date:        2018-03-28 06:19:13
  compile host:        ld2221
  compile type:        rel

Hi, Thanks for posting. This tutorial was created using HANA 1.0 SPS12 rather than HANA 2 which is what you're using. I'd recommend posting your questions on the blog which the video was based on: https://blogs.sap.com/2016/03/28/developing-with-xs-advanced-add-business-logic-with-nodejs/ Thanks