[Klone-users] DB connections for users
Stefano Barbato
barbato at koanlogic.com
Fri Jun 19 09:24:42 EDT 2009
Hello Alex,
I think that you actually get two connections but both have the same
pointer value, i.e. the pointer is the same but each process has its
own address space so they actually point to different location of
physical RAM.
You can verify that using 'netstat' to check that more then one
connection to Postgres is on or printing the local port number of the
socket ( sock = PQsocket(conn)).
bye!
s
On 19/giu/09, at 12:34, Alex Effractor wrote:
> Sorry for previous message -- I sent it when it was not finished :)
> So, my chilt_init hook looks like that:
>
> PGconn *conn;
> const char *conn_str = "...";
>
> int child_init()
> {
> conn = PQconnectdb(conn_str);
> info("conn = %p", conn);
> //Check connection
> return 0;
> }
>
> int child_term()
> {
> PQfinish(conn);
> return 0;
> }
> When I print connection pointer value I found, that in all childs
> connection pointers are equal. Does anybody know how I can create
> private connection for each child? Or for each logined user(I
> already have login system and all users info stored in session)?
> Thanks, Alex.
>
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
More information about the klone-users
mailing list