Esempio n. 1
0
 public static void queryCheck(ResourceManagerImpl rm)
     throws RemoteException, TransactionAbortedException, InvalidTransactionException {
   int xid = rm.start();
   System.out.println(rm.queryFlight(xid, "1"));
   System.out.println(rm.queryCars(xid, "a"));
   System.out.println(rm.queryRooms(xid, "A"));
 }
Esempio n. 2
0
  public static void Baddcmtrd(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);
    // printTables(rm);

    xid = rm.start();
    int avail = rm.queryFlight(xid, "347");
    System.out.println(avail);
    avail = rm.queryFlightPrice(xid, "347");
    System.out.println(avail);
    avail = rm.queryRooms(xid, "Stanford");
    System.out.println(avail);
    avail = rm.queryRoomsPrice(xid, "Stanford");
    System.out.println(avail);
    avail = rm.queryCars(xid, "SFO");
    System.out.println(avail);
    avail = rm.queryCarsPrice(xid, "SFO");
    System.out.println(avail);
    avail = rm.queryCustomerBill(xid, "John");
    System.out.println(avail);
  }