» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-16-2006, 05:49 AM
Bailee Bailee is offline
Junior Member
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Bailee is on a distinguished road
Default Lock Tables??

Hi All,
There is a process that open a single connection and insert into several tables, found in several databases. The tables are all MyIsam and the databases are owned by a single MYSQL instance. The process implements a sort of hot backup of the tables in a database while inserting into the other tables.
It does this by:
- issuing LOCK TABLES on all interested tables
- FLUSH TABLE
- copy the tables
- UNLOCK TABLES

After locking the first table, any other insert fails with the message:
"Table 'xxx' was not locked with LOCK TABLES".
Clearly, 'xxx' is not locked because it does not have to.

Thanks! -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-16-2006, 05:54 AM
sierra sierra is offline
Senior Member
 
Join Date: Jul 2006
Posts: 220
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 16
sierra is on a distinguished road
Default

MySQL locking is independent from the storage engine. It is deadlock free as we lock all tables that we plan to work with in a single lock statement. Only the locked tables can be used until the lock is released.
MySQL knows, which tables will be used throughout the command and locks all in a single go. At the end of the command the lock is released. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MERGE tables issue! Tyamini MySQL Forums 1 02-09-2007 06:36 AM
deleting 2 tables??? Bkira MySQL Forums 1 01-23-2007 08:21 AM
lock creation issue. emmitt MySQL Forums 1 12-06-2006 03:43 AM
full text search in multiple tables phil MySQL Forums 1 08-08-2006 01:05 PM
Getting all rows from two tables cyberhost MySQL Forums 1 07-29-2006 02:17 PM


All times are GMT. The time now is 08:51 PM.