Update of /project/elephant/cvsroot/elephant/src In directory common-lisp.net:/tmp/cvs-serv22102/src
Modified Files: elephant.lisp Log Message: no with-transaction-retry
Date: Sat Aug 28 08:40:18 2004 Author: blee
Index: elephant/src/elephant.lisp diff -u elephant/src/elephant.lisp:1.3 elephant/src/elephant.lisp:1.4 --- elephant/src/elephant.lisp:1.3 Fri Aug 27 19:32:10 2004 +++ elephant/src/elephant.lisp Sat Aug 28 08:40:18 2004 @@ -39,7 +39,7 @@ (defpackage elephant (:nicknames ele :ele) (:use common-lisp sleepycat) - (:shadow with-transaction with-transaction-retry) + (:shadow with-transaction) (:export *store-controller* *current-transaction* *auto-commit* store-controller open-controller close-controller with-open-controller controller-path controller-environment @@ -48,7 +48,7 @@ persistent persistent-object persistent-metaclass persistent-collection btree get-value remove-kv db-transaction-begin db-transaction-abort db-transaction-commit - with-transaction with-transaction-retry + with-transaction db-env-set-timeout db-env-get-timeout db-env-set-flags db-env-get-flags db-env-set-lock-detect db-env-get-lock-detect @@ -125,3 +125,20 @@ )
(defsetf get-cache setf-cache) + +;; Good defaults for elephant +(defmacro with-transaction ((&key transaction + (environment (controller-environment + *store-controller*)) + (parent '*current-transaction*) + dirty-read txn-nosync + txn-nowait txn-sync) + &body body) + `(sleepycat:with-transaction (:transaction ,transaction + :environment ,environment + :parent ,parent + :dirty-read ,dirty-read + :txn-nosync ,txn-nosync + :txn-nowait ,txn-nowait + :txn-sync ,txn-sync) + ,@body))