<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Which darcs repository?  There is the old 0.91 release and the new elephant-1.0 branch...<div><br></div><div>Ian</div><div><br><div><div>On Sep 22, 2009, at 8:41 PM, Red Daly wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I should also note that I am using the version of elephant from darcs.  And I discovered that when the program went down it was due to a segfault (I believe in emacs).  However, all instances had been created under many different transactions that did not abort.<br>
<br>Here is some more fiddling around:<br><br>
CL-USER> (lisp-implementation-version)<br>
"1.0.29.54.rc1"<br>BOOKS> (ele::get-db-schemas *ele-db* 'material)<br>NIL<br>BOOKS> (ele::controller-instance-class-index *ele-db*)<br>#<BDB-BTREE-INDEX oid:13701>                                                                                                                                                                                                                 <br>
BOOKS> (ele:map-btree #'(lambda (key val)                                                                                                                                                                                                    <br>
                          (format t "~S => ~S~%" key val))                                                                                                                                                                                   <br>
                      (ele::controller-instance-class-index *ele-db*))<br>307 => 307                                                                                                                                                                                                                                   <br>
NIL<br><br><br>Red<br><br><div class="gmail_quote">On Tue, Sep 22, 2009 at 8:08 PM, Red Daly <span dir="ltr"><<a href="mailto:reddaly@gmail.com" target="_blank">reddaly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

I noticed there was a disparity between get-instances-by-class and map-inverted-index.  I will let the code speak for itself:<br><br>BOOKS> (length (ele:map-inverted-index #'(lambda (isbn obj) obj) 'material 'isbn :collect t))                                                                                                                                                                                                      <br>


1945                                                                                                                                                                                                                                         <br>


BOOKS> (length (ele:get-instances-by-class 'material))<br>0                                <br>BOOKS> (defparameter f (make-instance 'material :title "Fake Book"))<br>F                                                                                                                                                                                                                                            <br>


BOOKS> (length (ele:get-instances-by-class 'material))<br>1                                                                                                                                                                                                                                            <br>


BOOKS> (length (ele:map-inverted-index #'(lambda (isbn obj) obj) 'material 'isbn :collect t))                                                                                                                                                                                                    <br>


1946<br><br>There is a similar problem with the university class.<br><br>BOOKS> (length (ele:get-instances-by-class 'university))<br>0<br>BOOKS> *stanford-university*<br>#<UNIVERSITY oid:204>                                                                                                                                                                                                                        <br>


BOOKS> (official-name *stanford-university*)<br>"Stanford University"<br><br>All of the instances in the database were created in a prior session.  Then I shut down the DB and restarted Lisp.  Now MAP-CLASS and GET-INSTANCES-BY-CLASS return nil for all classes.  It seems like new instances get added to the "class index," but older instances are not found.  However, these classes persist in the inverted slot indexes.  Can anybody diagnose what's going on?<br>


<br>here are the definitions of the classes:<br><br>(defclass department ()<br>  ((university :initarg :university :initform nil :accessor department-university<br>               :index t)<br>   (official-name :initarg :official-name :initform nil :accessor official-name)<br>


   (common-name :initarg :common-name :initform nil :accessor common-name)<br>   (abbreviation :initarg :abbreviation :initform nil :accessor abbreviation<br>                 :index t))<br>  (:metaclass ele:persistent-metaclass)<br>


  (:documentation "A department has a bunch of course listings."))<br><br>(defclass material ()<br>  ((title :initarg :title :initform nil :accessor material-title<br>          :index t)<br>   (authors :initarg :authors :initform nil :accessor material-authors) ;; a list of authors                                                                                                                                                 <br>


   (edition :initarg :edition :initform nil :accessor material-edition)<br>   (isbn :initarg :isbn :initform nil :accessor material-isbn<br>         :index t)<br>   (asin :initarg :asin :initform nil :accessor material-asin<br>


         :index t<br>         :documentation "An <a href="http://Amazon.com">Amazon.com</a> identifier that uniquely identifies the material")<br>   (image-uri :initarg :image-uri :initform nil :accessor material-image-uri))<br>  (:metaclass ele:persistent-metaclass))<br>


<br>Thanks,<br><font color="#888888">Red<br><br>
</font></blockquote></div><br>
_______________________________________________<br>elephant-devel site list<br><a href="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</a><br>http://common-lisp.net/mailman/listinfo/elephant-devel</blockquote></div><br></div></body></html>