Name: Toby Thain
Member since: 2002-01-24 11:10:04
Last Login: 2012-02-26 19:30:27
More info at www.ghostscript.com
A modest wish: that our doings and dealings may be of a little more significance to life than a man's dinner-jacket is to his digestion. Yet not a little of what we describe as our achievement is, in fact, no more than a garment in which, on festive occasions, we seek to hide our nakedness.
Dag Hammarskjöld, Markings, translated by W.H. Auden and Leif Sjöberg
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.
@ marnanel: Sounds like you are best finding another country.
Come to Canada, at least we respect and are knowledgeable about other countries and cultures. The condescension of your child's teacher and your bank is not worth tolerating.
haruspex certified others as follows:
Others have certified haruspex as follows:
[ Certification disabled because you're not logged in. ]
Keep up with the latest Advogato features by reading the Advogato status blog.