platiumky / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

SQL Server connection (and database connectivity) lost when running multi-threaded app #347

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Turn on multi-threading server (Waitress) over Bottle.
2. Query SQL Server rapidly (as little as 2 connections established in a single 
event)

What is the expected output? What do you see instead?
Pyodbc responds with query is invalid even though there is no error thrown when 
the connection is created.  The only resolution is to restart the server. 

What version of the product are you using? On what operating system?
Pyodbc 3.0.7   RHEL   Python 2.7 with Bottle and Waitress  Sql Server 2012 on 
AWS RDS

Please provide any additional information below.
If I run Bottle single-threaded I get great reliable results.  When I turn the 
multi-threading on then Pyodbc will soon stop responding with data.  It gets 
lost and says the queries are bad.  The only resolution is to restart the 
server.  My application might create more than one connection in a single web 
service call.  These are run serially but happen very fast (sub-second).  This 
breaks something.  I tried to play with pooling and thread safety settings but 
nothing seems to work.

Original issue reported on code.google.com by valbane...@gmail.com on 18 Nov 2013 at 3:48