[elephant-devel] db-postmodern update - Integrated!

Robert L. Read read at robertlread.net
Tue Jul 10 20:41:47 UTC 2007


Henrik and I have fixed some subtle bugs that occurred under certain
data values (which 
happened to occur in my "live" database for "konsenti.com", my for-
profit business.

I have now integrated these fixes into the main darcs elephant
repository.

If anybody pulls and tests the :ele-postmodern backend, please send us a
note.
It works under SBCL, but has not been tested under our full matrix,
AFAIK.



By the way, one might be interested in how one migrated from an exsiting
CL-SQL backend
to the Postmodern-based ele-postmodern backend.  Here is approximately
the lisp code that 
I used to move from "konsenti", a CL-SQL based backend, to "kosenti2", a
postmodern-based
backend:


(defparameter *REPOSITORY-SPEC* (list :clsql (list :postgresql
                                  (coerce-to-base
"localhost.localdomain" )
                                  (coerce-to-base "konsenti" )
                                  (coerce-to-base "postgres" )
                                  (coerce-to-base "mrmtzplx"))))

(defparameter *UPGRADE-REPOSITORY-SPEC* (list :postmodern
(list :postgresql
                                  (coerce-to-base
"localhost.localdomain" )
                                  (coerce-to-base "konsenti2" )
                                  (coerce-to-base "postgres" )
                                  (coerce-to-base "mrmtzplx"))))

(use-package :elephant)
(setq orig (open-store *REPOSITORY-SPEC*))
(setq pm (open-store *UPGRADE-REPOSITORY-SPEC*))
(migrate pm orig)




On Wed, 2007-07-04 at 17:49 -0500, Robert L. Read wrote:

> I have just integrated Henrik Hjelte's postmodern-based backend into
> the official
> darcs repository for elephant:
> 
> http://common-lisp.net/project/elephant/darcs/elephant/
> 
> However, this is not an official release, but presumably will be part
> of the next official release.
> It passes all of the tests.  The Postmodern backend is not quite twice
> as fast on our testsuite as
> the CL-SQL backend.  The CL-SQL backend still has some value, however,
> for non-Postgres 
> databases.  If someone were to write another DB-specific backend, such
> as a MySQL backend
> or an Oracle backend, I would assume they would benefit from both the
> CL-SQL version and 
> the Postmodern version.  However, I think the Postmodern version is
> better-written.  I thank
> Henrik very much for preparing such a well-written, easy-to-integrate
> backend.
> 
> I did, however, have to make three changes to get this to work for me
> under SBCL.
> Postmodern defines "db-error" incompatibly with the BDB backend, so I
> renamed the BDB symbol
> from db-error to bdb-db-error.  This was one issue on a "handler-case"
> that I assume was 
> acceptable under Henrik's LISP, but didn't work under SBCL, or seem to
> follow the CLHS.
> Finally, in shared-initialize :after method that builds the cache-
> indices I had to explicitly 
> set the slot to the initform, to prevent a reading of an unbound-slot.
> I still have no idea
> why the slot was unbound at that point, in spite of all documentation
> saying that it should be.
> 
> I slightly modified Henrik's test to harmonize more with the CL-SQL
> version, and added an
> example of using postmodern into the RUNTEST.lisp file.
> 
> Describing this in the manual remains to be done; I don't have any
> immediate plans to do so.
> 
> Personally, I think each backend adds to the overall usability of
> Elephant, and should broaden
> our user base.  Particularly since one can migrate data from one
> backend to another, it would
> seem that we are offering a solid platform.
> 
> Once this is officially released, users can expect the postmodern
> backend to be supported 
> indefinitely.  If we ever drop a backend, we will provide a way to
> migrate data out of it.
> 
> 
> 
> 
> 
> 
> On Sat, 2007-05-12 at 16:46 +0200, Henrik Hjelte wrote: 
> 
> > I have made some changes to the postmodern postgresql backend. The darcs
> > repo is now based on the official elephant darcs repo, so patches can be
> > moved between them easily. The postmodern backend passes all "official"
> > tests, but has not been extensively tested with real data yet.
> > 
> > The db-postmodern tree can be found here:
> > http://common-lisp.net/project/grand-prix/darcs/elephant
> > 
> > /Henrik Hjelte
> > 
> > _______________________________________________
> > elephant-devel site list
> > elephant-devel at common-lisp.net
> > http://common-lisp.net/mailman/listinfo/elephant-devel
> 
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20070710/9e1fd9e4/attachment.html>


More information about the elephant-devel mailing list