Re: connection to database
| From: | Yasuo Ohgaki | Date: | Fri, 13 Apr 2001 00:22:15 +0000 |
| Subject: | Re: connection to database | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8533@lists.php.net to get a copy of this message | ||
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" <SBrett@e-mis.com> wrote in message
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:sharmad@goatelecom.com]
> > Sent: 11 April 2001 19:59
> > To: php-db@lists.php.net
> > 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: php-db-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-db-help@lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>