commit-gnue
[Top][All Lists]
Advanced

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

r5534 - in trunk: gnue-appserver/src gnue-common/src/datasources


From: reinhard
Subject: r5534 - in trunk: gnue-appserver/src gnue-common/src/datasources
Date: Fri, 26 Mar 2004 11:24:04 -0600 (CST)

Author: reinhard
Date: 2004-03-26 11:24:03 -0600 (Fri, 26 Mar 2004)
New Revision: 5534

Modified:
   trunk/gnue-appserver/src/data.py
   trunk/gnue-common/src/datasources/GConnections.py
Log:
Send rollback to the database to indicate start of a new transaction.


Modified: trunk/gnue-appserver/src/data.py
===================================================================
--- trunk/gnue-appserver/src/data.py    2004-03-26 16:19:16 UTC (rev 5533)
+++ trunk/gnue-appserver/src/data.py    2004-03-26 17:24:03 UTC (rev 5534)
@@ -504,7 +504,13 @@
     Undo all uncommitted changes.
     """
 
-    # Nothing written to the database yet, we only have to clean up the cache.
+    # Send the rollback to the database. Although we have (most probably) not
+    # written anything yet, we have to tell the database that a new transaction
+    # starts now, so that commits from other sessions become valid now for us
+    # too.
+    self.__connections.rollbackAll ()
+
+    # Clean up the cache
     self.__cache.undo ()
 
   # ---------------------------------------------------------------------------

Modified: trunk/gnue-common/src/datasources/GConnections.py
===================================================================
--- trunk/gnue-common/src/datasources/GConnections.py   2004-03-26 16:19:16 UTC 
(rev 5533)
+++ trunk/gnue-common/src/datasources/GConnections.py   2004-03-26 17:24:03 UTC 
(rev 5534)
@@ -473,6 +473,14 @@
       connection.commit()
 
 
+  def rollbackAll(self):
+    """
+    This function rolls back all transactions
+    """
+    for connection in self._openConnections.values ():
+      connection.rollback()
+
+
   def closeAll(self):
     """
     This function closes all open connections.





reply via email to

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