Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7878397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:38:51+00:00 2026-06-03T03:38:51+00:00

I tried this with MySQL Server 5.5: 1) ensured that transaction isolation level is

  • 0

I tried this with MySQL Server 5.5:

1) ensured that transaction isolation level is repeatable_read

2) started shell-1, started a transaction in it, then read a value through select

3) started shell-2, started a transaction in it, then read the same value through select

4) in shell-1, updated the value to value + 1 and committed

5) in shell-2, updated the value to value + 1 and committed

The value lost one of its updates and was incremented only by 1.

Now, as I understand it, RR uses shared read locks and exclusive write locks, which means that in #4 and #5 above, the transactions should have dead-locked, but that did not happen.

So either my understanding of RR is faulty, or MySQL implements RR in a different manner. So what is it?

EDIT: through a similar experiment, also confirmed that an RR transaction (t1) does not see rows inserted into the same table by another RR transaction (t2), if it does another select on that table even after t2 has committed and before t1 committing. (Here’s the link to this experiment: http://www.databasejournal.com/features/mysql/article.php/3393161/MySQL-Transactions-Part-II—Transaction-Isolation-Levels.htm)

Does it mean that MySQL’s RR takes care of phantom reads also?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:38:52+00:00Added an answer on June 3, 2026 at 3:38 am

    MySQL does not conform to Repeatable Read really. You can force it to do by using isolation level serializable or by putting an FOR UPDATE after your selects (look at the example below). Then the desired behaviour will be achieved.
    Regarding phantom reads, MySQL is actually stricter than necessary…

    SELECT value FROM table WHERE id = 7 FOR UPDATE;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried this query on MySQL server (5.1.41)... SELECT max(volume), dateofclose, symbol, volume, close,
I'm inserting multiple rows in a table, and I get this message: MySQL server
I tried to start the newly installed MySQL server (V 5.5.15 on Windows Vista)
I have this MySQL table: video (id int, name varchar(30), view_count int) I tried
I need to have two databases placed on the same mysql server synchronised. This
I tried writing this small trigger in MySQL, CREATE TRIGGER `leg` BEFORE INSERT ON
I need to make MySQL server to rollback transaction immediately after its client disconnected,
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I tried this example in Perl. Can someone explain why is it true? if
I tried this code to open a file in Python: f = open("/Desktop/temp/myfile.txt","file1") It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.