From 6b49b5f32aee3484280a7cb964c9273173da19d8 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Fri, 20 Oct 2023 12:35:55 +0530 Subject: [PATCH] chore: move check_implicit_commit() call back to its original location Signed-off-by: Akhil Narang --- frappe/database/database.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index d6503161c8..6ca72088c3 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -375,12 +375,11 @@ class Database: """Raises exception if more than 200,000 `INSERT`, `UPDATE` queries are executed in one transaction. This is to ensure that writes are always flushed otherwise this could cause the system to hang.""" + self.check_implicit_commit(query) if query and is_query_type(query, ("commit", "rollback")): self.transaction_writes = 0 - self.check_implicit_commit(query) - if query[:6].lower() in ("update", "insert", "delete"): self.transaction_writes += 1 if self.transaction_writes > self.MAX_WRITES_PER_TRANSACTION: