Russ Tyndall | 2 Aug 2011 16:45
Favicon
Gravatar

Re: Time for a new CLSQL Release

Just wanted to touch base, and let you know that we have now pushed the 
previously discussed patches upstream.

Cheers,
Russ Tyndall
Acceleration.net

On 7/15/2011 12:00 PM, Russ Tyndall wrote:
> The remaining patch sets add:
>   * Add a new postgres backend based on cl-postgres (which allows the use
> of the version 3 socket api, and command objects/parameters)
>   * Change how database identifiers are emitted to hopefully make this
> less brittle, and more easily intuitable
>    * previously every code path that wanted to emit a database identifier
> was responsible for coercing what was provided into a correctly escaped
> string.  Sometimes two or three functions in a row were trying to
> correctly quote and output that string.  I have tried to centralize this
> type coersion and logic into a single code path.
>
> These patches could affect backwards compatibility for some people and I
> think having a clear release to point them to, would be helpful.  While
> I think most users will not notice a difference, some people who were
> trying to massage specific identifiers through the old, less predictable
> system (like we were), might be affected.
Kushal Das | 3 Aug 2011 14:17
Picon
Gravatar

Issue while simultaneously accessing mysql db using clsql on a hunchentoot server

Hi,

I am writing a small webapp with mysql backend and hunchentoot as a framework.
using (connect `("host" "dbname" "username" "password")
:database-type :mysql) to connect , works well if only 1 person tries
to connect to the system. But with any simultaneous access , the db
connection dies. I am getting "Error 2006 / MySQL server has gone
away".

Can any one can point me to some example on how to solve this and have
simultaneous access?

Kushal
--

-- 
http://fedoraproject.org
http://kushaldas.in
rm | 3 Aug 2011 15:41
Picon

Re: Issue while simultaneously accessing mysql db using clsql on a hunchentoot server

On Wed, Aug 03, 2011 at 05:47:16PM +0530, Kushal Das wrote:
> Hi,
> 
> I am writing a small webapp with mysql backend and hunchentoot as a framework.
> using (connect `("host" "dbname" "username" "password")
> :database-type :mysql) to connect , works well if only 1 person tries
> to connect to the system. But with any simultaneous access , the db
> connection dies. I am getting "Error 2006 / MySQL server has gone
> away".
> 
> Can any one can point me to some example on how to solve this and have
> simultaneous access?

I hope you are aware of the fact that hunchentoot is a multi-threaded
application and you need to have a dedicated database connection for
each thread. Otherwise you'll get into big trouble ....

 HTH Ralf Mattes

> Kushal
> -- 
> http://fedoraproject.org
> http://kushaldas.in
> _______________________________________________
> CLSQL mailing list
> CLSQL@...
> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Kushal Das | 3 Aug 2011 15:46
Picon
Gravatar

Re: Issue while simultaneously accessing mysql db using clsql on a hunchentoot server

On Wed, Aug 3, 2011 at 7:11 PM,  <rm@...> wrote:
>
> I hope you are aware of the fact that hunchentoot is a multi-threaded
> application and you need to have a dedicated database connection for
> each thread. Otherwise you'll get into big trouble ....
Trying to do that only, but failing. Even tried to use clsql-fuild.

Can you point me to some example?

Kushal
--

-- 
http://fedoraproject.org
http://kushaldas.in
Kevin Rosenberg | 3 Aug 2011 16:50
Favicon

Re: Time for a new CLSQL Release

Very good, Russ.

I'm in the process of releasing CLSQL 6.0.0

Kevin
Nathan Bird | 3 Aug 2011 16:53
Favicon

Re: Issue while simultaneously accessing mysql db using clsql on a hunchentoot server

