Menu

Pylons Controller Issus When Using PYMSSQL

ModTodd
2009-04-15
2013-04-29
  • ModTodd

    ModTodd - 2009-04-15

    utilizing pymssql-1.0.1

    I have set up a Pylons environment on an Ubuntu server which I am using as my platform for distributing my intraweb applications within my organization.  I have created a python controller in Pylons which acts as the connection conduit between my web applications and my backend SQL 2000 Server.  The python controller is utilizing the python pymssql library in conjunction with FreeTDS to make the connection and requests to the SQL Server. 

    This environment works great as long as I only make a single request against the Pylons controller at a time.  If simultaneous requests are made against the controller (i.e. request 1 is running and has not returned a result yet and a new request is made against the controller) Pylons blows out completely with a single line error pointing to PYMSSQL as the culprit.  I have run some tests and found I am able to make simultaneous calls against different Pylon controller names all which are using FreeTDS/PYMSSQL without an error but as stated above never successfully to the same Pylons controller.

    Further, I set Pylons up on a Windows 2003 server and tried running the same senario and once again PYMSSQL blows out and takes Pylons down with it.  I then switched my database connection module to pyodbc and ran the same senario and had no errors and all queries returned without error (i.e. not a Pylons error or OS error).  I would prefer to utilize the pymssql module due to its better speed performance but can not it keeps blowing out the web service.

    Is this a threading issue with pymssql???

    Thank you for any help and/or insight you may be able to provide me.

     
    • A

      A - 2009-04-15

      pymssql shouldn't have threading issues, as long as you don't share connection objects among different threads. I have never considered or tested such scenario, that's why pymssql has a thread safety value of '1' meaning that you can share the module between threads, but not connection objects.

       

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.