diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 759829556e..e283aff1c4 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -5699,7 +5699,7 @@ class BaseModelSqlv2 { trx?: any; } = {}, ) { - let transaction; + const transaction = trx ?? (await this.dbDriver.transaction()); try { const columns = await this.model.getColumns(this.context); @@ -5809,8 +5809,6 @@ class BaseModelSqlv2 { } } - transaction = trx ?? (await this.dbDriver.transaction()); - for (const o of toBeUpdated) { await transaction(this.tnPath).update(o.d).where(o.wherePk); }