Re: Cleaning up aborted transactions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Greg

> Just so I have this straight, because I've been wondering the same,
> if someone on my web site does a SELECT and then clicks on the browser
> stop or gets click happy hitting one or many other links on the same
> web page then the 1st SELECT and all other interrupted SELECT's should
> get rolled back if each query starts with a BEGIN; because there is a
> disconnect.  Correct?

I don't let that happen. First, I gather all the required information, then
when the user clicks on submit or whatever he's doing, I do all in one
transaction. If it ends right the user is taken to a screen where he knows
that everything went fine (commit was successfull). If it fails at some
point I send the user to an error page, which can be more or less
descriptive depending on the needs of the interface.

> What about with persistant connections?

I haven't used them as most server out there will have them disabled.
Besides I don't think you need them and is probably not very efficient, also
it could limit the number of users for your app. And it can lead to
unpredictable behaviour on complex websites. If you don't need them, avoid
them.

Adrian Tineo




[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux