Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -1408,13 +1408,16 @@ (let ((res (proc))) (dbfile:simple-file-release-lock fname) res) (begin (dbfile:print-err "dbfile:with-simple-file-lock: " fname " is locked by " - (with-input-from-file fname - (lambda () - (dbfile:print-err (read-line))))) + (handle-exceptions + exn + "unreadable" + (with-input-from-file fname + (lambda () + (read-line))))) (dbfile:print-err "wait time = " (- end-time start-time)) (dbfile:print-err "ERROR: simple file lock could not get a lock for " fname " in " expire-time " seconds") (if run-anyway (let ((res (proc))) (dbfile:simple-file-release-lock fname) Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -531,26 +531,33 @@ (start-ms (current-milliseconds)) (new-ids (sqlite3:fold-row (lambda (res id)(cons id res)) '() dbh newrec))) ;; (debug:print 0 *default-log-port* "Got "(length aux-ids)" in aux-ids and "(length main-ids)" in main-ids") (update-changed (length new-ids) table "new records") (mutex-lock! *db-transaction-mutex*) - (sqlite3:with-transaction - dbh - (lambda () - (for-each (lambda (id) - (sqlite3:execute dbh stmt2 id)) - new-ids))) + (handle-exceptions + exn + (debug:print 0 *default-log-port* "Transaction update of "table" failed.") + (sqlite3:with-transaction + dbh + (lambda () + (for-each (lambda (id) + (sqlite3:execute dbh stmt2 id)) + new-ids)))) + (if (member "last_update" fields) - (sqlite3:with-transaction - dbh - (lambda () - (let* ((changed-ids (sqlite3:fold-row (lambda (res id)(cons id res)) '() dbh changedrec))) - (update-changed (length changed-ids) table "changed records") - (for-each (lambda (id) - (sqlite3:execute dbh stmt9 id id)) - changed-ids))))) - + (handle-exceptions + exn + (debug:print 0 *default-log-port* "Transaction update of "table" failed.") + (sqlite3:with-transaction + dbh + (lambda () + (let* ((changed-ids (sqlite3:fold-row (lambda (res id)(cons id res)) '() dbh changedrec))) + (update-changed (length changed-ids) table "changed records") + (for-each (lambda (id) + (sqlite3:execute dbh stmt9 id id)) + changed-ids)))))) + (mutex-unlock! *db-transaction-mutex*) (debug:print 0 *default-log-port* "Synced table "table " in "(- (current-milliseconds) start-ms)"ms")