Package com.sun.sgs.test.util

Examples of com.sun.sgs.test.util.DummyTransaction.commit()


  store = getDataStore();
  DummyTransaction txn = createTransaction(1000);
  for (int i = 0; i < items; i++) {
      store.setBinding(txn, "name" + i, i);
  }
  txn.commit();
  for (int r = 0; r < repeat; r++) {
      long start = System.currentTimeMillis();
      for (int c = 0; c < count; c++) {
    txn = createTransaction(1000);
    for (int i = 0; i < items; i++) {
View Full Code Here


      for (int c = 0; c < count; c++) {
    txn = createTransaction(1000);
    for (int i = 0; i < items; i++) {
        store.getBinding(txn, "name" + i);
    }
    txn.commit();
      }
      long stop = System.currentTimeMillis();
      System.err.println(
    "Time: " + (stop - start) / (float) count +
    " ms per transaction");
View Full Code Here

  store = getDataStore();
  DummyTransaction txn = createTransaction(1000);
  for (int i = 0; i < items; i++) {
      store.setBinding(txn, "name" + i, i);
  }
  txn.commit();
  for (int r = 0; r < repeat; r++) {
      long start = System.currentTimeMillis();
      for (int c = 0; c < count; c++) {
    txn = createTransaction(1000);
    for (int i = 0; i < items; i++) {
View Full Code Here

        long result = store.getBinding(txn, "name" + i);
        if (update) {
      store.setBinding(txn, "name" + i, result + 1);
        }
    }
    txn.commit();
      }
      long stop = System.currentTimeMillis();
      System.err.println(
    "Time: " + (stop - start) / (float) count +
    " ms per transaction");
View Full Code Here

        /* Get write lock on name-299 and notify txn */
        store.setBinding(txn2, "name-299", id2);
        flag.release();
        /* Wait for txn, then commit */
        flag2.tryAcquire(10000, TimeUnit.MILLISECONDS);
        txn2.commit();
    } catch (TransactionAbortedException e) {
        System.err.println("txn2: " + e);
        exception2 = e;
    } catch (Exception e) {
        System.err.println("txn2: " + e);
View Full Code Here

          UsePrepareAndCommit.ARBITRARY, 1000);
      store.getObject(txn2, id2, false);
      flag.release();
      store.getObject(txn2, id, true);
      System.err.println(finalI + " txn2: commit");
      txn2.commit();
        } catch (TransactionAbortedException e) {
      System.err.println(finalI + " txn2: " + e);
      exception2 = e;
        } catch (Exception e) {
      System.err.println(finalI + " txn2: " + e);
View Full Code Here

        /* Get write lock on name-299 and notify txn */
        store.setBinding(txn2, "name-299", id2);
        flag.release();
        /* Wait for txn, then commit */
        flag2.tryAcquire(10000, TimeUnit.MILLISECONDS);
        txn2.commit();
    } catch (TransactionAbortedException e) {
        System.err.println("txn2: " + e);
        exception2 = e;
    } catch (Exception e) {
        System.err.println("txn2: " + e);
View Full Code Here

          UsePrepareAndCommit.ARBITRARY, 1000);
      store.getObject(txn2, id2, false);
      flag.release();
      store.getObject(txn2, id, true);
      System.err.println(finalI + " txn2: commit");
      txn2.commit();
        } catch (TransactionAbortedException e) {
      System.err.println(finalI + " txn2: " + e);
      exception2 = e;
        } catch (Exception e) {
      System.err.println(finalI + " txn2: " + e);
View Full Code Here

        /* Get write lock on name-299 and notify txn */
        store.setBinding(txn2, "name-299", id2);
        flag.release();
        /* Wait for txn, then commit */
        flag2.tryAcquire(10000, TimeUnit.MILLISECONDS);
        txn2.commit();
    } catch (TransactionAbortedException e) {
        System.err.println("txn2: " + e);
        exception2 = e;
    } catch (Exception e) {
        System.err.println("txn2: " + e);
View Full Code Here

          UsePrepareAndCommit.ARBITRARY, 1000);
      store.getObject(txn2, id2, false);
      flag.release();
      store.getObject(txn2, id, true);
      System.err.println(finalI + " txn2: commit");
      txn2.commit();
        } catch (TransactionAbortedException e) {
      System.err.println(finalI + " txn2: " + e);
      exception2 = e;
        } catch (Exception e) {
      System.err.println(finalI + " txn2: " + e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.