Re: persistent connection using PHP and Transaction - Mailing list pgsql-general

From Mark kirkwood
Subject Re: persistent connection using PHP and Transaction
Date
Msg-id 1009537466.2542.23.camel@spikey.slithery.org
Whole thread Raw
In response to persistent connection using PHP and Transaction  ("Ben-Nes Michael" <miki@canaan.co.il>)
List pgsql-general
You will not have trouble because of this, as the apache architecture
prevents the situation occurring (as I understand it anyway) -

If a new request needs an apache process to service it, then the ones
that are still awaiting results from db backends (i.e currently in
transactions) will not be on the "spare" queue, so apache will spawn
another process or use one on the "spare" queue. This process will open
a new db connection or reuse an existing one (which will be ready to
start a new transaction in either case).

You can configure this behaviour in httpd.conf ( StartServers,
MinSpareServers and MaxSpareServers).

In addition the situation you are describing is not allowed by many
database managers. For example : Postgresql will not let you begin a
transaction unless the current one has issued a commit/rollback.

regards

Mark

>Hi All
>
>Will I have trouble while using persistent connection and transactions
?
>
>What will happen if in the middle of an transaction over p.connection
>another transaction will start on the same connection ?


pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: First decent PostgreSQL CBT now on techdocs.postgresql.org
Next
From: matthias.suess@gmx.de
Date:
Subject: