Update of /project/elephant/cvsroot/elephant In directory common-lisp.net:/tmp/cvs-serv30637
Modified Files: TUTORIAL Log Message: open/close-store
Date: Sun Aug 29 09:51:02 2004 Author: blee
Index: elephant/TUTORIAL diff -u elephant/TUTORIAL:1.2 elephant/TUTORIAL:1.3 --- elephant/TUTORIAL:1.2 Sun Aug 29 09:45:09 2004 +++ elephant/TUTORIAL Sun Aug 29 09:51:02 2004 @@ -43,33 +43,37 @@
To create a store controller, try
-* (setq *store-controller* (make-instance 'store-controller :path "testdb")) +* (open-controller "testdb") => #<STORE-CONTROLLER {49252F75}>
The store controller holds the handles to the database -environment and tables, and some other bookkeeping. +environment and tables, and some other bookkeeping. If for +some reason you need to run recovery on the database (see +sleepycat docs) you can specify that with the :recover and +:recover-fatal keys. + +Alternatively, + +* (setq *store-controller* (make-instance 'store-controller :path "testdb")) +=> #<STORE-CONTROLLER {49252F75}>
* (open-controller *store-controller*) => #<STORE-CONTROLLER {49252F75}>
-opens the environment and database. If for some reason you -need to run recovery on the database (see sleepycat docs) -you can specify that with the :recover and :recover-fatal -keys. - -"close-controller" closes the handles. Don't forget to do -this or else you may need to run recovery later. There is a -"with-open-controller" macro. In practice, since opening -and closing a controller is very expensive, it's probably -not all that practical. - -*store-controller* is a special which is exported from the -elephant package. The persistent-* objects (see below) use -the *store-controller* special. (This is in part because -slot accessors can't take additional arguments.) If for -some reason you want to operate on 2 store controllers, -you'll have to do that by flipping the *store-controller* -special. +opens the environment and database. *store-controller* is a +special which is exported from the elephant package. The +persistent-* objects (see below) use the *store-controller* +special. (This is in part because slot accessors can't take +additional arguments.) If for some reason you want to +operate on 2 store controllers, you'll have to do that by +flipping the *store-controller* special. + +"close-store" closes the store controller. Alternatively +"close-controller" can be called on a handle. Don't forget +to do this or else you may need to run recovery later. +There is a "with-open-controller" macro. In practice, since +opening and closing a controller is very expensive, it's +probably not all that practical.
Store controllers are by default thread-safe (set by the :thread key). Recovery should only be run when there are no