[Zope3-dev] Database Transaction Handling
Phillip J. Eby
pje@telecommunity.com
Fri, 01 Nov 2002 12:15:03 -0500
If I understand correctly, you're trying to hold a transaction across
multiple web "hits". This is neither practical nor possible with
Zope. You could end up holding a transaction open indefinitely.
Transactions should be as short as possible; it would be extremely bad
design to keep a transaction open at a user's discretion, since they could
walk away from the computer and come back later, for example. Even though
PostrgreSQL won't prevent others from reading the data while it's locked by
that transaction, it *will* prevent others from writing that data.
This is a pretty basic design issue for multi-user database applications,
regardless of platform. Even if you're just using MS Access on a network,
it's still a very bad idea to give the user explicit control of
transaction-level locking.
At 05:56 PM 11/1/02 +0100, Axel Missbach wrote:
>There is no way in rolling back the data changes if annother (a following
>one) dtml-document/ function wants to decide to, because zope has already
>commited the changes.
>
>Postgres does not support nested transactions yet(until 7.3), so it is not
>possible to open another transaction.
>
>In other environments the usual way is:(in brackets the zope behavior)
> -start transaction to postgres
> -reading data (opening 1. dtml-document, something like a browser)
> -manipulation data (opening 2. dtml-document, something like a dialogbox).
> -submit the Dialog.
> -the dialog is closed(!!zope send the commit to postgres!!)
> -check the changes(opening 3. dtml-document or python-function) and
> perhaps want to rollback the data changes.(which is no longer possible
> because of zopes earlier comittment)
> -rolling back or commit the transaction.