Hi all,
I am getting a very strange error with TurboGears 1.0 and SQLAlchemy
(0.5.0beta1). I have ORMs written in SQLAlchemy that I can run from
the command line (or through IDLE), but when I try to run the same
ORMs using input from TurboGears, I get the following traceback error:
---------------------------------------------------------------------------------------------------------------------------
File "C:\workarea\python\ObjectORMs\dataORM.py", line 53, in __init__
self.session=createSession()
File "C:\workarea\python\ObjectORMs\dataORM.py", line 26, in
createSession
autoload=True)
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\schema.py", line 113, in __call__
return type.__call__(self, name, metadata, *args, **kwargs)
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\schema.py", line 236, in __init__
_bind_or_error(metadata).reflecttable(self,
include_columns=include_columns)
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\engine\base.py", line 1275, in reflecttable
conn = self.contextual_connect()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\engine\base.py", line 1243, in contextual_connect
return self.Connection(self, self.pool.connect(),
close_with_result=close_with_result, **kwargs)
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 165, in connect
return _ConnectionFairy(self).checkout()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 323, in __init__
rec = self._connection_record = pool.get()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 180, in get
return self.do_get()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 615, in do_get
con = self.create_connection()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 145, in create_connection
return _ConnectionRecord(self)
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 217, in __init__
self.connection = self.__connect()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\pool.py", line 280, in __connect
connection = self.__pool._creator()
File "C:\Python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg
\sqlalchemy\engine\strategies.py", line 80, in connect
raise exc.DBAPIError.instance(None, None, e)
InterfaceError: (InterfaceError) None None
---------------------------------------------------------------------------------------------------------------------------
The session cannot be created for some strange reason; inserting print
statements into the ORM, I find that the engine, metadata, and
metadata.bind lines are executed correctly, but the Table() definition
breaks the code. The ORM is written as follows:
---------------------------------------------------------------------------------------------------------------------------
def createSession():
engine=create_engine('mssql://user:pas...@db/table',echo=False)
metadata = MetaData()
metadata.bind=engine
dataTable= Table('price', metadata,
Column
('PRICE_ID',Integer,primary_key=True),
autoload=True)
try:
object_mapper(DataObject(0)).dispose()
mapper(DataObject, dataTable)
except:
# except exc.UnmappedInstanceError:
mapper(DataObject, dataTable)
Session = sessionmaker(bind=engine, autoflush=True,
autocommit=True)
session = Session()
return session
---------------------------------------------------------------------------------------------------------------------------
Also, the same models which fail on my computer/IP can be successfully
run on my colleagues' computers. Googling this error doesn't yield
too much in the way of a solution.
Is there anything in the traceback that can help me solve this
crippling problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---