Re: computational model of transactions



Brian Selzer wrote:

A compiler can tell the difference between x = 10 and x = x + 5, why can't a
dbms?

A fair question.

It seems to me easy enough to tell if an UPDATE statement references
any attributes on the right side of the equals sign.


The system should be able to detect whether or not the new value depends on
the previous value. The first UPDATE statement above does not, the second
does.

As an aside, it is not really necessary that the system detect this: but the
developer must, because in a concurrent environment the difference in the
semantics of replacement and modification has ramifications that can affect
the appropriate choice of transaction isolation level.

While we're talking manipulations: what about
INSERT and DELETE? Are there variants of
those, too? Are those supposed to be handled
differently in transaction context?


I haven't given this much attention, but at first glance, no, I don't think
so.

How about

INSERT into Table (a) values (1) where not exists (select * from Table
where a = 1);

in two separate concurrent transactions?


Marshall

.



Relevant Pages

  • Re: computational model of transactions
    ... It seems to me easy enough to tell if an UPDATE statement references ... any attributes on the right side of the equals sign. ... the appropriate choice of transaction isolation level. ... in two separate concurrent transactions? ...
    (comp.databases.theory)
  • Re: computational model of transactions
    ... It seems to me easy enough to tell if an UPDATE statement references ... the appropriate choice of transaction isolation level. ... transactions to obtain a shared lock, but not the exclusive lock required to ...
    (comp.databases.theory)
  • Re: column update order
    ... Robert Klemme wrote: ... The default transaction isolation level does not enforce that SELECTs, ... consistency but about column values referenced in an UPDATE statement. ... indicated that Oracle ensures read consistency within a transaction - ...
    (comp.databases.oracle.misc)
  • Re: deadlocks between single update statements ?
    ... Assume a transaction A with a single update statement updating many ... Assume another transaction B also with a single update, ... But how do I impose an order in an update statement? ...
    (comp.databases.oracle.server)
  • RE: Search results
    ... it's giving the following error message same as I mentioned earlier: ... The UPDATE statement conflicted with the REFERENCE constraint ... If I am using Begin Transaction then why it's conflicting ... WHERE sampleID = 'bbb01' ...
    (microsoft.public.dotnet.framework.adonet)