I want to synchronise read and write access to a MySQL database in a
cluster. Advisory locking would be fine, but I want to lock out writes
during reads while still being able to do multiple reads at the same time.
I can't see how to do this with GET_LOCK, and table locks have annoying
side effects; in particular, all tables that are not locked after
issueing a table lock, are inaccessible. Even more worrying, this is a
per alias-constraint, so that you have to know what (and especially how
many) aliases you will need at any time during the locking at the point
where you lock the tables.
Currently I'm inclined to think that the easiest way around this is to
employ a locking manager independent to MySQL - though it seems rather
silly that you can't do these things within it.
Did I overlook something?
|• advisory locking with shared/exclusive locking sematics||Jens Theisen||19 Dec|