| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Theoretical Basis for SELECT FOR UPDATE
vc wrote:
> Tony Andrews wrote: >
> > > Is the sequence > > update,select,update; > > legal ? If so, you can 'see' the constraint violation.
No; then the constraint has been changed - and is more complex. You no longer have a zero-sum system unless you account for 'money in transit' that is not in any account. Further, since the money here is added to one account before being debited to the other, there's a negative 'cash in transit' value - 10 currency units more have been deposited than withdrawn.
> Moreover, I bet that 'update,update; ' has to use the same mechanism > behinds the scenes, namely deferrable constraints (what else ?), in > order to be possible.
No; the sequence is defined as 'do all the operations; check all the constraints'.
> All in all, the comma separated statements do not appear to bring much > new to the table in comparison to the commit-delimited old style > transactions except for perhaps more concise notation.
They leave you with the option of having complex constraints that are not violated at any point. The alternative leaves you with a complex constraint that is violated at the intermediate point.
>
> > > I read the book, but did not find a substantial difference between the > old style transaction and the new multi-statement one (see above).
TTM currently supports both multiple-assignment and transactions. The main difference is precisely in the area of which constraints can be seen to be enforced. The constraint in the case with SELECT is more complex than the constraint in the case without.
-- Jonathan Leffler #include <disclaimer.h> Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/Received on Mon Oct 03 2005 - 22:20:02 CDT
![]() |
![]() |