Quote:
Originally Posted by sturdevk
Thanks, Dismounted, I have another related question, when a user is trying to delete his post, I noticed that forumcache string and usergroupcache string both get saved to datastore table.
95 Query REPLACE INTO datastore
(title, data, unserialize)
VALUES
('usergroupcache', 'a:10:.................)
95 Query REPLACE INTO datastore
(title, data, unserialize)
VALUES
('forumcache', 'a:17:{.................)
then how can we deal with two users deleting their posts at the same time. it maybe a concurrent issue, is it?
Thanks,
|
The tables are locked when begin written to. All other threads asking to write data to the table would have to wait on the thread currently updating the table. Basically a thread locks the table, writes to the table, then un-locks the table. Only one thread may update a table at a time (it has exclusive access).
In short that should never happen unless there was some odd bugs in MySQL.
Edit: Also just to add a tid-bit; no two requests will ever come in at exactly the same time. Without going into details I'll just say that networks (including the internet of course) just work that way. Sure two requests may come in within microseconds of each other but one will always be processed before the other.