[phplib] $db object not working with pg_connect??? From: fabrizio.ermini <email protected>
Date: 01/30/01

Hi all...

I just encountered a really weird situation.

On a phplib enabled site, based on PostgreSQL, I just switched the main
connection function from pg_pconnect to the "not_permanent" one,
pg_connect.
This is because traffic is going up, and too many postgresql backend were
cluttering system RAM.
This is a thing I've done before in other phplib sites, with no problem.

Now this time, I've had to put pg_pconnect back because in all pages where I
was using more than one db_sql object, query failed with a "1 is not a valid
PostgreSQL link resource".

Apparently, connection resource ids get messed up.

And here it is the really strangest thing. I uncommented the line in db_pgsql.inc
with the debug "printf" in "query" method, to see exactly which query were
failing... and the problem went away!
The pages start working without complaining anything.

Evidently, the printf cannot have something to do with $Link_id. So the only
thing that I can think, it's some sort of race condition... it appears as if I try to
exec queryes too fast one after the other, $Link_id get messed, if I put in a
longish printf just to let the backend taking a little breath, all works well.
 
I will gladily listen to any thought from you boys...

TIA,
Ciao!

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini Alternate E-mail:
C.so Umberto, 7 faermini <email protected>
loc. Meleto Valdarno Mail on GSM: (keep it short!)
52020 Cavriglia (AR) faermini <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>