Обсуждение: Maintaining a transaction across multiple HTTP requests

Поиск
Список
Период
Сортировка

Maintaining a transaction across multiple HTTP requests

От
Dave Page
Дата:
Hi all,
 
I need to write a server script that will be used to synchronise a SQL Server CE database on a Pocket PC with a central PostgreSQL database. Ideally, what I'd like to do is pass modifications made on the PPC to the script which then begins a transaction (thus ensuring no futher data changes will be seen by the client) and checks for any conflicts with changes made on PostgreSQL since the last synchronisation. If there are any, the script will return details to the client for conflict resolution. When the planned conflict resolution is returned by the client, the required updates are executed within the original transaction which is then committed.
 
The difficulty with this plan is that the transaction must be maintained across 2 or more individual http requests (which may normally be serviced by different Apache child processes of course, thus preventing storage of a connection handle in a session variable). Is there conceivable way I can achieve this, or should I go back to the drawing board?
 
Regards, Dave.

Re: Maintaining a transaction across multiple HTTP requests

От
"Dave Page"
Дата:
> -----Original Message-----
> From: Jack - [mailto:jackhappy6@hotmail.com]
> Sent: Fri 6/18/2004 5:08 PM
> To: Dave Page
> Subject: Maintaining a transaction across multiple HTTP requests
>
> could u store of a connection handle in a session variable - but on the
> server side have the session information stored on a shared database
> instead of a file?

Hi Jack,

I considered that approach, but the problem is that the handle is only valid for the apache process that it was opened
under.If the second request is processed by a different apache process, then it'll all go horribly wrong :-( 

Regards, Dave

Determining transaction status

От
Aaron Dummer
Дата:
Hey guys,

Is there any way to determine transaction status without using
pg_transaction_status() (which hasn't been officially released yet)?

I'm using PostgreSQL 8.0.2/PHP 5.0.4.

Thanks!

--
Aaron Dummer
aaron@dummer.info


Re: Determining transaction status

От
Volkan YAZICI
Дата:
Hi,

On 5/2/05, Aaron Dummer <aaron@dummer.info> wrote:
> Is there any way to determine transaction status without using
> pg_transaction_status() (which hasn't been officially released yet)?

You can patch your ext/pgsql/pgsql.c from CVS. pg_transaction_status()
is added in revision 1.315.
[http://cvs.php.net/php-src/ext/pgsql/pgsql.c]

Regards.

Re: Determining transaction status

От
Christopher Kings-Lynne
Дата:
> Is there any way to determine transaction status without using
> pg_transaction_status() (which hasn't been officially released yet)?

No.

Chris