nconway, I don't see why people try to
solve
races like the
Doctors problem through transactions and isolation levels. Row level locking
in
InnoDB prevents the race regardless of the isolation level in use.

BEGIN;
SELECT COUNT(*) INTO @n FROM Duties WHERE Shift=@s AND Status='on
duty'
FOR UPDATE;
if @n > 1 then
UPDATE Duties SET Status='reserve' WHERE DoctorId=@d AND Shift=@s;
COMMIT;
else
ROLLBACK;

If you're not familiar with InnoDB, the SELECT establishes a critical
section
covering the on duty doctors. This same sequence executing concurrently will
block until the connection with the lock has checked the count. The COMMIT
(or ROLLBACK) will unblock the other connection waiting for the lock. In case
the first connection committed an UPDATE which reduced the count to 1, the
second connection, when unblocked, will see the new count of 1 and not
make any update.

For I wrote a book, you see, .... It was about how, if you
sack too many people, or you underpay and impoverish too
many people, there aren't enough customers left to sell
things to, and the economy goes to hell. I wrote it in 1998
and nobody attacked any one of the arguments. They tiptoed
away from the argument. They were above such things.

And lo, it has come to pass. Americans too impoverished to
buy houses had stopped making their payments, and cash their
creditors owed to lending entities further up the money
chain could not be paid either, and like bird flu the
illness swept across the planet, and here we are. And I was
right; and Michael Costa and Peter Costello and all the
neocons and Friedmanites and Tim Blair were wrong. And we
are now in big trouble.

...

Decide how long Alan Greenspan should spend in gaol. For
he nearly wrecked the world, in my view, with his one
percent interest rates and house loans to fools as dumb as
Barney in The Simpsons, ... Decide how long George Bush
should spend in gaol for squandering a trillion dollars
(thus far) on two needless unending wars and another
trillion thus far bailing out his upperclass coke-sniffing
accomplices who like him couldn't add.

And, boy, they really couldn't add. They thought the dollar
could be floated for instance, and China's command economy
with its fixed undervalued currency and low house prices was
doomed to fail. They thought they'd won the Cold War against
such barbarities, and socialist command economies didn't
work. And they borrowed money from China, trillions of
dollars from China, to prove their system worked better.
China, which quietly won the Cold War by lending it to them,
if you care to add up the figures.

bradfitz: What was scarier
than the text of
the article - let's face it, we have known for years the man
is a moron - was the photo accompanying it. A pile of
sycophants, clutching their cameras for a chance to
photograph the most potent symbol of their country's failure
in every sphere. Not what he's earned: A lynch mob.

trs80: Yep, swapping controller boards can
work. I did it successfully last year to a Samsung 80GB that
failed. Of course, I then had two working chassis and only
one working controller, so I should have been able to
organise a warranty replacement (which never happened for
various reasons). It was obviously a dead controller: one of
the ASICs had a matchhead sized explosive divot in it.