Skip to content

Commit

Permalink
fix(hana): ensure the database connection does not enable auto commit (
Browse files Browse the repository at this point in the history
  • Loading branch information
BobdenOs authored Feb 12, 2024
1 parent 22e1c43 commit b2ca1da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hana/lib/HANAService.js
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,10 @@ class HANAService extends SQLService {
return super.onPlainSQL(req, next)
}

onBEGIN() { }
onBEGIN() {
DEBUG?.('BEGIN')
return this.dbc?.begin()
}

onCOMMIT() {
DEBUG?.('COMMIT')
Expand Down
7 changes: 7 additions & 0 deletions hana/lib/drivers/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ class HANADriver {
throw new Error('Implementation missing "set"')
}

/**
* Starts a new transaction
*/
async begin() {
this._native.setAutoCommit(false)
}

/**
* Commits the current transaction
*/
Expand Down

0 comments on commit b2ca1da

Please sign in to comment.