D
Daniel Billingsley
Jon Skeet said:If you don't allow any updates to the tables you're looking at while
your set of queries is executing, you should always be able to see
consistent data.
Just to be clear, the Oracle mechanism only ignores, not blocks, those
updates. Therefore, it doesn't allow updates to the effective results, if
that's what you meant.
It's one thing for a delete to fail - it's another
thing to only see *one* delete in a transacted pair, due to having read
one table before another.
The MS concurrency mechanism could handle the example you give because the
post-read lock on the first record of the pair would block the write
transaction.
The issue is limited to changes to records that will/would ultimately be
part of your select results but are changed between the time your select
starts and finishes, not ones that are changed after you've read them. If
you want to block the latter you can.
I still say that, because niether mechanism can deal with an insert that
would have been part of your results but was added *after* your query
finished, meaning you always have to deal with or accept the potential you
just got invalid (yet perhaps consistent with itself) data, and the cases
where you could get stung by the ANSI/MS/IBM approach are fairly limited,
from a pragmatic standpoint it's not as big a deal as it seems at first.