/**
   * Actualiza el campo de Producto No Conforme de la persona que recibe la notificación.
   *
   * <p><b> update GRLRegistroPNC set cRecibeNotif=? where iEjercicio = ? AND iConsecutivoPNC = ?
   * </b>
   *
   * <p><b> Campos Llave: iEjercicio,iConsecutivoPNC, </b>
   *
   * @param vData TVDinRep - VO Dinámico que contiene a la entidad a Insertar.
   * @param cnNested Connection - Conexión anidada que permite que el método se encuentre dentro de
   *     una transacción mayor.
   * @throws DAOException - Excepción de tipo DAO
   * @return TVDinRep - Entidad Modificada.
   */
  public TVDinRep updateRecibe(TVDinRep vData, Connection cnNested) throws DAOException {
    DbConnection dbConn = null;
    Connection conn = cnNested;
    PreparedStatement lPStmt = null;
    int iConsecutivoPNC = 0, iEjercicioPNC = 0;
    boolean lSuccess = true;
    try {

      if (cnNested == null) {
        dbConn = new DbConnection(dataSourceName);
        conn = dbConn.getConnection();
        conn.setAutoCommit(false);
        conn.setTransactionIsolation(2);
      }
      Vector vcPNC =
          findByCustom(
              "",
              "SELECT "
                  + "iEjercicioPNC,ICONSECUTIVOPNC "
                  + "FROM TRAREGPNCETAPA "
                  + "where IEJERCICIO = "
                  + vData.getInt("iEjercicio")
                  + " and INUMSOLICITUD = "
                  + vData.getInt("iNumSolicitud")
                  + " order by iorden desc");
      if (vcPNC.size() > 0) {
        TVDinRep vRegPNC = (TVDinRep) vcPNC.get(0);
        iConsecutivoPNC = vRegPNC.getInt("ICONSECUTIVOPNC");
        iEjercicioPNC = vRegPNC.getInt("iEjercicioPNC");
      }

      String lSQL =
          "update GRLRegistroPNC set cRecibeNotif=?,dtNotificacion=? where iEjercicio = ? AND iConsecutivoPNC = ? ";

      lPStmt = conn.prepareStatement(lSQL);
      lPStmt.setString(1, vData.getString("cRecibeNotif"));
      lPStmt.setDate(2, vData.getDate("dtNotificacion"));
      lPStmt.setInt(3, iEjercicioPNC);
      lPStmt.setInt(4, iConsecutivoPNC);

      if (cnNested == null) {
        conn.commit();
      }

      /*if(cnNested == null){
        conn.commit();
        TDVerificacion tdVer = new TDVerificacion();
        tdVer.upNotificacion(vData, cnNested);
      }*/
    } catch (Exception ex) {
      warn("update", ex);
      if (cnNested == null) {
        try {
          conn.rollback();
        } catch (Exception e) {
          fatal("update.rollback", e);
        }
      }
      lSuccess = false;
    } finally {
      try {
        if (lPStmt != null) {
          lPStmt.close();
        }
        if (cnNested == null) {
          if (conn != null) {
            conn.close();
          }
          dbConn.closeConnection();
        }
      } catch (Exception ex2) {
        warn("update.close", ex2);
      }
      if (lSuccess == false) throw new DAOException("");

      return vData;
    }
  }