From 7d0037b30545c90dbad20cdaa93d3fd0bf31a250 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 31 Mar 2023 16:50:24 +0800 Subject: [PATCH] fix(nocodb): add missing await for transaction --- .../src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts index 182cbb66de..8ab975d42c 100644 --- a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts @@ -2132,7 +2132,7 @@ class BaseModelSqlv2 { updatePkValues.push(pkValues); } - transaction.commit(); + await transaction.commit(); for (const pkValues of updatePkValues) { newData.push(await this.readByPk(pkValues)); @@ -2142,7 +2142,7 @@ class BaseModelSqlv2 { return res; } catch (e) { - if (transaction) transaction.rollback(); + if (transaction) await transaction.rollback(); throw e; } } @@ -2220,13 +2220,13 @@ class BaseModelSqlv2 { res.push(d); } - transaction.commit(); + await transaction.commit(); await this.afterBulkDelete(deleted, this.dbDriver, cookie); return res; } catch (e) { - if (transaction) transaction.rollback(); + if (transaction) await transaction.rollback(); console.log(e); throw e; }