Skip to content

Commit 49b760a

Browse files
author
Richard Jones
committed
more backend database strangeness fixed
1 parent 2cbc591 commit 49b760a

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Fixed:
99
. #603696 ] Mail followup not inserted
1010
. #603703 ] way to unassign issues
1111
. some more fixes to property editing through the web
12+
. fixed some more database opening and detection problems
1213

1314

1415
2002-07-25 0.4.3

roundup/backends/back_anydbm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.37.2.1 2002-07-10 06:30:47 richard Exp $
18+
#$Id: back_anydbm.py,v 1.37.2.2 2002-09-03 06:35:16 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -151,8 +151,8 @@ def _opendb(self, name, mode):
151151
# new database? let anydbm pick the best dbm
152152
if not db_type:
153153
if __debug__:
154-
print >>hyperdb.DEBUG, "_opendb anydbm.open(%r, 'n')"%path
155-
return anydbm.open(path, 'n')
154+
print >>hyperdb.DEBUG, "_opendb anydbm.open(%r, 'c')"%path
155+
return anydbm.open(path, 'c')
156156

157157
# open the database with the correct module
158158
try:
@@ -488,6 +488,9 @@ def rollback(self):
488488

489489
#
490490
#$Log: not supported by cvs2svn $
491+
#Revision 1.37.2.1 2002/07/10 06:30:47 richard
492+
# . #571170 ] gdbm deadlock
493+
#
491494
#Revision 1.37 2002/06/20 23:52:35 richard
492495
#More informative error message
493496
#

roundup/backends/back_bsddb.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_bsddb.py,v 1.18 2002-05-15 06:21:21 richard Exp $
18+
#$Id: back_bsddb.py,v 1.18.2.1 2002-09-03 06:35:16 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in BSDDB.
2121
'''
@@ -49,7 +49,7 @@ def getclassdb(self, classname, mode='r'):
4949
if os.path.exists(path):
5050
return bsddb.btopen(path, mode)
5151
else:
52-
return bsddb.btopen(path, 'n')
52+
return bsddb.btopen(path, 'c')
5353

5454
def _opendb(self, name, mode):
5555
'''Low-level database opener that gets around anydbm/dbm
@@ -61,8 +61,8 @@ def _opendb(self, name, mode):
6161
path = os.path.join(os.getcwd(), self.dir, name)
6262
if not os.path.exists(path):
6363
if __debug__:
64-
print >>hyperdb.DEBUG, "_opendb bsddb.open(%r, 'n')"%path
65-
return bsddb.btopen(path, 'n')
64+
print >>hyperdb.DEBUG, "_opendb bsddb.open(%r, 'c')"%path
65+
return bsddb.btopen(path, 'c')
6666

6767
# open the database with the correct module
6868
if __debug__:
@@ -119,6 +119,14 @@ def _doSaveJournal(self, classname, nodeid, action, params):
119119

120120
#
121121
#$Log: not supported by cvs2svn $
122+
#Revision 1.18 2002/05/15 06:21:21 richard
123+
# . node caching now works, and gives a small boost in performance
124+
#
125+
#As a part of this, I cleaned up the DEBUG output and implemented TRACE
126+
#output (HYPERDBTRACE='file to trace to') with checkpoints at the start of
127+
#CGI requests. Run roundup with python -O to skip all the DEBUG/TRACE stuff
128+
#(using if __debug__ which is compiled out with -O)
129+
#
122130
#Revision 1.17 2002/04/03 05:54:31 richard
123131
#Fixed serialisation problem by moving the serialisation step out of the
124132
#hyperdb.Class (get, set) into the hyperdb.Database.

0 commit comments

Comments
 (0)