commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7090 - in trunk/gnue-forms/src: . GFObjects


From: reinhard
Subject: [gnue] r7090 - in trunk/gnue-forms/src: . GFObjects
Date: Fri, 4 Mar 2005 11:47:03 -0600 (CST)

Author: reinhard
Date: 2005-03-04 11:47:02 -0600 (Fri, 04 Mar 2005)
New Revision: 7090

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/GFObjects/GFBlock.py
Log:
In case the last record of a block is deleted, insert the new empty record
*after* the commit, not before, so initializations will be part of the new
transaction.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2005-03-04 14:55:59 UTC (rev 7089)
+++ trunk/gnue-forms/src/GFForm.py      2005-03-04 17:47:02 UTC (rev 7090)
@@ -657,6 +657,10 @@
         for conn in self.__getConnections ().values ():
           conn.commit ()
 
+        # Make sure the block is in consistent state again
+        for block in self._logic._blockList:
+          block.finalizeCommit ()
+
         # Execute Post-Commit-Trigger for each block
         for block in self._logic._blockList:
           block.processTrigger ('Post-Commit')
@@ -665,10 +669,6 @@
           if block.autoClear:
             block.processClear ()
 
-          else:
-            gDebug (5, "switchRecord (0) from commit")
-            block.switchRecord (0)
-
         self.dispatchEvent ('cannotCOMMIT')
         self.dispatchEvent ('cannotROLLBACK')
 

Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py   2005-03-04 14:55:59 UTC (rev 
7089)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py   2005-03-04 17:47:02 UTC (rev 
7090)
@@ -553,22 +553,20 @@
       # The real commit will be done by the form once per connection
       # self._dataSourceLink._dataObject.commit()
 
+  #
+  # Called after the commit on the backend is through.
+  #
+  def finalizeCommit (self):
+
+    # Our recordCount might have changed if records were deleted
     self._recordCount = self._resultSet.getRecordCount()
 
-    # Make sure the block is aware of the current
-    # position in the records.  If this is removed
-    # ui corruption can occur in zipcode.gfd if
-    # you commit while in or after a record that
-    # is to be deleted.
-
-    if self._recordCount:
-      self.jumpRecord(self._precommitRecord)
-
-    # If all our records were deleted, create an empty record
+    # If all records were deleted, create an empty new one, otherwise make sure
+    # we move the record pointer to the correct record
     if not self._recordCount:
       self.newRecord()
     else:
-      self.jumpRecord(self._resultSet.getRecordNumber())
+      self.jumpRecord(self._precommitRecord)
 
     self.mode='normal'
 





reply via email to

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