Do not close db before execution is completed