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

  • Home
  • SEARCH
  • 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 4024706
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:45:17+00:00 2026-05-20T10:45:17+00:00

I have two concurrent processes: 1.) Writer – inserts new rows into a MySQL

  • 0

I have two concurrent processes:

1.) Writer – inserts new rows into a MySQL database on a regular basis (10-20 rows/sec)

2.) Reader – reads from the same table being inserted into

I notice that the Reader process only seems to see a snapshot of the database at about the time of its startup. Inserts occuring before this startup are found, but inserts occuring after are not. If I shut the Reader process down and restart it (but leave the Writer running), it will sometimes (but not always) see more data, but again seems to get a point-in-time view of the database.

I’m running a commit after each insert (code snippet below). I investigated whether this was a function of change buffering/pooling, but doing a “set @@global.innodb_change_buffering=none;” had no effect. Also, if I go in through MySQL workbench, I can query the most current data being inserted by the Writer. So this seems to be a function of how the Python/MySQL connection is getting set up.

My environment is:

Windows 7

MySQL 5.5.9

Python 2.6.6 — EPD 6.3-1 (32-bit)

MySQL python connector

The insert code is:

    def insert(dbConnection, statement):
    cursor = dbConnection.cursor()
    cursor.execute(statement)   
    warnings = cursor.fetchwarnings()
    if warnings:
        print warnings
        rowid = []
    else:
        rowid = cursor.lastrowid
    cursor.close()
    dbConnection.commit()
    return rowid    

The reader code is:

def select(dbConnection, statement):
cursor = dbConnection.cursor()
cursor.execute(statement)   
warnings = cursor.fetchwarnings()
if warnings:
    print warnings
    values = []
else:
    values = np.asarray(cursor.fetchall())
cursor.close()
return values   
  • 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-05-20T10:45:18+00:00Added an answer on May 20, 2026 at 10:45 am

    What’s the read side look like?

    I bet this is a problem with the isolation level on the read side. Most likely your read connection is getting an implicit transaction and the default InnoDB isolation level is:

    Repeatable Read

    Try issuing:

    cursor.execute("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED")
    

    on the read side.

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

Sidebar

Related Questions

I have two processes that work with data in the same table. One process
I currently have a concurrent queue implementation that uses a BlockingQueue as the data
I have a WCF web service that uses ASP.NET session state. WCF sets a
I need a vector container to be shared between two threads of the same
I have 3 classes of task (I, D, U) which come in on a
There are some other SO questions about concurrency but they don't quite address my
Probably a trivial question, but I want to get the best possible solution. Problem:
I'm about to begin designing the architecture of a personal project that has the
I notify some listeners in a loop. for (Iterator it = listeners.iterator(); it.hasNext();) {
I'm playing around with the GPars library while working to improve the scalability of

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.