Package org.radargun.stages.tpcc

Examples of org.radargun.stages.tpcc.ElementNotFoundException


      boolean found = false;
      Customer c = null;
      if (c_by_name) {
         List<Customer> cList = CustomerDAC.loadByCLast(basicCache, w_id, d_id, c_last);
         if (cList == null || cList.isEmpty())
            throw new ElementNotFoundException("C_LAST=" + c_last + " C_D_ID=" + d_id + " C_W_ID=" + w_id + " not found!");
         Collections.sort(cList);


         namecnt = cList.size();


         if (namecnt % 2 == 1) namecnt++;
         Iterator<Customer> itr = cList.iterator();

         for (int i = 1; i <= namecnt / 2; i++) {

            c = itr.next();

         }

      } else {
         // clause 2.6.2.2 (dot 3, Case 1)
         c = new Customer();
         c.setC_id(c_id);
         c.setC_d_id(d_id);
         c.setC_w_id(w_id);
         found = c.load(basicCache);
         if (!found)
            throw new ElementNotFoundException("C_ID=" + c_id + " C_D_ID=" + d_id + " C_W_ID=" + w_id + " not found!");

      }

      // clause 2.6.2.2 (dot 4)
      Order o = OrderDAC.loadByGreatestId(basicCache, w_id, d_id, c_id);
View Full Code Here


      c.setC_w_id(w_id);

      boolean found = c.load(basicCache);

      if (!found)
         throw new ElementNotFoundException("W_ID=" + w_id + " C_D_ID=" + d_id + " C_ID=" + c_id + " not found!");

      w.setW_id(w_id);

      found = w.load(basicCache);
      if (!found) throw new ElementNotFoundException("W_ID=" + w_id + " not found!");


      District d = new District();
      // see clause 2.4.2.2 (dot 4)


      d.setD_id(d_id);
      d.setD_w_id(w_id);
      found = d.load(basicCache);
      if (!found) throw new ElementNotFoundException("D_ID=" + d_id + " D_W_ID=" + w_id + " not found!");


      o_id = d.getD_next_o_id();


      NewOrder no = new NewOrder(o_id, d_id, w_id);

      no.store(basicCache);

      d.setD_next_o_id(d.getD_next_o_id() + 1);

      d.store(basicCache);


      Order o = new Order(o_id, d_id, w_id, c_id, new Date(), -1, o_ol_cnt, o_all_local);

      o.store(basicCache);


      // see clause 2.4.2.2 (dot 8)
      for (int ol_number = 1; ol_number <= o_ol_cnt; ol_number++) {
         ol_supply_w_id = supplierWarehouseIDs[ol_number - 1];
         ol_i_id = itemIDs[ol_number - 1];
         ol_quantity = orderQuantities[ol_number - 1];

         // clause 2.4.2.2 (dot 8.1)
         Item i = new Item();
         i.setI_id(ol_i_id);
         found = i.load(basicCache);
         if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");


         itemPrices[ol_number - 1] = i.getI_price();
         itemNames[ol_number - 1] = i.getI_name();
         // clause 2.4.2.2 (dot 8.2)

         Stock s = new Stock();
         s.setS_i_id(ol_i_id);
         s.setS_w_id(ol_supply_w_id);
         found = s.load(basicCache);
         if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");


         s_quantity = s.getS_quantity();
         stockQuantities[ol_number - 1] = s_quantity;
         // clause 2.4.2.2 (dot 8.2)
View Full Code Here

      Warehouse w = new Warehouse();
      w.setW_id(w_id);

      boolean found = w.load(basicCache);
      if (!found) throw new ElementNotFoundException("W_ID=" + w_id + " not found!");
      w.setW_ytd(h_amount);
      w.store(basicCache);

      District d = new District();
      d.setD_id(d_id);
      d.setD_w_id(w_id);
      found = d.load(basicCache);
      if (!found) throw new ElementNotFoundException("D_ID=" + d_id + " D_W_ID=" + w_id + " not found!");

      d.setD_ytd(h_amount);
      d.store(basicCache);

      Customer c = null;

      if (c_by_name) {
         new_c_last = c_last;
         List cList = null;
         cList = CustomerDAC.loadByCLast(basicCache, c_w_id, c_d_id, new_c_last);

         if (cList == null || cList.isEmpty())
            throw new ElementNotFoundException("C_LAST=" + c_last + " C_D_ID=" + c_d_id + " C_W_ID=" + c_w_id + " not found!");

         Collections.sort(cList);

         namecnt = cList.size();

         if (namecnt % 2 == 1) namecnt++;
         Iterator<Customer> itr = cList.iterator();

         for (int i = 1; i <= namecnt / 2; i++) {
            c = itr.next();
         }
      } else {
         c = new Customer();
         c.setC_id(c_id);
         c.setC_d_id(c_d_id);
         c.setC_w_id(c_w_id);
         found = c.load(basicCache);
         if (!found)
            throw new ElementNotFoundException("C_ID=" + c_id + " C_D_ID=" + c_d_id + " C_W_ID=" + c_w_id + " not found!");
      }

      c.setC_balance(c.getC_balance() + h_amount);
      if (c.getC_credit().equals("BC")) {
View Full Code Here

TOP

Related Classes of org.radargun.stages.tpcc.ElementNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.