Asynchronous connections to HANA Database
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 322
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Hello everyone,
Yes, I've seen that this project is actually closed as node-hdb has been moved under SAP development and it's under @sap/hana-client, however I would like to ask here for assistance since I do not see any possible support from SAP about it.
My target is to create simple NodeJS HANA Availability monitoring, it already works fine but not as I would expect it to work, together with new databases in monitoring the connection is taking longer and longer time.
I am running async database connections to check it availability, and then disconnect.
My code runs asynchronous but the problem seems to be in the hana library itself, as with every additional connection, the time needed to perform connections is way longer.
My code is:
async function hdbAsync(DB_SID, DB_HOSTNAME, DB_PORT) {
const hdbConn = {
host: DB_HOSTNAME,
port: DB_PORT,
uid: '*****',
pwd: '*****'
};
return new Promise((resolve, reject) => {
let hdb = han.createConnection();
hdb.connect(hdbConn, function (error) {
if (error) {
reject(false)
return
}
hdb.exec('SELECT * FROM SYS.DUMMY', function (error, res) {
if (error) {
hdb.disconnect();
reject(false)
return
}
hdb.disconnect();
resolve(true);
return
})
})
})
}
Above code runs asynchronously, when I enable trace I can see that hdb.connect is being executed in parallel in the same second. But the connection is taking longer and longer with each added connection. It looks like some parameter or something that limit maximum connections in parallel - i am not sure.
Are you able to advise? Thank you in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is identified. Start by reproducing the increasing latency around hdb.connect, hdb.exec, and hdb.disconnect with parallel Node.js connections; done would require identifying the limiting behavior, but the issue does not define an expected implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100