294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
(sqlite3:finalize! db #t))))
(hash-table-values (dbr:dbstruct-get-locdbs dbstruct))))
(thread-sleep! 3)
(if (and rundb
(sqlite3:database? rundb))
(handle-exceptions
exn
#t ;; (debug:print 0 "WARNING: database files may not have been closed correctly. Consider running -cleanup-db")
(sqlite3:interrupt! rundb)
(sqlite3:finalize! rundb #t))))
;; (mutex-unlock! *db-sync-mutex*)
)
(define (db:open-inmem-db)
(let* ((db (sqlite3:open-database ":memory:"))
|
>
|
>
>
>
|
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
|
(sqlite3:finalize! db #t))))
(hash-table-values (dbr:dbstruct-get-locdbs dbstruct))))
(thread-sleep! 3)
(if (and rundb
(sqlite3:database? rundb))
(handle-exceptions
exn
(begin
(debug:print 0 "WARNING: database files may not have been closed correctly. Consider running -cleanup-db")
(debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))
(print-call-chain)
#f)
(sqlite3:interrupt! rundb)
(sqlite3:finalize! rundb #t))))
;; (mutex-unlock! *db-sync-mutex*)
)
(define (db:open-inmem-db)
(let* ((db (sqlite3:open-database ":memory:"))
|
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
|
(handle-exceptions
exn
(let ((err-status ((condition-property-accessor 'sqlite3 'status #f) exn)))
;; check for (exn sqlite3) ((condition-property-accessor 'exn 'message) exn)
(if (eq? err-status 'done)
default
(begin
(debug:print 0 "ERROR: query " stmt " failed " ((condition-property-accessor 'exn 'message) exn))
(print-call-chain)
default)))
(apply sqlite3:first-result db stmt params)))
;;======================================================================
;; Extract ods file from the db
;;======================================================================
|
|
|
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
|
(handle-exceptions
exn
(let ((err-status ((condition-property-accessor 'sqlite3 'status #f) exn)))
;; check for (exn sqlite3) ((condition-property-accessor 'exn 'message) exn)
(if (eq? err-status 'done)
default
(begin
(debug:print 0 "ERROR: query " stmt " failed, params: " params ", error: " ((condition-property-accessor 'exn 'message) exn))
(print-call-chain)
default)))
(apply sqlite3:first-result db stmt params)))
;;======================================================================
;; Extract ods file from the db
;;======================================================================
|