OK, here is a patch that seems to correct the issue:
http://trac-hacks.org/attachment/ticket/1493/mysql-autologoutbug.patch

This seems related to the previously closed ticket 4802:
http://trac.edgewall.org/ticket/4802

I believe the reason it does not work on our setup has to do with the
return value of _mysql.ping().  In r5565 (i.e. 0.10.4), in db/
mysql_backend.py we had:

<pre>
    def rollback(self):
        if self.cnx.ping():
            self._set_character_set(self.cnx, 'utf8')
            self.cnx.rollback()
        else:
            self._is_closed = True
</pre>

In our setup, self.cnx.ping() always returns None (as determined
through inserted logging statements).  I suppose it returns a
meaningful value in some other setups.  However, from the
documentation I found on the net, the return value python's
_mysql.ping() [1] is not explicitly defined, even though the
underlying C api [2] does have a return value. In any case, checking
ping's return value does not seem to work properly in our case, so I
put in a try-except.

Christian, I see you handled the original ticket above.  Do you forsee
any problems with the patch?  (All the unit tests pass.)  In
particular, I'm not sure if ProgrammingError is the best exception to
catch.

Thanks,

Aaron Maxwell
SnapLogic - Open Source Internet Data Services
http://snaplogic.org

[1] 
http://mysql-python.sourceforge.net/MySQLdb-1.2.2/private/_mysql.connection-class.html#ping

[2] http://dev.mysql.com/doc/refman/5.0/en/mysql-ping.html


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" 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/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to