private void runTransactions(TransactionFileReader input)
	{
		String line = input.readLine();
		while (line != null && transactionCounter < Globals.MAX_NOF_TRANSACTIONS_PER_SERVER) {
			if (!line.equals("START TRANSACTION")) {
				System.out.println("ERROR: Input file is incorrectly formatted. Program aborted.");
				System.exit(1);
			}
			if (!gui.getPauseStatus()) {
				int newId = serverId * Globals.MAX_NOF_TRANSACTIONS_PER_SERVER + transactionCounter;
				gui.newTransactionTab(newId);
				println("Transaction " + newId + " arrived.");
				activeTransaction = new Transaction(newId, this, input);
				if (!activeTransaction.runTransaction())
					nofAborts++;
				activeTransaction = null;
				transactionCounter++;
				println("Transaction " + newId + " ended.");
				gui.updateTransactionCounters(nofAborts, transactionCounter);
				// Read a line describing the waiting time until the next transaction arrives.
				// The line should be on the format WAIT 50-200 (signifying a wait between 50 and 200 ms).
				line = input.readLine();
				if (line == null || !line.startsWith("WAIT ")) {
					System.out.println("ERROR: Input file is incorrectly formatted. Program aborted.");
					System.exit(1);
				}
				StringTokenizer st = new StringTokenizer(line.substring(5), "-");
				long min = Long.parseLong(st.nextToken());
				if (!st.hasMoreTokens()) {
					System.out.println("ERROR: Input file is incorrectly formatted. Program aborted.");
					System.exit(1);
				}
				long max = Long.parseLong(st.nextToken());
				Globals.randomSleep(min, max);
				// Read the next input line
				line = input.readLine();
				if (line.equals("END OF FILE"))
					line = null;
			}
			else {
				// Wait a little while to prevent hogging the CPU
				Globals.randomSleep(100, 100);
			}
		}
		println("End of input file reached, no more transactions will be started.");
		input.close();
	}