| Mailing List | | Home | | MySQL General - General MySQL discussion | | MaxDB - Everything about MaxDB, formerly known as SAP DB | | MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP | | Java Help - Mostly related to the MySQL Connector/J driver | | ODBC - ODBC with the MySQL Connector/ODBC driver | | Perl - Perl support for MySQL with DBI and DBD::mysql | | MySQL++ - Programming with the C++ API to MySQL |
|
|
  | |  | Multiple locks | Multiple locks 2004-06-07 - By Issac Goldstand
Back I need to do some operations which insert mass amounts of records which then
must be sorted, and would like to use table locking.
The flow I 'm looking for is:
LOCK TABLE A WRITE LOW_PRIO
DELETE FROM TABLE A (This used to be TRUNCATE TABLE A, but that complained
when I started locking)
LOAD DATA INFILE ... REPLACE INTO TABLE A
LOCK TABLE B WRITE
*while* SELECT FROM TABLE A
*process data and then* REPLACE INTO TABLE B
DELETE FROM TABLE A (Also, used to be truncate)
UNLOCK TABLES
I don 't seem to be able to lock a and then b later.
I don 't want to lock B from the start, because the LOAD DATA might take a
while.
I don 't want to unlock and relock A, because other scripts may modify the
data...
Any suggestions, pointers, RTFMs? (I looked at 14.4.5 and links from there
already)
Thanks!
Issac
--
MySQL General Mailing List
For list archives:
http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=mysql
@(protected)
|
|
 |