diff roundup/backends/rdbms_common.py @ 1333:80d27b7d6db5

implemented whole-database locking
author Richard Jones <richard@users.sourceforge.net>
date Thu, 12 Dec 2002 09:31:04 +0000
parents 61ad556cfc8d
children 618aa9c37d65
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Wed Dec 11 11:37:07 2002 +0000
+++ b/roundup/backends/rdbms_common.py	Thu Dec 12 09:31:04 2002 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.24 2002-11-06 11:38:42 richard Exp $
+# $Id: rdbms_common.py,v 1.25 2002-12-12 09:31:04 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -28,6 +28,7 @@
 from roundup import hyperdb, date, password, roundupdb, security
 from roundup.hyperdb import String, Password, Date, Interval, Link, \
     Multilink, DatabaseError, Boolean, Number
+from roundup.backends import locking
 
 # support
 from blobfiles import FileStorage
@@ -62,6 +63,9 @@
         self.cache = {}
         self.cache_lru = []
 
+        # database lock
+        self.lockfile = None
+
         # open a connection to the database, creating the "conn" attribute
         self.open_connection()
 
@@ -903,6 +907,11 @@
         ''' Close off the connection.
         '''
         self.conn.close()
+        if self.lockfile is not None:
+            locking.release_lock(self.lockfile)
+        if self.lockfile is not None:
+            self.lockfile.close()
+            self.lockfile = None
 
 #
 # The base Class class

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