Hi!

I've been thinking here about databases and their use in WEB
developemnt and have come to a conclusion that transactions
are very often useless in real web applications, because creating
one logical object in database (sorry for OO notatitions, but I often
use RDBMSes for mapping object oriented structures in them, so
they whole thing works faster) envolves several web pages, so,
between pages a script must disconnect and connect again, which
implies that there should be commit or roll-back. So, you cannot
start a transaction on page one and commit it on the last page.
The soultion would be a feature that allows a connection freeze with
a timeout. Let me give you and example:

PAGE1: Scripts connects, starts transaction, does some queries,
issues a connection freeze with timeout of 20 seconds and gets
a frozen connection id. Script finishes, however, sql server does
not destroy the session, instead, it locks the session and considers
that a client went to take a nap.

PAGE2: Script starts and issue a thaw to the connection suppling
user credetials and frozen connection id. Does more data manipulation
and commits the transaction which was started on the first page. Disconnect.
Finish.

Ain't it nice?

Current workaround would be (generic description)
1) In each table create a field called sys_commit
2) When executing any query set sys_commit to 0
3) Remember in some persistent manner the list of records changed
4) On the last page set for all remembered recods sys_commit to 1
Sure, all SQL queries must manipulate only records with sys_commit to 1,
and all other must be considered non-existing and  cleaned up
periodically.

What do you think?
(And Yes, i am aware of persistant database handlers which live in the
web server space).

Artem Koutchine


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to