Skip to Content
0

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

May 19, 2017 at 01:30 PM

339

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Tomasz Wilk Oct 17, 2017 at 11:51 AM
0

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).

Share
10 |10000 characters needed characters left characters exceeded
Lucia Subatin
Nov 01, 2017 at 01:41 AM
0

What is the version of hdbext you are using?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member
Feb 05 at 02:22 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded