Fixed up more database session passing throughout application to help with 'database locked' exceptions