Re: Persistent Connects (pg_pconnect)

From: Luca Pregliasco <upa(at)apuanet(dot)bicnet(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Persistent Connects (pg_pconnect)
Date: 2000-12-12 23:50:40
Message-ID: 3A36B9D0.AC0BFEBD@apuanet.bicnet.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Colleen Williams wrote:

> However we had another problem, the solution with using pg_connect instead
> of pg_pconnect worked on DEV but not on PROD. We think it is to do with
> different PHP versions. DEV was using PHP4.0.1p2 and PROD was using
> PHP4.0.3p1. We think maybe there is a variable scoping problem PHP4.0.3p1.
> Perhaps PHP doesn't really work so well with object code and so we
> shouldn't be using object code.
>
> I have used the following code to do the database connect in my db.inc. To
> make the code work in PROD I have had to make $connection a global variable
> (by uncommenting the commented lines) as although it would connect fine and
> return a valid connection index, the next time I went to fetch the query,
> postgres would return an 'invalid postgres resource link' error. However in
> DEV (PHP4.0.1p2) it was working fine - creating a new postgres resource
> when a new query object is created.
>
> If you can see a bug in my code and it is not at all a PHP version problem
> OR if you can confirm it is a PHP version problem please let me know. I
> would like to know if I am just doing it all wrong.

We are having exactly the same problem, with exactly the same
configurations, and we also reached the conclusion about PHP not working
fine with variable scoping in objects.
The code you supplied in example is very similar to our source, this
also confirms our fears.
We are investigating every single difference between the two PHP
versions to figure out a serius fix.

bye

Luca Pregliasco
upa(at)apuanet(dot)bicnet(dot)it

IF Internet Farm S.p.A.
Via Dorsale 13 - 54100 Massa - Italia

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Karel Zak 2000-12-13 08:28:29 Re: select ... for update
Previous Message Jie Liang 2000-12-12 22:03:17 select ... for update