From: Kevin S. <Kev...@ja...> - 2013-06-19 20:26:14
|
I am trying to develop a python webapp using pysybase that is pretty basic. I want to be able to create SQL QC reports that our users can update on demand as they edit the database. However, I am having problems getting this to work in a multi-threaded environment like cherrypy. If I execute one long query, no new connections can be made, in fact all other threads come to a halt until that one query returns. Is this something that is not supported by this driver? Here is a sample test that I've been using: def sy_query(query): db = Sybase.connect(dbServer,dbUser,dbPass,dbName) cur = db.cursor() cur.execute(query) t1 = Thread(target=sy_query,args=("select * from blah",)) t2 = Thread(target=sy_query,args=("select something from blah2",)) t1.start() t2.start() t1.join() t2.join() As soon as thread 1 calls "status = ct_results(self->cmd, &result);" inside of cmd.c nothing happens in either the main function nor in thread 2. Immediately after that line finishes, everything moves along. Any suggestions? I can't have a webapp that only works for one user at a time. -Kevin The information in this email, including attachments, may be confidential and is intended solely for the addressee(s). If you believe you received this email by mistake, please notify the sender by return email as soon as possible. |