179
180
181
182
183
184
185
186
187
|
(define (dbfile:add-dbh dbstruct run-id dbh)
(let* ((subdb (dbfile:get-subdb dbstruct run-id)))
(if (not (stack? (dbr:subdb-dbstack subdb)))
(dbr:subdb-dbstack-set! subdb (make-stack)))
(stack-push! (dbr:subdb-dbstack subdb) dbh)))
)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
(define (dbfile:add-dbh dbstruct run-id dbh)
(let* ((subdb (dbfile:get-subdb dbstruct run-id)))
(if (not (stack? (dbr:subdb-dbstack subdb)))
(dbr:subdb-dbstack-set! subdb (make-stack)))
(stack-push! (dbr:subdb-dbstack subdb) dbh)))
;;======================================================================
;; no-sync.db - small bits of data to be shared between servers
;;======================================================================
(define (dbfile:open-no-sync-db dbpath)
(let* (;; (dbpath (db:dbfile-path))
(dbname (conc dbpath "/no-sync.db"))
(db-exists (file-exists? dbname))
(db (sqlite3:open-database dbname)))
(sqlite3:set-busy-handler! db (sqlite3:make-busy-timeout 136000))
(if (not db-exists)
(begin
(sqlite3:execute db "PRAGMA synchronous = 0;")
(sqlite3:execute db "CREATE TABLE IF NOT EXISTS no_sync_metadat (var TEXT,val TEXT, CONSTRAINT no_sync_metadat_constraint UNIQUE (var));")
(sqlite3:execute db "PRAGMA journal_mode=WAL;")))
db))
)
|