Mercurial > p > mysql-python > mysqldb-2
comparison MySQLdb/connections.py @ 72:c0c00294239b MySQLdb
Check in some old changes
author | adustman |
---|---|
date | Thu, 18 Feb 2010 23:47:51 +0000 |
parents | 98d968f5af11 |
children | 80164eb2f090 |
comparison
equal
deleted
inserted
replaced
71:f06381a47ab0 | 72:c0c00294239b |
---|---|
167 # PEP-249 requires autocommit to be initially off | 167 # PEP-249 requires autocommit to be initially off |
168 self.autocommit(False) | 168 self.autocommit(False) |
169 self.messages = [] | 169 self.messages = [] |
170 | 170 |
171 def autocommit(self, do_autocommit): | 171 def autocommit(self, do_autocommit): |
172 self._autocommit = do_autocommit | |
172 return self._db.autocommit(do_autocommit) | 173 return self._db.autocommit(do_autocommit) |
173 | 174 |
174 def ping(self, reconnect=False): | 175 def ping(self, reconnect=False): |
176 if reconnect and not self._autocommit: | |
177 raise ProgrammingError("autocommit must be enabled before enabling auto-reconnect; consider the consequences") | |
175 return self._db.ping(reconnect) | 178 return self._db.ping(reconnect) |
176 | 179 |
177 def commit(self): | 180 def commit(self): |
178 return self._db.commit() | 181 return self._db.commit() |
179 | 182 |