سؤال

I was always wondering if MySQL queries are synchronized - or whatever you call it. For example:

You read a value using SELECT, then you modify it in your code (let's say, PHP on a webserver) and then you UPDATE the table entry. If two processes do this simultaneously, there will obviously be problems.

How is this prevented?

هل كانت مفيدة؟

المحلول

You should read about transaction isolation levels and locks. This is the related link for mysql: http://dev.mysql.com/doc/refman/5.0/en/innodb-transaction-model.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top