Long running processes using peewee eventually fail
You need to understand how Peewee manages connections -- peewee creates a connection-per-thread and will not automatically reconnect if that connection should get closed by the server. Why? What if you were in the middle of a transaction or had uncommitted changes -- we don't want to silently lose those.

So what you need to do is ensure you are opening and closing your connections properly. Here's an example:

```python

db = PostgresqlExtDatabase(...)

def long_running_task():
    while True:
        db.connect()
        # do some work with the database
        db.close()

        # wait for more work to do.
```

My suggestions are: 

* open the connection for the short periods of time when you actually need it, close when done
* use a connection pool with the above if the overhead of opening/closing connections is an issue
Hello folks, apologies if this issue is a duplicate. I've now seen several services I've written using peewee eventually fail after some time, varying from a few days to a couple months, with an error like:
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3175, in execute_sql
    cursor = self.cursor(commit)
  File "/usr/local/lib/python3.8/site-packages/playhouse/postgres_ext.py", line 484, in cursor
    return self._state.conn.cursor()
psycopg2.InterfaceError: connection already closed
```
It appears that peewee never recovers -- after this error occurs all following attempts to use the database via peewee fail as above. But when I restart the long running process it immediately works fine, and postgres itself is working fine.

The connection itself is created as:
```
db = playhouse.postgres_ext.PostgresqlExtDatabase("postgres url", autorollback=True)

class BaseModel(peewee.Model):
    class Meta:
        database = db
```
... and then thereafter I use peewee in ways that should presumably be bog-standard.

peewee version: 3.14.10
python version: 3.8.12

Apologies that this isn't the most recent version of peewee. I'd try to reproduce this issue with the most recent version, but by its very nature (failing after months) it's hard to reproduce.

I realize that the above report is extremely vague and hard to work from, and quite plausibly this isn't peewee's fault. I can try to provide whatever information would be helpful to diagnose, if needed.

Thanks.