commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7909 - trunk/gnue-common/src/datasources


From: reinhard
Subject: [gnue] r7909 - trunk/gnue-common/src/datasources
Date: Thu, 15 Sep 2005 07:20:56 -0500 (CDT)

Author: reinhard
Date: 2005-09-15 07:20:55 -0500 (Thu, 15 Sep 2005)
New Revision: 7909

Modified:
   trunk/gnue-common/src/datasources/GDataSource.py
Log:
Bugfix: call function on correct record, do requery even if function call
throws an exception.


Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2005-09-15 12:15:47 UTC 
(rev 7908)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2005-09-15 12:20:55 UTC 
(rev 7909)
@@ -200,15 +200,20 @@
   # ---------------------------------------------------------------------------
 
   def __trigger_call (self, name, params):
-    # The update function is not available for backends that need a rollback
+    # The call function is not available for backends that need a rollback
     # after a post have failed. Reason: we do an uncommmitted post here, and a
     # rollback in a later post would also roll back this post, and all changes
     # in this post would get lost.
     if self._connection._need_rollback_after_exception_:
       raise Exceptions.FunctionNotAvailable
+    # Remember current record; record pointer is not reliable between postAll
+    # and requeryAll!
+    current = self.__currentResultSet.current
     self.postAll ()
-    result = self.__currentResultSet.current.call (name, params)
-    self.requeryAll (False)
+    try:
+      result = current.call (name, params)
+    finally:
+      self.requeryAll (False)
     return result
 
   # ---------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]