Skip site navigation (1) Skip section navigation (2)

Re: Transactions and web applications

From: brianb-pggeneral(at)edsamail(dot)com
To: Lincoln Yeoh <lylyeoh(at)mecomb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Transactions and web applications
Date: 2000-06-27 09:02:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Lincoln Yeoh writes:

> At 10:01 PM 26-06-2000 -0400, Michael Mayo wrote:
> >----- Original Message -----
> >From: "Lincoln Yeoh" <lylyeoh(at)mecomb(dot)com>
> >> What are the recommended ways to do transactions in web applications?
> Let me illustrate the problem with an example:
> page 1
> user logs in
> page 2
> user does A
> page 3
> user does B
> page 4
> user does C
> page 5
> user says, oops forget the whole thing, please rollback. Or user just says
> forget it and closes browser. Or browser crashes at page 4.

Typically, web applications do not need to store the intermediate results
in the database. You can store them as hidden form variables on the
in-between pages or as cookies on the browser. Only when all the data is
ready to be passed to the database do you need to worry about the
transaction, and then it's only done when the webserver handles that
particular page. 

This way, you limit your transaction to the time it takes to handle the
final "Submit" page.

If you're doing serious web/db stuff, you may want to look at the numerous
resources available at (formerly

> Do those Java object thingies help for these problems?   


Brian Baquiran <brianb(at)edsamail(dot)com> AIM: bbaquiran 
Work: (632)7182222       Home: (632)9227123

In response to

pgsql-general by date

Next:From: Karel ZakDate: 2000-06-27 10:19:32
Subject: Re: How to dump from Postgre
Previous:From: NRonayetteDate: 2000-06-27 08:55:46
Subject: Re: Why isn't that null

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group