I'm having doubts about what some requirements exactly mean.
Anyone out there to share your thoughts?
Sun provided the interface "DB.java" and states that:
"Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the DB interface".
The locking part in the assignment states:
"Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface provided above. You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server. Any attempt to lock a resource that is already locked should cause the current
thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available."
1. Does this mean that all methods from the DB interface MUST be available to a remote client?
This to allow the marker to lock a record remotely, get a
coffee and unlock it after returning?
Currently, all my locking and unlocking is triggered on the server only, and no lock/unlock methods are available to the client code.
2. I think you can avoid throwing a RecordLockedException back to the client by carefully synchronizing methods on the server. Am I right? If so, should I nevertheless foresee the possibility in the client that a record can be locked (this in case the marker follows the aforementioned lock-coffee-unlock sequence)?