added with-transaction
This commit is contained in:
parent
dcce8de4de
commit
bba2de6fae
|
@ -41,15 +41,21 @@
|
|||
(define (with-database-flags flags thunk)
|
||||
(let-fluid $current-flags flags thunk))
|
||||
|
||||
(define (as-transaction options proc)
|
||||
(define (as-transaction db-env flags proc)
|
||||
(let-fluid
|
||||
$current-transaction-id
|
||||
(begin-transaction options)
|
||||
(begin-transaction db-env flags)
|
||||
(lambda ()
|
||||
(proc (lambda ()
|
||||
(abort-transaction (current-transaction-id))))
|
||||
(commit-transaction (current-transaction-id)))))
|
||||
|
||||
(define (with-transaction transaction proc)
|
||||
(let-fluid
|
||||
$current-transaction-id
|
||||
transaction
|
||||
proc))
|
||||
|
||||
;; constants
|
||||
|
||||
(define (berkeley-db-version)
|
||||
|
|
Loading…
Reference in New Issue