added scoped_ptr on getScopedDbConnection to close connection