dbAccessLayer: updated functions to get sequence on ids