Skip to content

Commit

Permalink
Merge pull request #11 from revolut-engineering/dpl-215-fix-multiple-…
Browse files Browse the repository at this point in the history
…connections

Ensure connection state is not global
  • Loading branch information
bruwozniak authored Apr 23, 2021
2 parents f62006a + c5dc9b8 commit a259fe1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ls/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default class ExasolDriver extends AbstractDriver<DriverLib, DriverOption
this.log.info(`Opening connection to ${this.credentials.server}:${this.credentials.port}`);

this.connection = await new Promise<any>((resolve, reject) =>
Exasol(`ws://${this.credentials.server}:${this.credentials.port}`, this.credentials.username, this.credentials.password,
Exasol.call({}, // we must pass a new thisArg object each time as connection state is kept there and we might spawn multiple connections
`ws://${this.credentials.server}:${this.credentials.port}`, this.credentials.username, this.credentials.password,
resolve,
this.rejectErr(reject))
).then(db =>
Expand Down Expand Up @@ -139,7 +140,6 @@ export default class ExasolDriver extends AbstractDriver<DriverLib, DriverOption
if (result.resultSet.resultSetHandle !== undefined) {
const handle = +result.resultSet.resultSetHandle
const expectedResults = opt.fullResults ? queryResultCount : Math.min(MAX_RESULTS, queryResultCount)
this.log.info(`expectedResults: ${expectedResults}`);
while (queryResults.length < expectedResults) {
const fetchResult: QueryFetchResult = await this.queue.add(
() => new Promise(
Expand Down

0 comments on commit a259fe1

Please sign in to comment.