[elephant-devel] Problem with LWW 5.1.2, BDB-backend

Elliott Slaughter elliottslaughter at gmail.com
Mon Dec 7 22:05:11 UTC 2009


On Mon, Dec 7, 2009 at 1:46 PM, Plamen . <plamen.usenet at gmail.com> wrote:

> Hello Elliott & Jan,
>
> ty a lot for the DLLs - especially the libberkeley-db.dll saved me may
> be hours today looking in the gcc & dlltool docs...
>

No problem :-)

But - now it seems LWW can talk to the DLLs & DB, but:
>
> 1. in the OPEN-CONTROLLER (in the bdb-controller.lisp) I get some new
> errors now :
>    - (db-env-set-max-locks env max-locks) gives error 22 - invalid
> argument..
>    - (db-env-set-max-transactions env max-transactions) - the same
>

Aha! This is the same error I'm getting in SBCL.

I'll try debugging further tonight.

>From what I see in the code - the invocation uses meaningfull
> arguments, putting some debug statements tells that at least on the
> Lisp side we have the right constant-values which correspond with the
> "db.h"-declarations.
>
> So - I'm a step further with your help, but still can't even open a
> database. I hope - there is a solution. Of course, I could try to make
> the binding using directly the LW FFI, but that would be sad private
> solution or unnesessery source fragmentation when there is UFFI/CFFI
> as a base.
>
> (Now I use BDB 4.7.25, the newest UFFI in front of CFFI and the DLLs I
> receved today)
>
> If there is a chance for help - I would be very happy.
>
> On Mon, Dec 7, 2009 at 7:34 PM, Elliott Slaughter
> <elliottslaughter at gmail.com> wrote:
> > Here are the dlls I built for the newest version of Elephant with BDB
> > 4.7.25. If they work for you, then Ian can put them on the project page.
> > Hope this helps.
> >
> > On Mon, Dec 7, 2009 at 10:21 AM, Ian Eslick <eslick at media.mit.edu>
> wrote:
> >>
> >> Elliott said he was going to give this a shot. You might correspond with
> >> him directly.  -Ian
> >> On Dec 7, 2009, at 12:09 AM, Plamen . wrote:
> >>
> >> > Hello Ian,
> >> >
> >> > thank you for the quick response!
> >> >
> >> > On Sun, Dec 6, 2009 at 5:44 PM, Ian Eslick <eslick at media.mit.edu>
> wrote:
> >> >> Hey, quick answers:
> >> >>
> >> >> 1) In the online FAQ you'll notice that you have to ensure that you
> are
> >> >> using uffi and not the uffi compatibility package from cffi.
> >> >
> >> > Ok, had missed that...
> >> >
> >> >> 2) The prebuilt DLLs are not up to date (sorry!), they need to be
> made
> >> >> current against BDB 4.7 which Elephant 1.0 depends on.
> >> >
> >> > Ok, had no idea from the doc or source that 4.7 is the current target,
> >> > but that's even better.
> >> >
> >> >> 3) We have one or two lispworks users that I'm aware of, so it should
> >> >> work, but I can't rule out a lispworks specific problem, although I
> think #1
> >> >> and #2 above explain what you're seeing.
> >> >>
> >> >> Are you a position to build the DLLs yourself?
> >> >
> >> > Haven't touched C for years now and never had the pleasure with cygwin
> >> > but now I'll try it :)
> >> >
> >> >>
> >> >> Ian
> >> >>
> >> >> On Dec 5, 2009, at 5:28 AM, Plamen . wrote:
> >> >>
> >> >>> Hello,
> >> >>> I need to use BDB for my current application and from what I see on
> >> >>> the net, elephant seems to be the most mature and functional
> solution.
> >> >>> After following the installation instructions (I use LispWorks 5.1.2
> >> >>> for Windows - yes - I need that configuration at the moment, with
> >> >>> Berkeley DB 4.5.20, with prebuild DLLs (libberkeley-db.dll and
> >> >>> libmemutil.dll) in the elephant-root and from what I see a correct
> >> >>> my-config.sexp also in the elephant-root directory), after loading
> >> >>> Elephant I get the following error :
> >> >>> ELE-USER 13 > (open-store '(:bdb "/temp/db2/"))
> >> >>> Error: The call (#<Function DB-BDB::%DB-ENV-CREATE 22053092> 0) does
> >> >>> not match definition (#<Function DB-BDB::%DB-ENV-CREATE 22053092>
> >> >>> DB-BDB::FLAGS DB-BDB::ERRNO).
> >> >>> From what I see in the sources - there are 3 relevant definitions :
> >> >>> 1. the BDB one :
> >> >>>
> >> >>> db_env_create
> >> >>>
> >> >>> ________________________________
> >> >>>
> >> >>> #include <db.h>
> >> >>>
> >> >>> int
> >> >>> db_env_create(DB_ENV **dbenvp, u_int32_t flags);
> >> >>>
> >> >>> 2. then the libberkeley-db one :
> >> >>>
> >> >>> DB_ENV *db_env_cr(u_int32_t flags, int *errno) {
> >> >>>  DB_ENV *envp;
> >> >>>  *errno = db_env_create(&envp, flags);
> >> >>>  return envp;
> >> >>> }
> >> >>>
> >> >>> 3. and finally the Lisp definitions :
> >> >>>
> >> >>> (def-function ("db_env_cr" %db-env-create)
> >> >>>    ((flags :unsigned-int)
> >> >>>     (errno :int :out))
> >> >>>  :returning :pointer-void)
> >> >>>
> >> >>> (defun db-env-create ()
> >> >>>  "Create an environment handle."
> >> >>>  (multiple-value-bind (env errno)
> >> >>>      (%db-env-create 0)
> >> >>>    (declare (type fixnum errno))
> >> >>>    (if (= errno 0)
> >> >>>       env
> >> >>>       (error 'db-error :errno errno))))
> >> >>>
> >> >>> I have cffi_0.10.5 and uffi-1.6.2 (which are currently the newest
> >> >>> versions of that libraries).
> >> >>>
> >> >>> The call (%db-env-create 0) in the db-env-create function looks of
> >> >>> course weird for me, but if people use these lines of source on all
> >> >>> other Lisp-implementations, obviously I miss something. I know the
> LW
> >> >>> FFI, but I'm not really proficient in the CFFI/UFFI-conversion to
> see
> >> >>> the missing parts, but if there is someone outside in the WWW who
> runs
> >> >>> LWW & BDB and/or knows how to help, I would be very gratefull.
> >> >>>
> >> >>> Regards
> >> >>> Plamen
> >> >>>
> >> >>> _______________________________________________
> >> >>> 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
> >> >>
> >> >
> >> > _______________________________________________
> >> > 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
> >
> >
> >
> > --
> > Elliott Slaughter
> >
> > "Don't worry about what anybody else is going to do. The best way to
> predict
> > the future is to invent it." - Alan Kay
> >
> > _______________________________________________
> > 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
>



-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict
the future is to invent it." - Alan Kay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20091207/45ed216c/attachment.html>


More information about the elephant-devel mailing list