From 2ad370ec3ed46bbe41636dbcb8a0ec4f22ce8403 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 2 Sep 2013 14:58:14 +0530 Subject: [PATCH] [fix] [minor] reverted begin code, since it is not required --- webnotes/db.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/webnotes/db.py b/webnotes/db.py index 6ae170aa1a..38f5e3951c 100644 --- a/webnotes/db.py +++ b/webnotes/db.py @@ -19,7 +19,6 @@ class Database: def __init__(self, host=None, user=None, password=None, ac_name=None, use_default = 0): self.host = host or 'localhost' self.user = user or conf.db_name - self.in_transaction = False if ac_name: self.user = self.get_db_login(ac_name) or conf.db_name @@ -431,18 +430,14 @@ class Database: return webnotes.defaults.get_defaults(parent) def begin(self): - if not self.in_transaction: - self.sql("start transaction") - self.in_transaction = True + return # not required def commit(self): self.sql("commit") - self.in_transaction = False def rollback(self): self.sql("ROLLBACK") self.transaction_writes = 0 - self.in_transaction = False def field_exists(self, dt, fn): return self.sql("select name from tabDocField where fieldname=%s and parent=%s", (dt, fn))