In the subroutines should I connect and disconnect the database every time