summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 72518f2)
raw | patch | inline | side by side (parent: 72518f2)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 13 Feb 2003 07:33:38 +0000 (07:33 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 13 Feb 2003 07:33:38 +0000 (07:33 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1502 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_anydbm.py | patch | blob | history |
index ace6c45e408f97bde97771242eb9d9bd10fbb9d6..8d389c30d511aa1b059dd228db02a178d9219d0a 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.101 2003-02-12 00:00:18 richard Exp $
+#$Id: back_anydbm.py,v 1.102 2003-02-13 07:33:38 richard Exp $
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
if db is None:
db = self.getclassdb(classname)
if not db.has_key(nodeid):
+ # try the cache - might be a brand-new node
+ cache_dict = self.cache.setdefault(classname, {})
+ if cache_dict.has_key(nodeid):
+ if __debug__:
+ print >>hyperdb.TRACE, 'get %s %s cached'%(classname,
+ nodeid)
+ return cache_dict[nodeid]
raise IndexError, "no such %s %s"%(classname, nodeid)
# check the uncommitted, destroyed nodes