From mitch at bermita.com Fri Sep 4 17:24:23 2009 From: mitch at bermita.com (Mitch Berkson) Date: Fri, 04 Sep 2009 13:24:23 -0400 Subject: [postmodern-devel] Error if SSL and no client cert and key files specified Message-ID: <4AA14D47.1010406@bermita.com> If I call make-ssl-stream with *ssl-key-file* and *ssl-certificate-file* both nil, I get the following error: Error: A failure in the SSL library occurred on handle #. (Return code: 1)SSL error queue: error:140C5042:SSL routines:SSL_UNDEFINED_FUNCTION:called a function you should not call Does this mean that it's not possible to make a unilateral SSL connection? Should there be a more user-friendly error message? Thanks for any help. Mitch From marijnh at gmail.com Fri Sep 4 17:32:57 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Fri, 4 Sep 2009 19:32:57 +0200 Subject: [postmodern-devel] Error if SSL and no client cert and key files specified In-Reply-To: <4AA14D47.1010406@bermita.com> References: <4AA14D47.1010406@bermita.com> Message-ID: Hi Mitch, When I first added the SSL stuff, not passing a certificate and key worked. I haven't tested this for a while, and it seems the CL+SSL version you are using somehow doesn't support it. All Postmodern does is call (make-ssl-stream socket :key *ssl-key-file* :certificate *ssl-certificate-file*) -- see cl-postgres/protocol.lisp. Best, Marijn From mitch at bermita.com Fri Sep 4 19:47:25 2009 From: mitch at bermita.com (Mitch Berkson) Date: Fri, 04 Sep 2009 15:47:25 -0400 Subject: [postmodern-devel] Error if SSL and no client cert and key files specified In-Reply-To: References: <4AA14D47.1010406@bermita.com> Message-ID: <4AA16ECD.6030907@bermita.com> Marijn Haverbeke wrote: > Hi Mitch, > > When I first added the SSL stuff, not passing a certificate and key > worked. I haven't tested this for a while, and it seems the CL+SSL > version you are using somehow doesn't support it. All Postmodern does > is call (make-ssl-stream socket :key *ssl-key-file* :certificate > *ssl-certificate-file*) -- see cl-postgres/protocol.lisp. > > Best, > Marijn > Thanks. I looked at that and fooled around with it a little but can't figure out how to get it working. I am able to open a unilateral SSL connection fine from Lispworks. Is there a straightforward way to have Lispworks make the connection for Postmodern instead of CL+SSL? Mitch From marijnh at gmail.com Sat Sep 5 07:31:03 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Sat, 5 Sep 2009 09:31:03 +0200 Subject: [postmodern-devel] Error if SSL and no client cert and key files specified In-Reply-To: <4AA16ECD.6030907@bermita.com> References: <4AA14D47.1010406@bermita.com> <4AA16ECD.6030907@bermita.com> Message-ID: > Is there a straightforward way to have > Lispworks make the connection for Postmodern instead of CL+SSL? Of course -- the use that's made of CL+SSL is very minimal. If Lispworks also has a 'convert raw socket to ssl socket' function it'll serve just as well as CL+SSL. As I mentioned, the relevant code is in cl-postgres/protocol.lisp. If you can get a Lispworks-specific approach working in a way that is compatible with the CL+SSL code (#+/#-, etc), I'd be happy to integrate it into the distribution. Best, Marijn From mitch at bermita.com Tue Sep 22 21:46:38 2009 From: mitch at bermita.com (Mitch Berkson) Date: Tue, 22 Sep 2009 17:46:38 -0400 Subject: [postmodern-devel] "defined more than once in table.lisp" warnings Message-ID: <4AB945BE.9060204@bermita.com> When I run a select-dao, the REPL prints a bunch of warnings like: Warning: (METHOD UPDATE-DAO (CPA-SERIES)) defined more than once in d:\lisp\postmodern\postmodern\table.lisp. Is this something I can fix? Thanks for any help. Mitch From marijnh at gmail.com Wed Sep 23 05:29:32 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Wed, 23 Sep 2009 07:29:32 +0200 Subject: [postmodern-devel] "defined more than once in table.lisp" warnings In-Reply-To: <4AB945BE.9060204@bermita.com> References: <4AB945BE.9060204@bermita.com> Message-ID: Is there anything that might be causing the class to be finalised multiple times? (Multiple defclass forms, or a redefinition of a parent class...) These methods get defined every time the class is finalised. From mitch at bermita.com Thu Sep 24 01:53:35 2009 From: mitch at bermita.com (Mitch Berkson) Date: Wed, 23 Sep 2009 21:53:35 -0400 Subject: [postmodern-devel] "defined more than once in table.lisp" warnings In-Reply-To: References: <4AB945BE.9060204@bermita.com> Message-ID: <4ABAD11F.5060507@bermita.com> Marijn Haverbeke wrote: > Is there anything that might be causing the class to be finalised > multiple times? (Multiple defclass forms, or a redefinition of a > parent class...) These methods get defined every time the class is > finalised. > > I don't know. Maybe I am not using the :metaclass correctly. I have classes in a file as in this example: (defclass cpa-email () ((id :col-type integer :accessor email-id) (member_id :col-type integer :accessor email-member)) (:metaclass postmodern:dao-class) (:keys id) (:table-name db_email)) (defclass cpa-phone () ((id :col-type integer :accessor phone-id) (member :col-type integer :accessor phone-member) (description :col-type string :accessor phone-description)) (:metaclass postmodern:dao-class) (:keys id) (:table-name db_phone)) When I compile this, I get the warnings: ;;;*** Warning in (DEFCLASS CPA-EMAIL): (METHOD GET-DAO ((EQL (CLASS-NAME CLASS)))) defined more than once in d:\lisp\postmodern\postmodern\table.lisp. ;;;*** Warning in (DEFCLASS CPA-PHONE): (METHOD GET-DAO ((EQL (CLASS-NAME CLASS)))) defined more than once in d:\lisp\postmodern\postmodern\table.lisp. Mitch From marijnh at gmail.com Thu Sep 24 06:27:41 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Thu, 24 Sep 2009 08:27:41 +0200 Subject: [postmodern-devel] "defined more than once in table.lisp" warnings In-Reply-To: <4ABAD11F.5060507@bermita.com> References: <4AB945BE.9060204@bermita.com> <4ABAD11F.5060507@bermita.com> Message-ID: Which CL implementation is this? From mitch at bermita.com Thu Sep 24 11:18:57 2009 From: mitch at bermita.com (Mitch Berkson) Date: Thu, 24 Sep 2009 07:18:57 -0400 Subject: [postmodern-devel] "defined more than once in table.lisp" warnings In-Reply-To: References: <4AB945BE.9060204@bermita.com> <4ABAD11F.5060507@bermita.com> Message-ID: <4ABB55A1.2080109@bermita.com> Marijn Haverbeke wrote: > Which CL implementation is this? > Lispworks 5.1 on XP. From marijnh at gmail.com Thu Sep 24 11:25:24 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Thu, 24 Sep 2009 13:25:24 +0200 Subject: [postmodern-devel] "defined more than once in table.lisp" warnings In-Reply-To: <4ABB55A1.2080109@bermita.com> References: <4AB945BE.9060204@bermita.com> <4ABAD11F.5060507@bermita.com> <4ABB55A1.2080109@bermita.com> Message-ID: >> Which CL implementation is this? > Lispworks 5.1 on XP. Hm, I haven't tested on Lispworks in a long time. What I suspect is happening is that it has a slightly dumb redefinition check -- what's happening is that defmethod is being called from a function (for every finalised dao class), with an (eql class) specialiser where class is a lexically scoped variable. Most lisps seem to realise that class is bound to something new every time the function is called, and don't complain. This should be harmless. If it is causing problems (warnings at inappropriate times), could you find the Lispworks-specific magic-wrapper that can disable these warnings (if there is such a thing) and provide a patch where the relevant defmethod calls (function build-dao-methods in postmodern/table.lisp) get conditionally wrapped by such a thing on Lispworks? Best, Marijn From mitch at bermita.com Fri Sep 25 14:49:38 2009 From: mitch at bermita.com (Mitch Berkson) Date: Fri, 25 Sep 2009 10:49:38 -0400 Subject: [postmodern-devel] Using simple-date date class as :col-type Message-ID: <4ABCD882.9010802@bermita.com> I have not been successful using the date class as a :col-type in a DAO. Here is what I have tried: (defclass cpa-address () ((id :col-type integer :accessor address-id) (start_date :col-type date :accessor address-start-date) (version :col-type integer)) (:metaclass postmodern:dao-class) (:keys id) (:table-name gt_address)) In the Postgres database, the field type of start_date is date. When I select a cpa-address DAO, I expect to see a symbol of type simple-date in the start_date slot, but what I get is a CL universal time. Should I be trying something else to take advantage of simple-date? Thanks for any help. Mitch From marijnh at gmail.com Fri Sep 25 14:55:20 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Fri, 25 Sep 2009 16:55:20 +0200 Subject: [postmodern-devel] Using simple-date date class as :col-type In-Reply-To: <4ABCD882.9010802@bermita.com> References: <4ABCD882.9010802@bermita.com> Message-ID: Is simple-date/cl-postgres-glue.lisp being loaded? This happens automatically if simple-date is loaded *after* cl-postgres, but that's rather fragile. There's a :simple-date-postgres-glue system (defined in simple-date.asd) that loads this code. From mitch at bermita.com Fri Sep 25 15:40:01 2009 From: mitch at bermita.com (Mitch Berkson) Date: Fri, 25 Sep 2009 11:40:01 -0400 Subject: [postmodern-devel] Using simple-date date class as :col-type In-Reply-To: References: <4ABCD882.9010802@bermita.com> Message-ID: <4ABCE451.4070000@bermita.com> Marijn Haverbeke wrote: > Is simple-date/cl-postgres-glue.lisp being loaded? This happens > automatically if simple-date is loaded *after* cl-postgres, but that's > rather fragile. There's a :simple-date-postgres-glue system (defined > in simple-date.asd) that loads this code. > It wasn't being loaded. Now that it is, it behaves as expected. Thanks. Mitch