I am building a desktop application with back-end in MySQL. Does Mysql Support No Lock or some thing equivalent to this as in sql?
Select * from Tablename (NoLock);
Suppose I am fetching data from multiple tables using join, Then do i Need to implement this code while selecting rows from each and every table?
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
SELECT * FROM 'Table1'
iNNERjOIN TABLE2 ON TABLE2.FK=TABLE1.PK ;
COMMIT ;
The WITH (NOLOCK) table hint is used to override the default transaction isolation level of the table or the tables within the view in a specific query, by allowing the user to retrieve the data without being affected by the locks, on the requested data, due to another process that is changing it.
MySQL uses table locking (instead of row locking or column locking) on all table types, except InnoDB and BDB tables, to achieve a very high lock speed.
The most common reason implicit locks are created is an INSERT operation: successfully inserted rows are not visible to other transactions until the inserting transaction commits, and it is a common situation that a single transaction inserts many rows, so it is cheaper to not create explicit locks for newly inserted ...
try this
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
SELECT * FROM Tablename ;
COMMIT ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With