Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improved connection pool for HANAService #349

Merged
merged 15 commits into from
Dec 6, 2023

Conversation

BobdenOs
Copy link
Contributor

@BobdenOs BobdenOs commented Nov 20, 2023

  1. Uses @sap/hana-client native connection pool implementation
  2. Detects when a connection is closed by the database when using node-hdb
  3. Adds validation checks for borrowed connections
  4. Aligns @sap/hana-client credential mappings to the old HANA Service

creds.pooling = true
Object.assign(creds, {
// Enables the @sap/hana-client native connection pool implementation
pooling: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creds.pooling is set to true twice, reason?

const driver = drivers[this.options.driver || this.options.credentials.driver]?.driver || drivers.default.driver
const dbc = new driver(this.options.credentials)
options: driver.pool // Ignore generic-pool when native pool is available
? { min: 0, max: 1000 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the default values we've dicussed → documented in our internal bli

},
create: async (tenant) => {
const creds = isMultitenant
? await require('@sap/cds-mtxs/lib').xt.serviceManager.get(tenant, { disableCache: this.disableCache || false })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is this.disableCache set?
I think we need to enhance the error listener here.
Also if the credentials are wrong in mt scenario, we should not crash but stop fetching the credentials from service manager after e. g. 3 times.

maxPoolSize: 100, // TODO: align to options.pool configurations

// If communicationTimeout is not set queries will hang for over 10 minutes
communicationTimeout: 5000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those properties "mappable" 1-1 to generic-pool settings?

@johannes-vogel johannes-vogel merged commit 1c284e6 into main Dec 6, 2023
@johannes-vogel johannes-vogel deleted the hana-pool-configuration branch December 6, 2023 08:57
@cap-bots cap-bots mentioned this pull request Dec 5, 2023
@cap-bots cap-bots mentioned this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants