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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:29:09+00:00 2026-05-31T11:29:09+00:00

>>> _cursor.execute(select * from bitter.test where id > 34) 1L >>> _cursor.fetchall() ({‘priority’: 1L,

  • 0

    >>> _cursor.execute("select * from bitter.test where id > 34")
    1L
    >>> _cursor.fetchall()
    ({'priority': 1L, 'default': 0, 'id': 35L, 'name': 'chinanet'},)
    >>> _cursor.execute("select * from bitter.test where id > 34")
    1L
    >>> _cursor.fetchall()
    ({'priority': 1L, 'default': 0, 'id': 35L, 'name': 'chinanet'},)
    >>> 

the first time, i run cursor.execute and cursor.fetchall, i got the right result.

before the second time i run execute and fetchall

i insert data into mysql which id id 36, i also run commit command in mysql

but cursor.execute/fetchall counld only get the data before without new data

  • 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-31T11:29:11+00:00Added an answer on May 31, 2026 at 11:29 am

    I guess you’re using InnoDB. This is default for an InnoDB transaction.

    REPEATABLE READ

    This is the default isolation level for InnoDB. For consistent reads,
    there is an important difference from the READ COMMITTED isolation
    level: All consistent reads within the same transaction read the
    snapshot established by the first read. This convention means that if
    you issue several plain (nonlocking) SELECT statements within the same
    transaction, these SELECT statements are consistent also with respect
    to each other. See Section 13.2.8.2, “Consistent Nonlocking Reads”.

    I haven’t tested yet but forcing MySQLdb to start a new transaction by issuing a commit() on the current connection or create a new connection might solve the issue.

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

Sidebar

Related Questions

I have the cursor with the query statement as follows: cursor.execute(select rowid from components
cursor.execute(SELECT user_id FROM myapp_location WHERE\ GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < %s\ ,(user_utm_easting, user_utm_northing, 500)); This
conn = MySQLdb.connect(host=IP,user='john',passwd='ab2nng',db='mydb') cursor = conn.cursor() #this works. cursor.execute(select * from crawl_log) res =
In (say) Python, I can issue: psycopg2.connect(...).cursor().execute(select * from account where id='00100000006ONCrAAO') which on
The following works: >>> cursor.execute(select * from sqlitetable where rowid in (2,3);) The following
When I do someting like sqlite.cursor.execute(SELECT * FROM foo) result = sqlite.cursor.fetchone() I think
I can't show the data from database sqlite in python. connection = sqlite3.connect('db') connection.cursor().execute('CREATE
When I execute my python script from the command line I have no problems
I'm using cx_Oracle to select rows from one database and then insert those rows
When specifying a parameter to execute() in psycopg2 in Python, like this: cursor.execute('SELECT *

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.