code: private Kam lookupKam(KamNode kamNode, Dialect dialect,
              final String errorMsg)
              throws KamCacheServiceException, InvalidIdException,
              RequestException {
          KamStoreObjectRef kamNodeRef = Converter.decodeNode(kamNode);
          KamInfo kamInfo = null;
          try {
              kamInfo = kamCatalogDao.getKamInfoById(kamNodeRef.getKamInfoId());
          } catch (SQLException e) {
              throw new RequestException(errorMsg, e);
          }
          if (kamInfo == null) {
              throw new InvalidIdException(kamNodeRef.getEncodedString());
          }
          final Kam kam = kamCacheService.getKam(kamInfo.getName());
          if (kam == null) {
              throw new InvalidIdException(kamNodeRef.getEncodedString());
          }
          return kam;
      }
docs: Lookup the {@link Kam} associated with the {@link KamNode}.
  
  @param kamNode {@link KamNode}, the kam node
  @param dialect {@link Dialect} to apply to the kam, potentially <code>null</code>
  @return the {@link Kam} associated with the {@link KamNode}, which
  might be null
  @throws KamCacheServiceException Thrown if an error occurred while
  retrieving the {@link Kam} from the cache
  @throws InvalidIdException Thrown if an error occurred while decoding the
  {@link KamNode node}'s id