Megatest

Diff
Login

Differences From Artifact [7c7482ed09]:

To Artifact [5465f7a4df]:


102
103
104
105
106
107
108





109
110
111



112
113
114
115
116
117
118
102
103
104
105
106
107
108
109
110
111
112
113



114
115
116
117
118
119
120
121
122
123







+
+
+
+
+
-
-
-
+
+
+







;;
(define (db:with-db dbstruct run-id r/w proc . params)
  (let* ((dbdat (if (vector? dbstruct)
		    (db:get-db dbstruct run-id)
		    dbstruct)) ;; cheat, allow for passing in a dbdat
	 (db    (db:dbdat-get-db dbdat)))
    (db:delay-if-busy dbdat)
    (handle-exceptions
     exn
     (begin
       (debug:print 0 "ERROR: sqlite3 issue in db:with-db, params=" params " error: " ((condition-property-accessor 'exn 'message) exn))
       (print-call-chain (current-error-port)))
    (let ((res (apply proc db params)))
      (if (vector? dbstruct)(db:done-with dbstruct run-id r/w))
      res)))
     (let ((res (apply proc db params)))
       (if (vector? dbstruct)(db:done-with dbstruct run-id r/w))
       res))))

;;======================================================================
;; K E E P   F I L E D B   I N   dbstruct
;;======================================================================

;; (define (db:get-filedb dbstruct run-id)
;;   (let ((db (vector-ref dbstruct 2)))