Outline an implementation for the Election service that ensures that its records remain consistent
when it is accessed concurrently by multiple clients.

What will be an ideal response?


Suppose that each vote in the form {String vote, int number} is appended to a data structure such as a Java
Vector. Before this is done, the voter number in the request message must be checked against every vote
recorded in the Vector. Note that an array indexed by voter’s number is not a practical implementation as the
numbers are allocated sparsely.
The operations to access and update a Vector are synchronized, making concurrent access safe.
Alternatively use any form of synchronization to ensure that multiple clients’ access and update
operations do not conflict with one another.

Computer Science & Information Technology

You might also like to view...

If a method throws an exception, and the exception is not caught inside the method, then the method invocation:

a. terminates b. transfers control to the catch block c. transfers control to the exception handler d. none of the above

Computer Science & Information Technology

Security auditing is the process of documenting countermeasures put in place due to attacks on the network.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Assuming the account number is 2, which of the following modifies the pin column in the accounts table?

a) SELECT pin FROM accounts WHERE accountNumber = 2 b) SELECT accounts FROM accountNumber = 2 WHERE pin c) UPDATE accounts SET pin = 1243 WHERE accountNumber = 2 d) UPDATE pin = 1243 SET accountNumber = 2 WHERE accounts

Computer Science & Information Technology

What are the benefits of aggregate functions? Give an example

What will be an ideal response?

Computer Science & Information Technology