ReconnectMixin with atomic cause exception
The transaction details are wrapped by the driver, so I can't really comment on why this is the case with pymysql. I'd suggest possibly trying to ping the db before beginning transactions if its possible your connection has been idle for quite some time. You can do this quite easily.

https://pymysql.readthedocs.io/en/latest/modules/connections.html#pymysql.connections.Connection.ping

```python

db = ReconnectMySQLDatabase(...)

try:
    db.connection().ping(reconnect=False)
except:
    db.close()
    db.connect()
```

Couple things to consider, though. Why are you leaving open connections sitting idle for a long time? This may indicate a problematic design. If this is a web app, you should probably be using the PooledMySQLDatabase and opening/closing connections each request. If this is something else, however, I'd suggest either a) connect/close when you need to do work, or b) use something like the code above to ensure connection liveness.
Using the `ReconnectMixin` and executing a query after a long wait inside an `atomic` block causes an exception.

Here is some sample code:

```python
class ReconnectMySQLDatabase(ReconnectMixin, pw.MySQLDatabase):
    """Class to make MySQL automatically reconnect after long periods without querying the database
    """
    pass
DB = ReconnectMySQLDatabase(...)

# wait a long time
tweets = Tweet.select()
with DB.atomic():
    for t in tweets:
        t.user = "me"
    Tweet.bulk_update(tweets, fields=["user"], batch_size=100)
```

This will cause an exception saying that the connection was reset inside a transaction.

Shouldn't the transaction initialization cause the reconnect.