MySQL Forums
Forum List  »  Connector/Python

Re: refresh connection using MySQLdb
Posted by: Fred Mark
Date: February 07, 2007 08:36AM

I have the same problem. I have a client application that uses a mysql database. When the application starts it opens the connection once and closes it when the application quits. When I insert stuff into the database from my application I see it updated but when another program inserts things into the database I need to reopen the application (the connection) to see the new items in the database.

So is this normal behavior? Before fetching information from a database we have to open a connection each time?

Update :
I've just figured out what the problem was. If I commit the connection (conn.commit()) and redo the query with my cursor object (without creating a new one) it gets the new rows from the database.



Edited 1 time(s). Last edit at 02/07/2007 08:49AM by Fred Mark.

Options: ReplyQuote


Subject
Written By
Posted
January 08, 2007 05:51PM
Re: refresh connection using MySQLdb
February 07, 2007 08:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.