database disconnect detection