Added auto-reconnect and connection pooling to the database