changeset 612:5a7927691d2c

- Account for exception name change in sqlalchemy 0.5.0 - Added a few needed "import" when dealing with concurrency problems
author lamblinp@ip03.m
date Fri, 16 Jan 2009 19:10:09 -0500
parents e8cb4bde30a7
children 7261e7d6368d
files pylearn/dbdict/sql.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dbdict/sql.py	Fri Jan 16 15:53:47 2009 -0500
+++ b/pylearn/dbdict/sql.py	Fri Jan 16 19:10:09 2009 -0500
@@ -1,5 +1,7 @@
 
-import sys, os, copy
+import sys, os, copy, time
+
+import numpy.random
 
 import sqlalchemy
 from sqlalchemy import create_engine, desc
@@ -102,7 +104,8 @@
                 # no jobs are left
                 keep_trying = False
         except (psycopg2.OperationalError,
-                sqlalchemy.exceptions.ProgrammingError), e:
+                sqlalchemy.exceptions.ProgrammingError,
+                sqlalchemy.exc.DBAPIError), e:
             #either the first() or the commit() raised
             s.rollback() # docs say to do this (or close) after commit raises exception
             if verbose: print 'caught exception', e