Menu

Internal cache?

Help
devicenull
2007-10-08
2012-09-19
  • devicenull

    devicenull - 2007-10-08

    Does MySQLdb use any type of internal caching? I'm having a weird problem where if I change rows in the database, I don't see the newly inserted rows within python.

    I use something similar to this..

    c = sql.cursor()
    c.execute("SELECT * from A")
    rows = c.fetchall()
    for cur in rows:
    print cur[0]
    c.close()

     
    • Kyle VanderBeek

      Kyle VanderBeek - 2007-10-13

      FYI, auto-commit is off by default in MySQLdb (and all other python DB libs that follow PEP 249). If you want auto-commit, specify it at connect() time.

       
    • Skip Montanaro

      Skip Montanaro - 2007-10-08

      Are you maybe forgetting to commit a transaction when inserting rows?

      Skip

       
      • devicenull

        devicenull - 2007-10-08

        I don't use transactions..

        The rows were inserted from a PHP site. They appear in PHP, and if I use the normal mysql commandline client.

        If I had an open transaction, I would assume they wouldn't appear to the mysql client.

         
        • devicenull

          devicenull - 2007-10-09

          Committing the transaction fixed it anyway :/

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.