Don't create too many db connectons, ensure entities are deleted wrt foreign key constraints