Hello Lincoln,
On 18-Feb-00 05:40:51, you wrote:
>About transactions, I find that they're not that useful in a typical web
>app, because
>1) Many web apps are simple, and don't need transactions, or have simple
>work arounds.
You mean that applications that require almost read only databases, or
single table updates do not require transactions. You can't live without
transactions outside that scenario unless you want to risk your
applications to break due to database inconsistencies when many users are
working with the application.
>2) And when you do need transactions, HTTP is not very state friendly, so
>unless you do something special your database level transaction is
>typically going to last only one page, so if your real life transaction
>spans across multiple pages, the database level transaction system isn't
>going to help much.
The way I see it transactions are meant to turn a set of queries virtually
atomic. Anyway, transaction queries should be done one after the other.
You should not leave a transaction open for an unrestricted period of time.
If you need to hold locks on data for an unknown amount of time, you'd
better find other solutions besides transactions. For instance if you
want to hold on a ticket reservation for a client before he decides to
purchase it, you should not use transactions to lock the reservation.
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--