Page 1 of 1

MySQL Read Exclusive access?

Posted: Sat Dec 20, 2003 10:04 pm
by horrighs
Can i select a batch of records for Read Exclusive in PHP to MySQL? I have a large DB, 2 million records, that i end up having 10 or so php process performing caluculations on the data.

this data needs to be processed only once but i need a way so that i can read say 100 records at a time, perform the calcs and write the records back without worrying about another process grabing the same records.

Right now i am, since i have so many records, randomly picking start points. This of course is not perfect, what i really need is a "read exclusive" command or something.

Steve
PeopleHost.com

Posted: Wed Dec 24, 2003 1:29 am
by volka
http://www.mysql.com/doc/en/LOCK_TABLES.html might be what youÄre looking for

Posted: Wed Dec 24, 2003 6:52 am
by aquila125
use transactions. .that's why they are invented