From bba2de6fae0895c9b2ca3f57ad59b02dfac134c0 Mon Sep 17 00:00:00 2001 From: eknauel Date: Mon, 15 Nov 2004 14:09:48 +0000 Subject: [PATCH] added with-transaction --- scheme/bdb.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)