replacing persistence connection lines with simple query