Hi All

This is my first post here, so I wish it were a little more spectacular..  :-)

I have been working happily with SA 0.6.x on Windows 2003 server with MySQL and 
the Sun Python Connector.  I have an identical config running (and working) on 
XP.

I was testing my code which had been working perfectly, and suddenly started 
getting this message which I had never seen before;

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    e.connect()
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 1731, in 
connect
    return self.Connection(self, **kwargs)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 821, in 
__init__
    self.__connection = connection or engine.raw_connection()
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 1787, in 
raw_connection
    return self.pool.unique_connection()
  File "C:\Python26\lib\site-packages\sqlalchemy\pool.py", line 135, in 
unique_connection
    return _ConnectionFairy(self).checkout()
  File "C:\Python26\lib\site-packages\sqlalchemy\pool.py", line 329, in __init__
    rec = self._connection_record = pool.get()
  File "C:\Python26\lib\site-packages\sqlalchemy\pool.py", line 177, in get
    return self.do_get()
  File "C:\Python26\lib\site-packages\sqlalchemy\pool.py", line 692, in do_get
    con = self.create_connection()
  File "C:\Python26\lib\site-packages\sqlalchemy\pool.py", line 138, in 
create_connection
    return _ConnectionRecord(self)
  File "C:\Python26\lib\site-packages\sqlalchemy\pool.py", line 218, in __init__
    l.first_connect(self.connection, self)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\strategies.py", line 
145, in first_connect
    dialect.initialize(c)
  File "C:\Python26\lib\site-packages\sqlalchemy\dialects\mysql\base.py", line 
1774, in initialize
    default.DefaultDialect.initialize(self, connection)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\default.py", line 144, 
in initialize
    self._get_default_schema_name(connection)
  File "C:\Python26\lib\site-packages\sqlalchemy\dialects\mysql\base.py", line 
1739, in _get_default_schema_name
    return connection.execute('SELECT DATABASE()').scalar()
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 1157, in 
execute
    params)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 1252, in 
_execute_text
    parameters=parameters)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 1348, in 
__create_execution_context
    None, None)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 1311, in 
_handle_dbapi_exception
    self.invalidate(e)
  File "C:\Python26\lib\site-packages\sqlalchemy\engine\base.py", line 961, in 
invalidate
    if self.__connection.is_valid:
AttributeError: 'MySQL' object has no attribute 'is_valid'

I have spent a significant amount of time on this, and nothing makes sense.  
I've run the unittest.py code that comes with the connector, and (connecting to 
the same DB) ran the tests with success.  Firstly, it would appear that there 
is a possible bug in base.py at line 962 where it asks " if 
self.__connection.is_valid:" as this attribute has not been created yet, and is 
conditionally created.  However, this is not the root of the issue, merely a 
distraction.  (I forced this to exist and have a value, but the problem just 
fell through to further down the code)

I can get this error by simply doing this (now) when this all has worked for 
days.

e = create_engine('mysql+mysqlconnector://user:passw...@127.0.0.1/testdb', 
encoding='utf8', echo=False)
e.connect()

Any clues - as this is driving me nuts!   Can't do ANYTHING now because I an no 
longer connect to the DB.  DB manager and other tools all show MySQL happily 
ticking along.  I have rebooted the server.

As a possible solution, are there any other stable MySQL connectors out there 
that are easy to install on a Windows platform?   The Python Connector one 
chosen has been good so far, but if that turns out to be  the issue - it's gone!

Cheers
Warwick

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to