Re: PREPARE TRANSACTION and webapps - Mailing list pgsql-general

From Greg Stark
Subject Re: PREPARE TRANSACTION and webapps
Date
Msg-id 877jb9uq31.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: PREPARE TRANSACTION and webapps  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PREPARE TRANSACTION and webapps  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Lincoln Yeoh <lyeoh@pop.jaring.my> writes:
> > Can we have a reconnect and "reopen prepared/saved transactions" feature?
> > Please? :)
>
> What this would actually be useful for is a fair question
> though --- what's it do that you don't have now?

I think what they want to do is make the database concept of transactions
match up 1-1 with their application's concept of transactions. Which may span
multiple stateless http requests.

That usually means reengineering the http server and driver layers to keep
backends around and pull out the right one for every http request. But doing
that involves keeping around entire backends, which isn't terribly efficient
with kernel resources. It also involves adding some connection pool
infrastructure which are always annoying. At every level it imposes lots of
constraints on the application design.

The alternative is to reimplement some limited locking at the application
layer or finessing the situation somehow. That's what's usually recommended
here and it's what I usually do. But if what you really need is full ACID
semantics presented to the user then reimplementing the entire MVCC system
seems unnecessary when it all already exists in the database.

--
greg

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PREPARE TRANSACTION and webapps
Next
From: Tom Lane
Date:
Subject: Re: PREPARE TRANSACTION and webapps