Fixes connection close from SqlDatabase when using cacheData in highly concurrent situations.