Thread: persistent connection using PHP and Transaction

persistent connection using PHP and Transaction

From
"Ben-Nes Michael"
Date:
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 ?

--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------



Re: persistent connection using PHP and Transaction

From
Mark kirkwood
Date:
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 ?