[Checkins] SVN: relstorage/branches/1.2/ Merged the database initialization warning fix

Shane Hathaway shane at hathawaymix.org
Thu Aug 27 21:26:49 EDT 2009


Log message for revision 103328:
  Merged the database initialization warning fix
  

Changed:
  U   relstorage/branches/1.2/CHANGES.txt
  U   relstorage/branches/1.2/relstorage/relstorage.py

-=-
Modified: relstorage/branches/1.2/CHANGES.txt
===================================================================
--- relstorage/branches/1.2/CHANGES.txt	2009-08-28 01:24:47 UTC (rev 103327)
+++ relstorage/branches/1.2/CHANGES.txt	2009-08-28 01:26:48 UTC (rev 103328)
@@ -5,7 +5,10 @@
 - In Oracle, don't trip over transaction descriptions longer than 2000
   bytes.
 
+- When opening the database for the first time, don't issue a warning
+  about the inevitable POSKeyError on the root OID.
 
+
 Version 1.2.0b2 (2009-05-05)
 ----------------------------
 

Modified: relstorage/branches/1.2/relstorage/relstorage.py
===================================================================
--- relstorage/branches/1.2/relstorage/relstorage.py	2009-08-28 01:24:47 UTC (rev 103327)
+++ relstorage/branches/1.2/relstorage/relstorage.py	2009-08-28 01:26:48 UTC (rev 103328)
@@ -281,6 +281,7 @@
         """
         cursor = self._load_cursor
         adapter = self._adapter
+        logfunc = log.warning
         msg = ["Storage KeyError on oid %d: %s" % (oid_int, reason)]
         rows = adapter.iter_transactions(cursor)
         row = None
@@ -288,6 +289,9 @@
             # just get the first row
             break
         if not row:
+            # This happens when initializing a new database, so it's
+            # not a warning.
+            logfunc = log.debug
             msg.append("No transactions exist")
         else:
             msg.append("Current transaction is %d" % row[0])
@@ -305,7 +309,7 @@
                 if len(tids) >= 10:
                     break
         msg.append("Recent object tids: %s" % repr(tids))
-        log.warning('; '.join(msg))
+        logfunc('; '.join(msg))
 
     def _get_oid_cache_key(self, oid_int):
         """Return the cache key for finding the current tid."""



More information about the checkins mailing list