diff roundup/backends/rdbms_common.py @ 3687:ff9f4ca42454

Postgres backend allows transaction collisions to be ignored when... ...committing clenup in the sessions database
author Richard Jones <richard@users.sourceforge.net>
date Tue, 29 Aug 2006 04:20:50 +0000
parents 4d9adb8bc3b1
children 722ab52d47fc
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Sun Aug 27 11:34:12 2006 +0000
+++ b/roundup/backends/rdbms_common.py	Tue Aug 29 04:20:50 2006 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 #
-#$Id: rdbms_common.py,v 1.177 2006-08-23 12:57:10 schlatterbeck Exp $
+#$Id: rdbms_common.py,v 1.178 2006-08-29 04:20:50 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1188,23 +1188,30 @@
                 "action<>'create'"%(classname, self.arg)
             self.sql(sql, (date_stamp,))
 
-    def sql_commit(self):
+    def sql_commit(self, fail_ok=False):
         ''' Actually commit to the database.
         '''
         logging.getLogger('hyperdb').info('commit')
+
         self.conn.commit()
 
         # open a new cursor for subsequent work
         self.cursor = self.conn.cursor()
 
-    def commit(self):
+    def commit(self, fail_ok=False):
         ''' Commit the current transactions.
 
         Save all data changed since the database was opened or since the
         last commit() or rollback().
+
+        fail_ok indicates that the commit is allowed to fail. This is used
+        in the web interface when committing cleaning of the session
+        database. We don't care if there's a concurrency issue there.
+
+        The only backend this seems to affect is postgres.
         '''
         # commit the database
-        self.sql_commit()
+        self.sql_commit(fail_ok)
 
         # now, do all the other transaction stuff
         for method, args in self.transactions:

Roundup Issue Tracker: http://roundup-tracker.org/