Package ch.ethz.vs.rowa

Examples of ch.ethz.vs.rowa.QueryFuture


    public void run() {
     
      try {
        UUID id = middleware.startTransaction();
       
        QueryFuture qf = new QueryFuture();
        UpdateFuture uf = new UpdateFuture();

        // TODO: start measurement
       
        middleware.executeQuery(id, qf, "1st client "+item+" QUERY execute");
        while(!qf.isDone()) { Thread.yield(); }
        qf.getResult();
        qf.reset();
       
        // TODO: end measurement
        // TODO: add if failed

        middleware.executeQuery(id, qf, "2nd client "+item+" QUERY execute");
        while(!qf.isDone()) { Thread.yield(); }
        qf.getResult();
        qf.reset();
       
        middleware.executeUpdate(id, uf, "1st client "+item+" UPDATE execute");
        while(!uf.isDone()) { Thread.yield(); }
        uf.getResult();
        uf.reset();
       
        middleware.executeQuery(id, qf, "3th client "+item+" QUERY execute");
        while(!qf.isDone()) { Thread.yield(); }
        qf.getResult();
        qf.reset();

        middleware.executeUpdate(id, uf, "second client "+item+" UPDATE execute");
        while(!uf.isDone()) { Thread.yield(); }
        uf.getResult();
        uf.reset();
View Full Code Here


      + ") union (SELECT i_related2 FROM item WHERE i_id=" + i_id
      + ") union (SELECT i_related3 FROM item WHERE i_id=" + i_id
      + ") union (SELECT i_related4 FROM item WHERE i_id=" + i_id
      + ") union (SELECT i_related5 FROM item WHERE i_id=" + i_id + "))";

    mw.executeQuery(transactionUuid, new QueryFuture() {
      public void onResult(String[][] result) {
//        System.out.println("the first result:");
//        System.out.println(result);
      }
    }, q1);

    mw.executeQuery(transactionUuid, new QueryFuture() {
      public void onResult(String[][] result) {
//        System.out.println("the second result:");
//        System.out.println(result);
      }
    }, q1);
View Full Code Here

    int sc_id = GENERATOR.nextInt(1000) + 1;
    int i_id = GENERATOR.nextInt(10000) + 1;

    // Does this shopping cart exist?
    mw.executeQuery(transactionUuid, new QueryFuture() {
      public void onResult(String[][] result) {
//        System.out.println("the first result:");
//        System.out.println(result);
      }
    }, "SELECT * FROM shopping_cart WHERE sc_id = " + sc_id);

    // Here you get sometimes an abort, since two workers try to insert the same shopping_cart
//    if (res.length == 0)
//    {
    UpdateFuture uf = new UpdateFuture();
    mw.executeUpdate(transactionUuid, uf, "INSERT INTO shopping_cart (sc_id, sc_c_id, sc_total) VALUES ("
    + sc_id + "," + GENERATOR.nextInt(20000) + ", 0)");
//    }

    mw.executeQuery(transactionUuid, new QueryFuture() {
      public void onResult(String[][] result) {
      }
    }, "SELECT scl_qty FROM shopping_cart_line WHERE scl_sc_id = "
    + sc_id + " AND scl_i_id =" + i_id);

View Full Code Here

      if(transactionType == Benchmark.QUERIES)
      {
        boolean success = false;
        UUID id;
        int item = 1;
        QueryFuture qf = new QueryFuture();
        long time = (new Date()).getTime();
        try {
          id = middleware.startTransaction();
          if (id == null) {
            success = false;
          } else {
            middleware.executeQuery(id, qf, "1st client "+item+" QUERY execute");
            while(!qf.isDone()) { Thread.yield(); }
            if(qf.isSuccess())
            {
              qf.getResult();
              qf.reset();
              success = true;
            }
            else
            {
              success = false;
View Full Code Here

    @Override
    public void run() {
      try {
        UUID id = middleware.startTransaction();
       
        QueryFuture qf = new QueryFuture();
        UpdateFuture uf = new UpdateFuture();

        // TODO: start measurement
       
        middleware.executeQuery(id, qf, "1st client "+item+" QUERY execute");
        while(!qf.isDone()) { Thread.yield(); }
        qf.getResult();
        qf.reset();
       
        // TODO: end measurement
        // TODO: add if failed

        middleware.executeQuery(id, qf, "2nd client "+item+" QUERY execute");
        while(!qf.isDone()) { Thread.yield(); }
        qf.getResult();
        qf.reset();
       
        middleware.executeUpdate(id, uf, "1st client "+item+" UPDATE execute");
        while(!uf.isDone()) { Thread.yield(); }
        uf.getResult();
        uf.reset();
       
        middleware.executeQuery(id, qf, "3th client "+item+" QUERY execute");
        while(!qf.isDone()) { Thread.yield(); }
        qf.getResult();
        qf.reset();

        middleware.executeUpdate(id, uf, "second client "+item+" UPDATE execute");
        while(!uf.isDone()) { Thread.yield(); }
        uf.getResult();
        uf.reset();
View Full Code Here

TOP

Related Classes of ch.ethz.vs.rowa.QueryFuture

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.