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