Contact: fumanchu@aminus.org

Log in as guest/geniusql to create tickets

Changeset 195

Show
Ignore:
Timestamp:
10/12/07 19:15:12
Author:
fumanchu
Message:

Trapped another libpq.DatabaseError?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/geniusql/objects.py

    r194 r195  
    899899        self.connections.lock("Transaction denied due to DDL: %r" % sql) 
    900900        try: 
    901 ##            # Must shut down all connections to avoid 
    902 ##            # "being accessed by other users" error? 
    903 ##            self.connections.shutdown() 
    904901            if conn is None: 
    905902                # Important: use _factory(), not get(), to avoid the lock 
  • trunk/geniusql/providers/pypgsql.py

    r194 r195  
    2828            return libpq.PQconnectdb(connstr) 
    2929        except libpq.DatabaseError, x: 
    30             if (x.args[0].startswith('could not connect') or 
    31                 x.args[0].startswith('timeout expired')): 
    32                     raise errors.OutOfConnectionsError() 
     30            msg = x.args[0] 
     31            if (msg.startswith('could not connect') or 
     32                msg.startswith('server closed the connection unexpectedly') or 
     33                msg.startswith('timeout expired') 
     34                ): 
     35                    raise errors.OutOfConnectionsError(*x.args) 
    3336            raise 
    3437