Ejemplo n.º 1
0
  public static void Fdieb4self(ResourceManagerImpl rm)
      throws RemoteException, TransactionAbortedException, InvalidTransactionException {

    int xid = rm.start();
    rm.addFlight(xid, "347", 100, 310);
    rm.addRooms(xid, "Stanford", 200, 150);
    rm.addCars(xid, "SFO", 300, 30);
    rm.newCustomer(xid, "John");
    rm.commit(xid);

    xid = rm.start();
    rm.addFlight(xid, "347", 100, 620);
    rm.addRooms(xid, "Stanford", 200, 300);
    rm.addCars(xid, "SFO", 300, 60);
    rm.dieBeforePointerSwitch();
    try {

      rm.commit(xid);
    } catch (RemoteException e) {

      System.out.println("Caught remote exception");
    }
    xid = rm.start();
    int value = rm.queryFlight(xid, "347");
    System.out.println(value);
    value = rm.queryFlightPrice(xid, "347");
    System.out.println(value);
    value = rm.queryRooms(xid, "Stanford");
    System.out.println(value);
    value = rm.queryRoomsPrice(xid, "Stanford");
    System.out.println(value);
  }