Re: problem with threading and sql lib

2009-09-20 Thread Roger Gilliar
> Nothing leaps out at me as a likely cause of a dropped message. > - The only reason I can think of: It could be a problem when the loading of the JDBC driver is happening inside a thread. At least that would explain why calling (with-connection db nil ) before

Re: problem with threading and sql lib

2009-09-19 Thread John Harrop
Nothing leaps out at me as a likely cause of a dropped message. OTOH, the loop/recur at the end is probably better changed to a doseq. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: problem with threading and sql lib

2009-09-19 Thread Roger Gilliar
> > You mention threading in the subject and you have a (binding > [...] ...) form. Are you starting a thread, or communicating with > one, or using pmap, future, an agent, or etc. inside the binding, > and expecting the binding to affect the code that runs in the thread/ > map/future/agent?

Re: problem with threading and sql lib

2009-09-19 Thread John Harrop
On Sat, Sep 19, 2009 at 1:07 AM, Roger Gilliar wrote: > > Hi, > > > re you opening something, using it to return a lazy sequence, and > > then closing it before consuming the sequence? > > > No. I started with just opening the database connection in the handler > function. You mention threading

Re: problem with threading and sql lib

2009-09-19 Thread Roger Gilliar
Not from my code. Regards Roger Am 19.09.2009 um 12:11 schrieb Christophe Grand: > is "db" dynamically rebound? > > On Sat, Sep 19, 2009 at 7:07 AM, Roger Gilliar > wrote: > > Hi, > > > re you opening something, using it to return a lazy sequence, and > > then closing it before consuming

Re: problem with threading and sql lib

2009-09-19 Thread Christophe Grand
is "db" dynamically rebound? On Sat, Sep 19, 2009 at 7:07 AM, Roger Gilliar wrote: > > Hi, > > > re you opening something, using it to return a lazy sequence, and > > then closing it before consuming the sequence? > > > No. I started with just opening the database connection in the handler > fun

Re: problem with threading and sql lib

2009-09-18 Thread Roger Gilliar
Hi, > re you opening something, using it to return a lazy sequence, and > then closing it before consuming the sequence? No. I started with just opening the database connection in the handler function. Regards Roger --~--~-~--~~~---~--~~ You received th

Re: problem with threading and sql lib

2009-09-18 Thread John Harrop
On Fri, Sep 18, 2009 at 1:32 PM, rogergl wrote: > The problem is that the above code only works if I establish a > connection outside the handle-client function. Otherwise the first > reply to my client gets lost. > > Has anyone an explanation for this ? Are you opening something, using it to r

problem with threading and sql lib

2009-09-18 Thread rogergl
The first part of my code looks like this (defn handle-client [in out] (binding [ *in* (reader in) ] (with-connection db (let [outstream (writer out)] (loop []