Menu

DBPROCESS is dead or not enabled

rmorris
2008-02-07
2013-04-29
  • rmorris

    rmorris - 2008-02-07

    I'm using pymssql as part of a custom plugin for Trac (issue/ticket system -- http://trac.edgewall.org\).  Specifically, the plugin is going to a MSSQL database of users so that it can build a list of possible Trac ticket owners.  Occasionally, I get errors where a Trac ticket page load fails; digging has winnowed the culprits down to the pymssql libs DB connection attempt.

    The error from the log is:

    > File "c:\python25\lib\site-packages\pymssql.py", line 328, in connect
    >   con = _mssql.connect(dbhost, dbuser, dbpasswd)
    > error: DB-Lib error message 10005, severity 1:
    > DBPROCESS is dead or not enabled.

    The code is written such that a single connection is shared among requests, with new cursors created/destroyed for each request.  The problem seems to occur, perhaps not surprisingly, when Apache kills off a child process and starts up a new one.  Is there some command/state in the pymssql lib that I can check before attempting to use the pymssql connection, to detect that it's "dead" and needs to be re-established?  Or am I going completely off in the wrong direction?

    Platform:
    - Windows Server 2003
    - Apache/2.2.4 (Win32)
    - Python 2.5.1
    - pymssql 0.8.0
    - Trac 0.11dev-r6306

     
    • A

      A - 2008-02-08

      I'd recommend against persistent connections, because the problem you're observing right now is typical. They cannot be shared among Apache processes if they aren't specifically written to be shared. And neither I nor the former author, Joon-cheol Park haven't written them that way.

      Just open the connection at the beginning of the script and close it at the end.

       

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.