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 8546553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:03:17+00:00 2026-06-11T13:03:17+00:00

I understand the examples given for dirty reads and phantom reads on the wikipedia

  • 0

I understand the examples given for “dirty reads” and “phantom reads” on the wikipedia page for isolation levels. However I’m not sure how to categorise the following situation and what isolation level or different strategy to apply in order to avoid this situation.

  1. Transaction 1: Inserts row in table A
  2. Transaction 2: Selects row in table A
  3. Transaction 2: Selects row in table B based on something in the previous read
  4. Transaction 2: Commit
  5. Transaction 1: Inserts row in table B
  6. Transaction 1: Commit

The problem is that Transaction 2 selects something in B before T1 finished writing in both tables. The select in step 3 might need to select the row inserted in 5 to be correct. Is this a dirty read, phantom read or neither. Would a READ_COMMITTED isolation level be enough to avoid problems? As I understand it, with READ_COMMITTED T2 should not read the new row inserted by T1 at that point.

  • 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-11T13:03:18+00:00Added an answer on June 11, 2026 at 1:03 pm

    This is a dirty read. In READ_COMMITTED isolation level the query in step 2 will not return the row you have inserted in step 1 but haven’t committed yet, thus preventing the unsuccessful attempt to access data that hasn’t been inserted yet.

    A phantom read would mean that you are executing the same query twice inside Transaction 2 and getting a different set of results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've had my brain wrinkled from trying to understand the examples on this page:
I'm reading Dive into Python, especially trying to understand the examples, and I had
Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']
I found a couple examples online but I don't quite understand how it works.
I am trying to understand TDD more and all the examples I have seen
I'm struggling to understand how to combine the TimePicker http://trentrichardson.com/examples/timepicker/ solution to my existing
I am trying to understand how to use reference parameters. There are several examples
I've seen some examples, but trying to better understand how Resource files work, such
I think I understand strong typing , but every time I look for examples
In Sipser's book of Theory of computation, following is given : a numerical constant

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.