Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

MySQLdb works unnormal #102

Open
jacky098123 opened this Issue · 2 comments

2 participants

@jacky098123

I use webpy as a web server, and it handle user request and do some mysql database operation. I create a class to process business and use my own MySQLdb wrapper, and it create a database connection as a long connection.

at the beginning, the class works fine, after several times, it can not SELECT data from database, and I am sure the database works fine. the no any errors and no any warns.

please give me suggestions. Is it a defeat of webpy or MySQLdb ?

@anandology
Collaborator
@jacky098123

My class of MySQLdb wrapper works fine in other places. It is much convenient than the web.db. I can attach my wrapper if possible, I just don't know how.

I can solve this problem in this way, for each request, I create a business instance, and destroy it after the business finished. the connection problem is solved just like you mentioned.
But the problem is performance, My business class instance contain much content, it becomes much slower.

I think this problem has nothing to do with muti-threading, webpy server is running with one process and one thread.

And webpy rewrite my sys.stdout and sys.stderr, it becomes difficult when I trace the problem.

Now, I am add logging in MySQLdb, hope to solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.