On Wed 03 Aug 2011 09:46:30 AM EDT, Kushal Das wrote:
> On Wed, Aug 3, 2011 at 7:11 PM,<rm@...>  wrote:
>>
>> I hope you are aware of the fact that hunchentoot is a multi-threaded
>> application and you need to have a dedicated database connection for
>> each thread. Otherwise you'll get into big trouble ....
> Trying to do that only, but failing. Even tried to use clsql-fuild.
> 
> Can you point me to some example?
> 
> Kushal

Russ just wrote up a blog post that might illuminate the situation more:
http://russ.unwashedmeme.com/blog/?p=218

Generally a quick check is:  make sure you aren't pulling an object 
from the database and using it in multiple requests. The view-class 
objects keep a reference to the database they originally came from and 
use that database connection in the future even if you try to point it 
at a different database.
Kushal Das | 4 Aug 2011 12:52
Picon
Gravatar

Re: Issue while simultaneously accessing mysql db using clsql on a hunchentoot server

On Wed, Aug 3, 2011 at 8:23 PM, Nathan Bird <nathan <at> acceleration.net> wrote:
> Russ just wrote up a blog post that might illuminate the situation more:
> http://russ.unwashedmeme.com/blog/?p=218
>
> Generally a quick check is:  make sure you aren't pulling an object
> from the database and using it in multiple requests. The view-class
> objects keep a reference to the database they originally came from and
> use that database connection in the future even if you try to point it
> at a different database.
The blog post helped me to understand few things, thanks :)
Still one question, if I try to use direct query methods within
with-database , will that work ?

Kushal
--

-- 
http://fedoraproject.org
http://kushaldas.in

_______________________________________________
CLSQL mailing list
CLSQL <at> b9.com
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Russ Tyndall | 4 Aug 2011 15:47
Favicon
Gravatar

Re: Issue while simultaneously accessing mysql db using clsql on a hunchentoot server

Not sure what you mean by "direct query methods".

However, if what you mean is that you only use clsql:query (and not 
clsql:select) or that you dont store any objects across page requests, 
then you should not experience any errors.

Generally speaking (with-database (...) (clsql:query ...)) should not 
have any thread safety errors.

Hope this helps,
Russ Tyndall
Acceleration.net

On 8/4/2011 6:52 AM, Kushal Das wrote:
> On Wed, Aug 3, 2011 at 8:23 PM, Nathan Bird<nathan@...>  wrote:
>> Russ just wrote up a blog post that might illuminate the situation more:
>> http://russ.unwashedmeme.com/blog/?p=218
>>
>> Generally a quick check is:  make sure you aren't pulling an object
>> from the database and using it in multiple requests. The view-class
>> objects keep a reference to the database they originally came from and
>> use that database connection in the future even if you try to point it
>> at a different database.
> The blog post helped me to understand few things, thanks :)
> Still one question, if I try to use direct query methods within
> with-database , will that work ?
>
> Kushal
Wout Perquin | 29 Aug 2011 21:32
Picon

Undefined foreign symbol: "crypt"

