You are here: Articles > Computers & Technology > sql

 See more articles about "sql "

Tutorial Addendum on SQL - Transaction Administration



 31 December 18:00   

    



    



    

MySQL Transaction Abreast Akin Analysis - Apprehend Committed

    



    

My next analysis is about "read committed". Again, I started "session 1" in the first

    

command window:

    

 

    

mysqlinmysql test

    

mysql> Baddest Affair 1 ;

    

+-----------+

    

| Affair 1 |

    

+-----------+

    

mysql> Bead TABLE IF EXISTS User;

    

mysql> Make TABLE User (ID INT PRIMARY KEY, Name CHAR(8))

    

ENGINE=InnoDB;

    

mysql> Admit INTO User Ethics (2, bill );

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 21:11:51 |

    

+----------------+

    

mysql> -- abide with affair 2

    

mysql> Amend User SET Name= bob Area ID=2;

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 21:16:57 |

    

+----------------+

    

mysql> -- abide with affair 2

    



    



    

In the additional command window, I acclimated a "read committed" transaction:

    

 

    

mysqlinmysql test

    

mysql> Baddest Affair 2 ;

    

+-----------+

    

| Affair 2 |

    

+-----------+

    

mysql> SET TRANSACTION Abreast Akin Apprehend COMMITTED;

    

mysql> Alpha TRANSACTION;

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 21:13:51 |

    

+----------------+

    

mysql> Baddest * FROM User Area ID=2;

    

+----+------+

    

| 2 | bill |

    

+----+------+

    

mysql> -- abide with affair 1

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 21:19:25 |

    

+----------------+

    

mysql> Baddest * FROM User Area ID=2;

    

+----+------+

    

| 2 | bob |

    

+----+------+

    



    



    

The aftereffect acutely shows that "non-repeatable read" could absolutely appear in a transaction

    

with "read committed" abreast level.

    



    

MySQL Transaction Abreast Akin Analysis - Repeatable Read

    



    

My next analysis is about "repeatable read". Again, I started "session 1" in the first

    

command window:

    

 

    

mysqlinmysql test

    

mysql> Baddest Affair 1 ;

    

+-----------+

    

| Affair 1 |

    

+-----------+

    

mysql> Bead TABLE IF EXISTS User;

    

mysql> Make TABLE User (ID INT PRIMARY KEY, Name CHAR(8))

    

ENGINE=InnoDB;

    

mysql> Admit INTO User Ethics (2, bill );

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 22:10:47 |

    

+----------------+

    

mysql> -- abide with affair 2

    

mysql> Amend User SET Name= bob Area ID= 2 ;

    

mysql> Admit INTO User Ethics (3, jack );

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 22:16:36 |

    

+----------------+

    

mysql> -- abide with affair 2

    



    



    

In the additional command window,

    

 

    

mysqlinmysql test

    

mysql> Baddest Affair 2 ;

    

+-----------+

    

| Affair 2 |

    

+-----------+

    

mysql> SET TRANSACTION Abreast Akin REPEATABLE READ;

    

mysql> Alpha TRANSACTION;

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 22:13:23 |

    

+----------------+

    

mysql> Baddest * FROM User Area ID>=2;

    

+----+------+

    

| 2 | bill |

    

+----+------+

    

mysql> -- abide with affair 1

    

mysql> Baddest CURRENT_TIME();

    

+----------------+

    

| 22:19:54 |

    

+----------------+

    

mysql> Baddest * FROM User Area ID>=2;

    

+----+------+

    

| 2 | bill |

    

+----+------+

    



    



    

The aftereffect acutely shows that "repeatable read" abreast akin absolutely guaranties

    

repeatable read. But the aftereffect bootless to appearance the apparition phenomenon. Any physique knows

    

how to make a apparition phenomenon?

    



    



 


 mysql, select, session, transaction, current, level, isolation, repeatable, table, mysqlinmysql, testmysql, command, committed, window, result, insert, create, values, , mysql select, current time, select current, mysql continue, isolation level, transaction isolation, user where, testmysql select, read committed, command window, repeatable read, mysqlinmysql testmysql, select session, mysql insert, window mysqlinmysql, insert into, user values, select current time, mysql continue with, mysql select current, testmysql select session, mysqlinmysql testmysql select, transaction isolation level, mysql insert into, window mysqlinmysql testmysql, insert into user, command window mysqlinmysql, 2mysql update user, second command window, session 2mysql update, session 1mysql select, result clearly shows, clearly shows that, 1mysql select current, transaction mysql select, start transaction mysql, mysql start transaction, innodb mysql insert, exists user mysql, mysql drop table, isolation level test, mysql transaction isolation, user mysql create, mysql create table, sql transaction management, engine innodb mysql, key name char, create table user, bill mysql select,

Share Tutorial Addendum on SQL - Transaction Administration:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...