Hi!

>>>>> "Lopez" == Lopez David <E-r9374c <[EMAIL PROTECTED]>> writes:

Lopez> AntiSpam - mysql, sql, query
Lopez> Version: 3.23.49a, MyISAM, NT, Solaris

Lopez> My app is 150 daemons writing logs to mysql. The main 
Lopez> table is of fixed size but depends on four other tables
Lopez> for foreign keys (hash tables). These tables are uploaded
Lopez> once to the daemon at start-up. Occasionally, a new entry 
Lopez> must be written into these hash tables. The procedure is
Lopez> to lock the table, insert entry, get the key (auto-increment
Lopez> field) and release the lock.

A better solution is to use LAST_INSERT_ID() and not use any locks at all.

Lopez> But what if the connection dies during the update process.
Lopez> If this happens, how can I tell which connection id has the 
Lopez> lock so I can kill it? 

If a connection dies, the server will automaticly delete all temporary
tables and all table locks.

Regards,
Monty

-- 
For technical support contracts, goto https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Michael Widenius <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, CTO
/_/  /_/\_, /___/\___\_\___/   Helsinki, Finland
       <___/   www.mysql.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to