Any ideas what might trigger cl-postgres (postmodern 1.14) coming to
its knees with the backtrace shown below? No error or condition
description is given - sbcl (1.0.28) just retires from active duty and
drops into the debugger with the ("bogus stack frame") indication. The
postgresql server (8.3) log doesn't have any indication of trouble at
the time cl-postgres seems to run into trouble. This seems to only
happen intermittently (every few thousand queries), irreproducibly
(doesn't seem to be …
[View More]associated with a specific query or anything along
those lines), and only when the postgresql server is being utilized by
several lisp instances concurrently.
Thanks in advance for any input/ideas/troubleshooting suggestions...
- Alan
...
32: ("bogus stack frame")
33: (SB-IMPL::SUB-SUB-SERVE-EVENT NIL NIL)
34: (SB-IMPL::SUB-SERVE-EVENT NIL NIL NIL)
35: (SB-SYS:WAIT-UNTIL-FD-USABLE 5 :INPUT NIL)
36: (SB-IMPL::REFILL-INPUT-BUFFER #<SB-SYS:FD-STREAM for "a socket" {C265BA9}>)
37: (SB-IMPL::INPUT-UNSIGNED-8BIT-BYTE
#<SB-SYS:FD-STREAM for "a socket" {C265BA9}>
T
NIL)
38: (CL-POSTGRES::SKIP-BYTES #<unavailable argument> #<unavailable argument>)
39: (CL-POSTGRES::TRY-TO-SYNC #<SB-SYS:FD-STREAM for "a socket" {C265BA9}> T)
40: ((FLET #:CLEANUP-FUN-[FORM-FUN-[SEND-QUERY]389]390))[:CLEANUP]
41: (CL-POSTGRES::SEND-QUERY
#<unavailable argument>
#<unavailable argument>
#<unavailable argument>)
42: ((LABELS #:G161))
43: (SQLG::QUERY-CORE
"select program from programs where programskey = '192828' ;"
20
#<unused argument>)
[View Less]
Hi
I am trying to figure out how to exclude certain slots when persisting
the dao instance to the db short of making a new object with the limited
range of slots.
Any ideas or advise?
Thanx
Marijn,
Brilliant! Thank you for the fix. I enjoy your libraries and, if I
find something else that can help, I'll be sure to send the email.
Skaal!
Curtis.
I tried multiple ways to get the with-column-writers macro in the
repository to work and could not. I believe that the loop should read
:in rather than :on as follows:
(defmacro with-column-writers ((&rest defs) &body body)
`(let ((*custom-column-writers* (append (list ,@(loop :for (field
writer) :in defs
:collect
`(cons (to-sql-name ,field) ,writer)))
*custom-column-writers*)))
,@…
[View More]body))
With that in place, the following code works correctly:
(defclass foo ()
((id :col-type int :initform :id :accessor foo-id)
(stuff :initform :stuff :accessor foo-stuff))
(:metaclass postmodern:dao-class)
(:keys id))
(setf foo
(postmodern:with-column-writers
((:id #'(lambda (inst val)
(setf (foo-id inst) val)
(setf (foo-stuff inst)
(format nil "My Value: ~A" val)))))
(postmodern:get-dao 'foo 1)))
[View Less]
I defined a dao class which I would like to get a sequential id from the
database. For the id slot I have:
(id :col-type serial :accessor seat-id)
When I try to do an update-dao with an instance of that class, I get:
Error: The slot ID is unbound in the object #<CPA-SEAT 2665E40F> (an
instance of class #<DAO-CLASS CPA-SEAT 25EE423B>).
I'd appreciate any suggestions about what I'm doing wrong. Thank you.
Mitch
Hello, forum!
I have a dao class that uses 'date' col-type:
(reg_date :col-type date :initarg :date
:accessor user-reg-date
:initform (get-current-simple-date)))
here is a (get-current-simple-date) result:
#<SIMPLE-DATE:DATE 17-10-2009>
but the following error is generated when I'm trying to instantiate the object:
Value #<SIMPLE-DATE:DATE 17-10-2009> can not be converted to an SQL literal.
[Condition of type SIMPLE-ERROR]
Thanks in advance!
--
http://blog.shevchuk.org
I was wondering if it was a bug or intended behavior that row reader
functions do not properly return multiple values?
I am working on a cl-postgres backend to clsql, so I am not very
familiar with much of the workings of this project, but noticed this
somewhat odd (from my perspective) behavior. I have worked around this
in the obvious way (list instead of multiple values).
It seems to be a problem with the returning-effected-rows macro (which
expands to a let, effectively discarding any …
[View More]multiple values returned
from the row reader). Is there a reason not to change the definition to
the following?
http://paste.lisp.org/display/88358
Cheers,
Russ Tyndall
[View Less]
> 3: (SB-UNIX::NOTE-DANGEROUS-SELECT)
> 4: (SB-IMPL::SUB-SUB-SERVE-EVENT NIL NIL)
> 5: (SB-IMPL::SUB-SERVE-EVENT NIL NIL NIL)
> 6: (SB-SYS:WAIT-UNTIL-FD-USABLE 13 :INPUT NIL)
> 7: (SB-IMPL::REFILL-INPUT-BUFFER #<SB-SYS:FD-STREAM for "a socket" {100338FE81}>)
> 8: (SB-IMPL::INPUT-UNSIGNED-8BIT-BYTE #<SB-SYS:FD-STREAM for "a socket" {100338FE81}> T NIL)
> 9: (CL-POSTGRES::READ-UINT1 #<unavailable argument>)
fyi, we …
[View More]have a postmodern branch which has a patch to make it use
iolib as the socket backend. we also had some issues with
sb-bsd-sockets before...
i CC the postmodern list to give another data point why it's a good
idea to have iolib as the socket backend.
http://dwim.hu/darcsweb/darcsweb.cgi?r=HEAD%20postmodern;a=summary
or
darcs pull http://dwim.hu/darcs/postmodern/
hth,
--
attila
[View Less]
I can't seem to get the syntax right using s-sql. I can write a straight sql
statement, but it looks ugly in the middle of a lisp program.
Sample sql statement from the postgresql docs is:
WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
SELECT g.id, g.link, g.data, 1,
ARRAY[g.id],
false
FROM graph g
UNION ALL
SELECT g.id, g.link, g.data, sg.depth + 1,
path || g.id,
g.id = ANY(path)
FROM graph g, …
[View More]search_graph sg
WHERE g.id = sg.link AND NOT cycle
)
SELECT * FROM search_graph;
http://www.postgresql.org/docs/8.4/static/queries-with.html
Sabra
[View Less]