Skip to content

Commit

Permalink
Bug 759038 - only check for invalidated connections on DBAPIError obj…
Browse files Browse the repository at this point in the history
…ects; r=telliott
  • Loading branch information
rfk committed Jun 4, 2012
1 parent d0360c2 commit 2eeb343
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions syncstorage/storage/sql.py
Expand Up @@ -24,7 +24,8 @@
import traceback

from sqlalchemy import create_engine
from sqlalchemy.exc import OperationalError, TimeoutError, IntegrityError
from sqlalchemy.exc import (DBAPIError, OperationalError,
TimeoutError, IntegrityError)
from sqlalchemy.sql import (text as sqltext, select, bindparam, insert, update,
delete, and_)

Expand Down Expand Up @@ -162,7 +163,7 @@ def _safe_execute(self, *args, **kwds):
# suffices to retry the query a single time.
try:
return self._engine.execute(*args, **kwds)
except (OperationalError, TimeoutError), exc:
except DBAPIError, exc:
if exc.connection_invalidated:
return self._engine.execute(*args, **kwds)
else:
Expand Down

0 comments on commit 2eeb343

Please sign in to comment.