Skip to content

Commit

Permalink
Commented existing this.tx().begin() code
Browse files Browse the repository at this point in the history
  • Loading branch information
danjoa committed Nov 20, 2023
1 parent 81472b9 commit d00cc4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db-service/lib/common/DatabaseService.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class DatabaseService extends cds.Service {
async begin() {
// We expect tx.begin() being called for an txed db service
const ctx = this.context
if (!ctx) return this.tx().begin() // REVISIT: Is this correct? When does this happen?

// If .begin is called explicitly it starts a new transaction and executes begin
if (!ctx) return this.tx().begin()

// REVISIT: tenant should be undefined if !this.isMultitenant
let isMultitenant = 'multiTenant' in this.options ? this.options.multiTenant : cds.env.requires.multitenancy
Expand Down

0 comments on commit d00cc4e

Please sign in to comment.