Hi all,
I code :
(if (not (clsql:connected-databases))    
(clsql:connect '("localhost" "menu-system" "postgres" nil) :database-type :postgresql))
; something that used to be working, but now I get :

; Loading #P"/var/clfree/clsql-6.0.0/clsql-postgresql-socket.asd".
; Loading #P"/var/clfree/clsql-6.0.0/db-postgresql-socket/postgresql-socket-package.x86f".
; Loading #P"/var/clfree/clsql-6.0.0/db-postgresql-socket/postgresql-socket-api.x86f".

Undefined foreign symbol: "crypt"
   [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR]

Restarts:
  0: [CONTINUE] Return NIL from load of #P"/var/clfree/clsql-6.0.0/db-postgresql-socket/postgresql-socket-api.x86f".
  1: [RETRY   ] Retry performing #<ASDF:LOAD-OP (:VERBOSE NIL) {590E1B4D}> on
                #<ASDF:CL-SOURCE-FILE "postgresql-socket-api" {5876E14D}>.
  2: [ACCEPT  ] Continue, treating #<ASDF:LOAD-OP (:VERBOSE NIL) {590E1B4D}> on
                #<ASDF:CL-SOURCE-FILE "postgresql-socket-api" {5876E14D}> as
                having been successful.
  3: [ABORT   ] Return to Top-Level.

Debug  (type H for help)

(KERNEL:UNDEFINED-FOREIGN-SYMBOL-ERROR-HANDLER "<error finding name>"
                                               #.(SYSTEM:INT-SAP #x3FFFC670)
                                               #<Alien (*
                                                        SYSTEM:SYSTEM-AREA-POINTER) at #x3FFFC37C>
                                               (16))
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:
  target:code/interr.lisp.

Any suggestions about what might go wrong ?

Thanks in advance, Wout Perquin

_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Russ Tyndall | 30 Aug 2011 16:40
Favicon
Gravatar

Re: Undefined foreign symbol: "crypt"

I have not seen this, and have been able to run the postgres socket backend.

Apparently this calls out to libcrypt in one of these locations:
'(#+(or 64bit x86-64) "/usr/lib64/" "/usr/lib/" "/usr/local/lib/" "/lib/")

I don't see anything related to crypt changing in 2010-2011, so perhaps something has changed on your local box?  What was the last version of clsql that worked correctly for you in this regard?

One difference between our setups might be that I am using clsql-cffi instead of clsql using uffi.  I have not worked much on uffi , but perhaps a recent change there caused something to break in the crypt call?  The last relevent uffi change seems to be on 2010-04-20T12:31:37 at the earliest.

For reference this is the result of calling crypt for me:
POSTGRESQL-SOCKET> (crypt-password "foobar" "1234")
"12Ce3aDvyIkJ2"

I hope something here has given you an idea,
Russ Tyndall
Acceleration.net

<Wout: Sorry for the accidental off of list response>

On 8/29/2011 3:32 PM, Wout Perquin wrote:
Hi all,
I code :
(if (not (clsql:connected-databases))    
(clsql:connect '("localhost" "menu-system" "postgres" nil) :database-type :postgresql))
; something that used to be working, but now I get :

; Loading #P"/var/clfree/clsql-6.0.0/clsql-postgresql-socket.asd".
; Loading #P"/var/clfree/clsql-6.0.0/db-postgresql-socket/postgresql-socket-package.x86f".
; Loading #P"/var/clfree/clsql-6.0.0/db-postgresql-socket/postgresql-socket-api.x86f".

Undefined foreign symbol: "crypt"
   [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR]

Restarts:
  0: [CONTINUE] Return NIL from load of #P"/var/clfree/clsql-6.0.0/db-postgresql-socket/postgresql-socket-api.x86f".
  1: [RETRY   ] Retry performing #<ASDF:LOAD-OP (:VERBOSE NIL) {590E1B4D}> on
                #<ASDF:CL-SOURCE-FILE "postgresql-socket-api" {5876E14D}>.
  2: [ACCEPT  ] Continue, treating #<ASDF:LOAD-OP (:VERBOSE NIL) {590E1B4D}> on
                #<ASDF:CL-SOURCE-FILE "postgresql-socket-api" {5876E14D}> as
                having been successful.
  3: [ABORT   ] Return to Top-Level.

Debug  (type H for help)

(KERNEL:UNDEFINED-FOREIGN-SYMBOL-ERROR-HANDLER "<error finding name>"
                                               #.(SYSTEM:INT-SAP #x3FFFC670)
                                               #<Alien (*
                                                        SYSTEM:SYSTEM-AREA-POINTER) at #x3FFFC37C>
                                               (16))
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:
  target:code/interr.lisp.

Any suggestions about what might go wrong ?

Thanks in advance, Wout Perquin



_______________________________________________ CLSQL mailing list CLSQL-0lovp2JerKU@public.gmane.org http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql

Gmane