Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -409,15 +409,11 @@ #f)) (stmth (sqlite3:prepare db full-ins)) (changed-rows 0)) (for-each (lambda (fromdat-lst) - (mutex-lock! *db-transaction-mutex*) - (sqlite3:with-transaction - db - (lambda () - (for-each ;; + (for-each ;; (lambda (fromrow) (let* ((a (vector-ref fromrow 0)) (curr (hash-table-ref/default todat a #f)) (same #t)) (let loop ((i 0)) @@ -427,17 +423,23 @@ (if (and same (< i (- num-fields 1))) (loop (+ i 1)))) (if (not same) (begin - (apply sqlite3:execute stmth (vector->list fromrow)) - (hash-table-set! numrecs tablename (+ 1 (hash-table-ref/default numrecs tablename 0))) - (set! changed-rows (+ changed-rows 1)))))) - fromdat-lst))) - (mutex-unlock! *db-transaction-mutex*)) + (mutex-lock! *db-transaction-mutex*) + (sqlite3:with-transaction + db + (lambda () + (apply sqlite3:execute stmth (vector->list fromrow)) + (hash-table-set! numrecs tablename + (+ 1 (hash-table-ref/default numrecs tablename 0))) + (set! changed-rows (+ changed-rows 1)))) + (mutex-unlock! *db-transaction-mutex*) + )))) + fromdat-lst)) fromdats) - ;; (debug:print 0 *default-log-port* "row="row) + ;; (debug:print 0 *default-log-port* "row="row) (sqlite3:finalize! stmth) (if (member "last_update" field-names) (db:create-trigger db tablename))) )) Index: matt/buttontest.scm ================================================================== --- matt/buttontest.scm +++ matt/buttontest.scm @@ -45,9 +45,9 @@ name)) (iup:show (iup:dialog (iup:vbox - (iup:button " " image: (make-image "GreenBlack" "0 255 0" "0 0 0"))))) + (iup:button " " image: (make-image "YellowBlack" "255 255 0" "0 0 0"))))) (iup:main-loop) )