Re: Transactions and web applications
От | brianb-pggeneral@edsamail.com |
---|---|
Тема | Re: Transactions and web applications |
Дата | |
Msg-id | 20000627090206.6548.qmail@mail01.edsamail.com.ph обсуждение исходный текст |
Ответ на | Re: Transactions and web applications (Lincoln Yeoh <lylyeoh@mecomb.com>) |
Список | pgsql-general |
Lincoln Yeoh writes: > At 10:01 PM 26-06-2000 -0400, Michael Mayo wrote: > >----- Original Message ----- > >From: "Lincoln Yeoh" <lylyeoh@mecomb.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 http://www.arsdigita.com/asj (formerly http://photo.net/wtr/). > Do those Java object thingies help for these problems? :-) Brian -- Brian Baquiran <brianb@edsamail.com> http://www.baquiran.com/ AIM: bbaquiran Work: (632)7182222 Home: (632)9227123
В списке pgsql-general по дате отправления: