Dan Pascu a écrit : > IMO, I see no reason why a server restart cannot be handled by the same > reconnect feature of the underlying mysql library. From the sqlobject > point of view the situation is the same, no matter if the connection did > timeout or the server was restarted. Once it timeouts a connection ceases > to exist in the server much like when the server is restarted and looses > all the connections. > If the reconnect patch is applied to mysqldb, sqlobject needs no changes > and shouldn't care about handling a restarted server (not that it can > tell if the server died, was restarted or closed the connection because > it was idle, anyway). > > In the end, probably the situation can be handled in sqlobject completely, > if the transaction code takes care not to reconnect, but to raise an > exception. Thus if no transactions are used, then the code can create a > new connection everytime it detects a dead one, but if the connection is > a transaction object in the middle of a transaction then it should just > raise an error. > > However I fail to see the point to reimplement all this logic in sqlobject > when it is already implemented by the mysql library. All that is needed > is to make the reconnect option available to the python level and the > solution is already out there, except that somebody insist on ignoring it > for no good reason. > > What I don't understand is that the mysql team choosed not to reconnect automatically in mysql5 because of transactions to be handled correctly. If this is handled correctly in the mysql API, why don't they just enable it by default? I don't see how the API can handle reconnection in a transaction...
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss