From acba58a01cec90f742b1fd5816a0722400d006e6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Sep 2011 18:34:27 +0530 Subject: [PATCH] commit after every 100 in rebuild_tree --- cgi-bin/webnotes/utils/nestedset.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cgi-bin/webnotes/utils/nestedset.py b/cgi-bin/webnotes/utils/nestedset.py index cb9f195849..e88f351659 100644 --- a/cgi-bin/webnotes/utils/nestedset.py +++ b/cgi-bin/webnotes/utils/nestedset.py @@ -156,6 +156,8 @@ def rebuild_tree(doctype, parent_field): result = webnotes.conn.sql("SELECT name FROM `tab%s` WHERE `%s`='' or `%s` IS NULL" % (doctype, parent_field, parent_field)) for r in result: right = rebuild_node(doctype, r[0], right, parent_field) + webnotes.conn.sql("commit") + webnotes.conn.sql("start transaction") def rebuild_node(doctype, parent, left, parent_field, cnt = 0): """