Re: php with postgres

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Marcus Börger <marcus(dot)boerger(at)post(dot)rwth-aachen(dot)de>, ivan <iv(at)psycho(dot)pl>, Joe Conway <mail(at)joeconway(dot)com>, Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: php with postgres
Date: 2003-07-22 20:57:56
Message-ID: 3F1DA554.1070205@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Marcus B?rger wrote:
>> However it may be very usefull to terminate any open transaction before
>> reusing a persisten connection. Typically this happens when the same script
>> runs again. But anyway using transactions together with persistent conenctions
>> in a multithreaded environment isn't the best thing you could do. So our
>> options are
>> 1) tell the users to do 'auto commit mode'
>> 2) nested transactions
>> 3) locking
>>
>> >From my perspective 2) and 3) are bad ideas for the web environment. In other
>> words i guess we should leave it as is with transaction rollback only when the
>> client terminates (e.g. the webserver stops).
>
> I don't see why you wouldn't just do BEGIN;COMMIT;RESET ALL; when you
> pass the connection to a new client.
>

Right, and I don't see why using transactions in a multithreaded
environment would be a bad idea. However an application is designed, one
logical unit of changes, called a business transaction, has to have one
database transaction modifying the business relevant information.
There could be other transactions involved for dialog handling and
advisory locking.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-07-22 20:58:09 Re: did you read my mails ?
Previous Message Nigel J. Andrews 2003-07-22 20:56:15 Re: Why select * from function doesn't work when function