If you connect with pg_PConnect(), connection will be there until web server
dies unless user is using CGI. (PostgreSQL backend will be there until then)
That's the idea of persistent link, so that user can avoid connection setup for
every db connection.
However, PostreSQL connects db relatively faster, I think it's acceptable to use
pg_Connect() in most cases.
I haven't tested how transaction will be performed on persistent link.
Does anyone know transaction issues on persistent link?
What happens if there are multiple transactions on the same database link?
Thanks,
--
Yasuo Ohgaki
"Steve Brett" <[EMAIL PROTECTED]> wrote in message
C05E7DA1218ED411BF8A00105AC95A8E01FF342D@SV-CNTRMAIL">news:C05E7DA1218ED411BF8A00105AC95A8E01FF342D@SV-CNTRMAIL...
> wow. another postgresql user !
>
> i use pg_connect to connect as well, including the connect script as an 'if
> not connected then connect' type of thing. the connection is killed and
> memory from queries freed up when the script finnishes.
>
> incidently, i used pconnect for a while but found that connections were
> staying open when users had left. postgresql just kept spawning backends ...
>
> using non-persistent connections eeemded a better deal ...
>
> Steve
>
> > -----Original Message-----
> > From: Sharmad Naik [mailto:[EMAIL PROTECTED]]
> > Sent: 11 April 2001 19:59
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] connection to database
> >
> >
> > Hi,
> > While writing dynamic pages I use pg_connect to connect
> > to the database.
> > I wanted to know whether i alway need to close database
> > connection or while
> > closing the FORM or going to another page does the connect
> > close automatically.
> > Is pg_close necessary to be given ?
> >
> > --
> > The secret of the universe is @*&!'^#+ NO CARRIER
> > __ _ _ _ _
> > |_|_||_||_||\/||_|| \
> > _|| || || \| || ||_/
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]