public void deleteSecGroupByIdIdx(
     CFSecurityAuthorization Authorization, CFSecuritySecGroupPKey argKey) {
   deleteSecGroupByIdIdx(
       Authorization, argKey.getRequiredClusterId(), argKey.getRequiredSecGroupId());
 }
  public CFSecuritySecGroupBuff lockBuff(
      CFSecurityAuthorization Authorization, CFSecuritySecGroupPKey PKey) {
    final String S_ProcName = "lockBuff";
    if (!schema.isTransactionOpen()) {
      throw CFLib.getDefaultExceptionFactory()
          .newUsageException(getClass(), S_ProcName, "Transaction not open");
    }
    ResultSet resultSet = null;
    Connection cnx = schema.getCnx();
    CallableStatement stmtLockBuffByPKey = null;
    try {
      long ClusterId = PKey.getRequiredClusterId();
      int SecGroupId = PKey.getRequiredSecGroupId();

      stmtLockBuffByPKey =
          cnx.prepareCall(
              "begin "
                  + schema.getLowerDbSchemaName()
                  + ".lck_secgrp( ?, ?, ?, ?, ?, ?"
                  + ", "
                  + "?"
                  + ", "
                  + "?"
                  + " ); end;");
      int argIdx = 1;
      stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
      stmtLockBuffByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
      stmtLockBuffByPKey.setString(
          argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
      stmtLockBuffByPKey.setString(
          argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
      stmtLockBuffByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
      stmtLockBuffByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
      stmtLockBuffByPKey.setLong(argIdx++, ClusterId);
      stmtLockBuffByPKey.setInt(argIdx++, SecGroupId);
      stmtLockBuffByPKey.execute();
      resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1);
      if (resultSet == null) {
        return (null);
      }
      try {
        if (resultSet.next()) {
          CFSecuritySecGroupBuff buff = unpackSecGroupResultSetToBuff(resultSet);
          if (resultSet.next()) {
            resultSet.last();
            throw CFLib.getDefaultExceptionFactory()
                .newRuntimeException(
                    getClass(),
                    S_ProcName,
                    "Did not expect multi-record response, "
                        + resultSet.getRow()
                        + " rows selected");
          }
          return (buff);
        } else {
          return (null);
        }
      } catch (SQLException e) {
        return (null);
      }
    } catch (SQLException e) {
      throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
      if (resultSet != null) {
        try {
          resultSet.close();
        } catch (SQLException e) {
        }
        resultSet = null;
      }
      if (stmtLockBuffByPKey != null) {
        try {
          stmtLockBuffByPKey.close();
        } catch (SQLException e) {
        }
        stmtLockBuffByPKey = null;
      }
    }
  }