dabo Commit
Revision 5436
Date: 2009-09-27 06:34:44 -0700 (Sun, 27 Sep 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5436
Changed:
U trunk/dabo/biz/dBizobj.py
Log:
Fixed a bug that could cause the current cursor of the bizobj to be changed
during a saveAll() call.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2009-09-26 22:53:53 UTC (rev 5435)
+++ trunk/dabo/biz/dBizobj.py 2009-09-27 13:34:44 UTC (rev 5436)
@@ -353,7 +353,7 @@
rp = self._RemoteProxy
if rp:
return rp.saveAll(startTransaction=startTransaction)
- cursor = self._CurrentCursor
+ cursorKey = self.__currentCursorKey
current_row = self.RowNumber
startTransaction = startTransaction and self.beginTransaction()
try:
@@ -363,25 +363,24 @@
self.commitTransaction()
except dException.ConnectionLostException:
+ self._CurrentCursor = cursorKey
self.RowNumber = current_row
- self._CurrentCursor = cursor
raise
except dException.DBQueryException:
# Something failed; reset things.
if startTransaction:
self.rollbackTransaction()
- # Pass the exception to the UI
+ self._CurrentCursor = cursorKey
self.RowNumber = current_row
- self._CurrentCursor = cursor
+ # Pass the exception to the UI
raise
except dException.dException:
if startTransaction:
self.rollbackTransaction()
+ self._CurrentCursor = cursorKey
self.RowNumber = current_row
- self._CurrentCursor = cursor
raise
-
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
if current_row >= 0:
try:
self.RowNumber = current_row
@@ -494,7 +493,7 @@
"""Delete all children associated with the current record
without
deleting the current record in this bizobj.
"""
- cursor = self._CurrentCursor
+ cursorKey = self.__currentCursorKey
errMsg = self.beforeDeleteAllChildren()
if errMsg:
raise dException.BusinessRuleViolation(errMsg)
@@ -509,14 +508,14 @@
except dException.DBQueryException:
if startTransaction:
self.rollbackTransaction()
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
raise
except StandardError:
if startTransaction:
self.rollbackTransaction()
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
raise
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
self.afterDeleteAllChildren()
@@ -580,7 +579,7 @@
rp = self._RemoteProxy
if rp:
return rp.deleteAll()
- cursor = self._CurrentCursor
+ cursorKey = self.__currentCursorKey
startTransaction = startTransaction and self.beginTransaction()
try:
while self.RowCount > 0:
@@ -595,14 +594,14 @@
except dException.DBQueryException:
if startTransaction:
self.rollbackTransaction()
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
raise
except StandardError:
if startTransaction:
self.rollbackTransaction()
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
raise
- self._CurrentCursor = cursor
+ self._CurrentCursor = cursorKey
def execute(self, sql, params=None):
@@ -850,7 +849,6 @@
literal = False
valOrExpr = valOrExpr.strip()[1:]
valOrExpr = self._fldReplace(valOrExpr)
- print "VOEX", valOrExpr
valOrExpr = eval(valOrExpr)
except AttributeError:
# Not a string expression; no worries
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]