Further adjustments to handling lost database connections.