Handle database connection disconnecting.