Skip to Content

[XS Advanced] HDBEXT - Error during pool.acquire()

Hello everyone,

in our projekt we are having a NodeJS application that connects to the HANA database via the node-module "sap-hdbext". Just like in several example regarding that matter we use ExpressJS as our REST-Interface.
The code where we connect the HDB-Middleware to Express looks like this:

Then in the express routes we use "var db = req.db" to get a database session from the middleware. On that we are able to call db.exec(...) and so on. Everything works fine so far...at least most of the time. Sometimes we get the following error message as soon as we call one of the routes:

„error: SAP_HDBEXT MIDDLEWARE: error during pool.acquire(): {"message":"the predefined session variable cannot be set via SET command: XS_APPLICATIONUSER","code":455,"sqlState":"HY000","level":1,"position":0,"status":500}

Error: the predefined session variable cannot be set via SET command: XS_APPLICATIONUSER”

So express apparently fails to retrieve a connection from the middleware offered by sap-hdbext. Restarting or redeploying the application doesn't help and it usually affects all NodeJS application using that method of creating db sessions. It does not always affect all users at a time but it does happen to every user once in while without ANY pattern noticable.

Usually after a couple of hours or on the next day everything works fine again without having changed anything.

Has anyone had the same issue or has an idea where it originates?

I'm thankful for any help!

Best Regards,

Henrik Lawall

node.png (151.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Feb 05, 2018 at 02:22 PM

    Hi,

    I just stumbled over the same error. I was able to fix it by switching two lines of code. It works by first connecting to the HANA middleware before calling the passport authentication.

    Cheers,

    Markus

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 17, 2017 at 11:51 AM

    Did you find answer to this question? We have a similar issue with node.js on XSA/ODATA. After few dates, when sapui5 application is run, odata returns set XS_APPLICATIONUSER error. We are doing an investigation, at the moment we think it may be connected to limited resources (we have a minimal set), problem with acquiring connections from db pool, some wrong configuration of JS <-> DB connection (but I believe we have standard set).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 01, 2017 at 01:41 AM

    What is the version of hdbext you are using?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.