(ITS#7638) Handle connection loss in SQL backend