Skip to content

Commit f41f5cc

Browse files
author
Chris Turner
committed
datajoint/connection.py: fix datajoint#896
1 parent 909749a commit f41f5cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

datajoint/connection.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ def query(self, query, args=(), *, as_dict=False, suppress_warnings=True, reconn
305305
raise
306306
warnings.warn("MySQL server has gone away. Reconnecting to the server.")
307307
connect_host_hook(self)
308+
if self.is_connected:
309+
logger.info("Connected {user}@{host}:{port}".format(**self.conn_info))
310+
self.connection_id = self.query('SELECT connection_id()').fetchone()[0]
311+
308312
if self._in_transaction:
309313
self.cancel_transaction()
310314
raise errors.LostConnectionError("Connection was lost during a transaction.")

0 commit comments

Comments
 (0)