How to test MySql READ UNCOMMITTED usage for nolock

I'm using the following query:

SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
SELECT * FROM TABLE_NAME ;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ ;

The table has lots of write operations and heavy read operations. To get a minimum effect from the read operations I wanted to use nonlocking read operations. In MySql it is done with "READ UNCOMMITTED" (according to what I read).

How to test whether this code is actually working?

Answers


first connection :

 MariaDB [(none)]> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> INSERT INTO t2 VALUES(1),(3);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> use test
Database changed
MariaDB [test]> INSERT INTO t2 VALUES(1),(3);
Query OK, 2 rows affected (0.02 sec)
Records: 2  Duplicates: 0  Warnings: 0

no commit this TRANSACTION

second connection

MariaDB [test]> SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> SELECT * FROM t2;
+------+
| i    |
+------+
|    1 |
|    3 |
+------+
2 rows in set (0.00 sec)

MariaDB [test]> COMMIT ;

 MariaDB [test]> select * from t2;
Empty set (0.00 sec)

Need Your Help

Serve JSF from database

database jsf jsf-2

is it possible to load jsf 2 page from database, not from xhtml file?

way to programatically determine whether an Android device has a menu button?

android tablet

I need to compensate for the lack of a physical (or even a "soft") menu button on Android 3 tablets. The app I'm working on generally hides the title bar for its activities, but I can't do that if I