Commit dc16db92 authored by -urso-'s avatar -urso-

modified docs according to updates in bdb

darcs-hash:5a97bd262d54130ddcf6bac523c04f6b13d13d70
parent 2b343074
Sat Jun 3 22:59:00 CEST 2006 -urso-@web.de
* updated dependencies in bdb.asd
Sat Jun 3 22:43:40 CEST 2006 -urso-@web.de
* When functions need to run within transaction they will create a new one, but avoid nesting transactions (see with-txn macro)
Fri Jun 2 21:26:09 CEST 2006 -urso-@web.de Fri Jun 2 21:26:09 CEST 2006 -urso-@web.de
* added support for sequences * added support for sequences
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
&quot;config&quot; &quot;classes&quot; &quot;txn&quot;<span class="paren">)</span><span class="paren">)</span> &quot;config&quot; &quot;classes&quot; &quot;txn&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;cursor&quot; <span class="paren">(</span>:file &quot;cursor&quot;
:depends-on <span class="paren">(</span>&quot;package&quot; &quot;aux-bindings&quot; :depends-on <span class="paren">(</span>&quot;package&quot; &quot;aux-bindings&quot;
&quot;consts&quot; &quot;consts&quot; &quot;txn&quot;
&quot;db&quot; &quot;util&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span> &quot;db&quot; &quot;util&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;db-env&quot; <span class="paren">(</span>:file &quot;db-env&quot;
:depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot; :depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot;
...@@ -81,10 +81,12 @@ ...@@ -81,10 +81,12 @@
&quot;aux-bindings&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span> &quot;aux-bindings&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;secondary&quot; <span class="paren">(</span>:file &quot;secondary&quot;
:depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot; :depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot;
&quot;txn&quot;
&quot;aux-bindings&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span> &quot;aux-bindings&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;sequence&quot; <span class="paren">(</span>:file &quot;sequence&quot;
:depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot; :depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot;
&quot;aux-bindings&quot; &quot;classes&quot;<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span><span class="paren">)</span><span class="paren">)</span> &quot;aux-bindings&quot; &quot;classes&quot;
&quot;txn&quot;<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span><span class="paren">)</span><span class="paren">)</span>
:depends-on <span class="paren">(</span>:cffi-util<span class="paren">)</span><span class="paren">)</span></span></pre :depends-on <span class="paren">(</span>:cffi-util<span class="paren">)</span><span class="paren">)</span></span></pre
> >
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
for the lisp library: for the lisp library:
- when opening a database it depends on the environment, - when opening a database it depends on the environment,
wether we'll use the C-based (using db-associate-ll) wether we'll use the C-based
implementation or a transaction based if transactions implementation or a transaction based. If transactions
are supported by environment. are supported by environment.
Todo so, db-open returns different kind of classes: Todo so, db-open returns different kind of classes:
- db-std ;; standard db-class, if txn not allowed - db-std ;; standard db-class, if txn not allowed
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
- no changes to db-put - no changes to db-put
- db-txn: - db-txn:
- add callback function and secondary to table - add callback function and secondary to table
in database in database instance
- when closing secondary, remove from table - when closing secondary, remove from table
- don't use defcallback, use lambda directly - don't use defcallback, use lambda directly
- overwrite db-put: - overwrite db-put:
......
...@@ -14,25 +14,21 @@ ...@@ -14,25 +14,21 @@
><h2 ><h2
>Source</h2 >Source</h2
><pre class="code" ><pre class="code"
>(defmethod db-associate ((primary db-txn) (secondary db-txn) >(defmethod db-associate ((primary db-txn) (secondary db-txn) callback
callback &amp;key txn callback-maker create) &amp;key txn callback-maker create)
(cond ((null txn) (with-txn (txn (db-get-env primary)) (with-txn (txn (db-get-env primary) :txn txn)
(db-associate primary secondary callback (%db-dummy-associate primary
:txn txn txn
:callback-maker callback-maker (db-sec-handle (db-open-sec secondary
:create create))) :txn txn))
(t (%db-dummy-associate primary :create create)
txn (push (cons secondary
(db-sec-handle (db-open-sec secondary
:txn txn))
:create create)
(push (cons secondary
(if (functionp callback-maker) (if (functionp callback-maker)
(funcall callback-maker callback) (funcall callback-maker callback)
callback)) callback))
(db-assoc primary)) (db-assoc primary))
(setf (db-assoc secondary) primary) (setf (db-assoc secondary) primary)
primary)))</pre primary))</pre
><a href="../Secondary_0020Databases.html#method_005FBDB_003A_003A_0028DB-ASSOCIATE_0020DB-TXN_0020DB-TXN_0020T_0029" ><a href="../Secondary_0020Databases.html#method_005FBDB_003A_003A_0028DB-ASSOCIATE_0020DB-TXN_0020DB-TXN_0020T_0029"
>Source Context</a >Source Context</a
></div ></div
......
...@@ -15,10 +15,8 @@ ...@@ -15,10 +15,8 @@
>Source</h2 >Source</h2
><pre class="code" ><pre class="code"
>(defmethod db-del ((db db-txn) key &amp;key txn) >(defmethod db-del ((db db-txn) key &amp;key txn)
(if (null txn) (with-txn (txn (db-get-env db) :txn txn)
(with-txn (txn (db-get-env db)) (%db-del db txn (cbuffer-data key) (cbuffer-size key) 0)))</pre
(db-del db key :txn txn))
(%db-del db txn (cbuffer-data key) (cbuffer-size key) 0)))</pre
><a href="../Databases.html#method_005FBDB_003A_003A_0028DB-DEL_0020DB-TXN_0020T_0029" ><a href="../Databases.html#method_005FBDB_003A_003A_0028DB-DEL_0020DB-TXN_0020T_0029"
>Source Context</a >Source Context</a
></div ></div
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
(with-cbuffer data-buffer (with-cbuffer data-buffer
(funcall (buf-writer db) key key-buffer) (funcall (buf-writer db) key key-buffer)
(funcall (buf-writer db) data data-buffer) (funcall (buf-writer db) data data-buffer)
(with-txn (put-txn (db-get-env db) :parent txn) (with-txn (put-txn (db-get-env db) :txn txn)
(db-put (db-handle db) key-buffer data-buffer (db-put (db-handle db) key-buffer data-buffer
:txn put-txn :txn put-txn
:append append :append append
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
txn append no-dup-data no-overwrite) txn append no-dup-data no-overwrite)
&quot;callback returns a cbuffer, which will be freed by this put function&quot; &quot;callback returns a cbuffer, which will be freed by this put function&quot;
(let ((env (db-get-env db))) (let ((env (db-get-env db)))
(with-txn (put-txn env :parent txn) (with-txn (put-txn env :txn txn)
(db-put (db-handle db) key data (db-put (db-handle db) key data
:txn put-txn :txn put-txn
:append append :append append
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment