Locking Syntax : Lock « Transaction « SQL / MySQL

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » Transaction » Lock 
Locking Syntax
      

To reserve tables for exclusive use, execute the command LOCK TABLE[S]:

LOCK TABLE table1 locktype, table2 locktype ...


READ:                      All MySQL users are allowed to read the table, 
                           but no one may make any changes(including the user who executed the LOCK command)
                           A READ LOCK is granted only when the table is not blocked by any WRITE LOCKs.
              
READ LOCAL                 Like READ, but INSERT commands are allowed if they don't alter any existing data records.

WRITE                      The current user is permitted to read and change the table. 
                           All other users are completely blocked.
             
LOW PRIORITY WRITE         During the waiting time, other users receive as the need arises a new READ LOCK. 
                           However, this can increase the waiting time until the granting of a WRITE LOCK.

   
    
    
    
    
    
  
Related examples in the same category
1.Get lock
2.Is lock free
3.Is used lock
4.Release lock
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.