Index: tracdarcs/repository.py
===================================================================
--- tracdarcs/repository.py	(revision 68)
+++ tracdarcs/repository.py	(revision 70)
@@ -143,5 +143,5 @@
             node_type = get_node_type( self.db, node_id )
         return DarcsNode( node_id, node_type, path, last_rev,
-                self.db, self.__cmd )
+                self.db, self.__cmd, self.log )
 
     def get_oldest_rev( self ) :
@@ -258,5 +258,5 @@
 class DarcsNode( Node ) :
     def __init__( self, node_id, node_type, path, rev,
-            db, cmd ) :
+            db, cmd, log=None ) :
         kind = _node_type_map[node_type]
         Node.__init__( self, path, rev, kind )
@@ -265,4 +265,5 @@
         self.__db = db
         self.__cmd = cmd
+        self.__log = log
         self.created_path = path
         self.created_rev = rev
@@ -292,15 +293,16 @@
         # save the file content in the cache
 
-        # UGLY HACK: the following line is required otherwise
-        # db.commit() (pysqlite-2.3.2,winxp) throws
-        # OperationalError: 'SQL logic error or missing database'
-        #self.__db.cnx.cnx.isolation_level = None
-        # END UGLY HACK
-
         c = self.__db.cursor()
         c.execute( 'INSERT INTO darcs_cache(node_id,rev,content) '
                 'VALUES (%s,%s,%s)',
                 (self.__node_id,self.rev,buffer(data)) )
-        self.__db.commit()
+        try:
+            self.__db.commit()
+        except Exception, e:
+            # Sometimes db.commit() (sqllite) throws an
+            # OperationalError: 'SQL logic error or missing database'
+            # Since this is just a cache, we simply notify and keep
+            # going.
+            self.__log.warning("Error writing cache: %s", e)
         return StringIO.StringIO( data )
 
@@ -318,5 +320,5 @@
             node_type = get_node_type( self.__db, node_id )
             yield DarcsNode( node_id, node_type, path, rev,
-                    self.__db, self.__cmd )
+                    self.__db, self.__cmd, self.__log )
 
     def get_history( self, limit=None ) :
