diff --git a/scheme/bdb.scm b/scheme/bdb.scm index 210338e..ae8c1aa 100644 --- a/scheme/bdb.scm +++ b/scheme/bdb.scm @@ -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)