<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
On Wed, 2006-01-25 at 22:58 +0200, Aycan iRiCAN wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Thank you,</FONT>
<FONT COLOR="#000000">I opened the store before my class declaration. Could this be changed</FONT>
<FONT COLOR="#000000">in the future? Why we need to open the store first?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Off the top of my head, it would not be easy to change it. The store must be opened for <BR>
something to be persisted into it; defining the class as a minimum sets up some identifiers<BR>
in preparation for the first instance being created.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Now I have another problem. I have a web action that handles a form</FONT>
<FONT COLOR="#000000">post. This action creates an instace of content class and fills the</FONT>
<FONT COLOR="#000000">data slot.</FONT>
<FONT COLOR="#000000">Since I am using utf-8 encoding with sbcl, when I list the content</FONT>
<FONT COLOR="#000000">instances with a web page, I'm having strange characters from data</FONT>
<FONT COLOR="#000000">slot.</FONT>
<FONT COLOR="#000000">Is there any problem with utf-8? I didn't tried to persist the</FONT>
<FONT COLOR="#000000">instance yet. Just created an instance and read back from it.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
I use SBCL 0.9.5 with the unicode option turned off and I persist unicode strings there often<BR>
and have not had a problem. I have no reason to believe there is a bug, but of course there<BR>
might be.<BR>
<BR>
That question can really only be answered by a small test example. In my experience, <BR>
there will be at least as many problems encountered in the rendering of the characters <BR>
and the character encoding as the actual storage. If you can reduce the problem to <BR>
a very small test program, we can construct a test from that a debug it.<BR>
<BR>
I have in fact only stored characters which happen to be from the Esperanto <BR>
character set, which is ISO-8859-3, but it it is using the utf-8 encoding.<BR>
<BR>
I specifically had to make some changes to make sure it works with SBCL when <BR>
the unicode feature is turned on.<BR>
<BR>
If things look wonky, you might try converting to bytes and looking at the actual <BR>
byte values.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Best Regards.</FONT>
<FONT COLOR="#000000">"Robert L. Read" <<A HREF="mailto:read@robertlread.net">read@robertlread.net</A>> writes:</FONT>
<FONT COLOR="#000000">> You will also have to depend on :ele-bdb.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Yes, it looks to me like it is the same problem as Waldo's that you mention;</FONT>
<FONT COLOR="#000000">> you have to call:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> (open-store "pathtotheBerkeleyDBdatabasedirectory")</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> before you invoke defclass.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I would try executing that, and then your class definition,</FONT>
<FONT COLOR="#000000">> directly in a REPL or listener by hand.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> If that works, you might have to do the open-store inside an "eval-when" clause,</FONT>
<FONT COLOR="#000000">> depending on how you have organized your code.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Does that make sense?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> On Wed, 2006-01-25 at 20:45 +0200, Aycan iRiCAN wrote:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Hello,</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I'm trying to use elephant in one of our projects. It's a simple UCW</FONT>
<FONT COLOR="#000000">> based web application. I set up elephant properly and run</FONT>
<FONT COLOR="#000000">> tests. Started sbcl with slime and evaluate a few lines</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> (asdf:oos 'asdf:load-op :elephant)</FONT>
<FONT COLOR="#000000">> (asdf:oos 'asdf:load-op :ele-bdb)</FONT>
<FONT COLOR="#000000">> (asdf:oos 'asdf:load-op :elephant-tests)</FONT>
<FONT COLOR="#000000">> (do-all-tests-spec *testdb-path*)</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> The result is:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> 5 out of 106 total tests failed: BASICPERSISTENCE, MIGRATE1, MIGRATE2,</FONT>
<FONT COLOR="#000000">> MIGRATE3, MIGRATE4.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> After these results, I think that I can try to use it with my</FONT>
<FONT COLOR="#000000">> application. I just added :elephant to dependencies of my system</FONT>
<FONT COLOR="#000000">> definition. </FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> <snip></FONT>
<FONT COLOR="#000000">> :depends-on (:ucw :elephant)</FONT>
<FONT COLOR="#000000">> </snip></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> And also added it to my package definition.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> <snip></FONT>
<FONT COLOR="#000000">> (:use :common-lisp :it.bese.ucw :elephant)</FONT>
<FONT COLOR="#000000">> </snip></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I have a simple content class. So I defined its metaclass.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> (defclass content ()</FONT>
<FONT COLOR="#000000">> ((title :accessor title</FONT>
<FONT COLOR="#000000">> :initarg :title</FONT>
<FONT COLOR="#000000">> :initform "Sample Title"</FONT>
<FONT COLOR="#000000">> :documentation "Title for content")</FONT>
<FONT COLOR="#000000">> (data :accessor data</FONT>
<FONT COLOR="#000000">> :initarg :data</FONT>
<FONT COLOR="#000000">> :initform "Data"</FONT>
<FONT COLOR="#000000">> :documentation "Data for content"))</FONT>
<FONT COLOR="#000000">> (:metaclass persistent-metaclass))</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> After these steps, I tried to load my app with asdf but got this</FONT>
<FONT COLOR="#000000">> error:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> debugger invoked on a SIMPLE-ERROR in thread</FONT>
<FONT COLOR="#000000">> #<THREAD "initial thread" {90033C9}>:</FONT>
<FONT COLOR="#000000">> Error during processing of --eval option (LOAD #P"bin/make-image.lisp"):</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> There is no applicable method for the generic function</FONT>
<FONT COLOR="#000000">> #<STANDARD-GENERIC-FUNCTION ELEPHANT::NEXT-OID (1)></FONT>
<FONT COLOR="#000000">> when called with arguments</FONT>
<FONT COLOR="#000000">> (NIL).</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Is this problem related with Waldo Rubinstein's post? </FONT>
<FONT COLOR="#000000">> <A HREF="http://common-lisp.net/pipermail/elephant-devel/2006-January/000212.html">http://common-lisp.net/pipermail/elephant-devel/2006-January/000212.html</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Can you give me a temporary solution?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Best Regards.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> _______________________________________________</FONT>
<FONT COLOR="#000000">> elephant-devel site list</FONT>
<FONT COLOR="#000000">> <A HREF="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</A></FONT>
<FONT COLOR="#000000">> <A HREF="http://common-lisp.net/mailman/listinfo/elephant-devel">http://common-lisp.net/mailman/listinfo/elephant-devel</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>