NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL concurrency 101

Tim Gales tgales at tgaconnect.com
Thu Dec 11 12:44:29 EST 2003


David Sklar writes:
"...Include a "last_update" column in the table. This can be a 
 timestamp or just a monotonically increasing integer that 
 changes with each update..."

As a footnote if you go the timestamp route:

"When MySQL is running in MAXDB mode, TIMESTAMP behaves like DATETIME. No
automatic updating of TIMESTAMP columns occurs, as described in the
following paragraphs. MySQL can be run in MAXDB mode as of version 4.1.1.
See section 4.1.1 mysqld Command-line Options."
http://www.mysql.com/doc/en/DATETIME.html

also you might try searching on 
optimistic concurrent lock(ing)
or 'dirty reads' for more background info.
here's something that might be of value:
http://www.mysql.com/documentation/maxdb/65/dd6525ed951542936005e01e2b489e
/content.htm

The optimistic lock, like the name implies,
figures the record in question is probably not
being accessed -- then at the last moment
makes sure somehow that the data hasn't 
been altered.

HTH

T. Gales & Associates
'Helping People Connect with Technology'

http://www.tgaconnect.com





More information about the talk mailing list