I think your question is a little too generic at present - we do not know what caused the IOException, so it is a little hard to decide what is appropriate.
When i write the code for say find(), i would need to catch the IOException, do i wrap it unto say RecordNotFoundException(Given Exception)? Is this appropriate?
Interesting. In my assignment, the find() method does not throw RecordNotFoundException although the read(), update(), delete(), lock() and unlock() methods all throw it. This to me seems logical (but then again, Sun have indicated that some parts of some versions of the assignment have been deliberately written to imitate specifications written by clueless users ).
First of all my instructions says:
Any methods that throw RecordNotFoundException should do so if a specified record doesnt exist or is marked as deleted in the database file
Now, does this mean that if say example i get to the end of a file and dont get to see the record i could wrap IOException unto RecordNotFoundException? Or do i do a check for the type of exception thrown(say using e instanceOf IOException and then wrap it unto RNF?
Why not? It won't hurt to have this in single user mode (and performance is not likely to be affected when there is only one user ). And the bigger advantage is that you have one set of code that is always run no matter whether you are in single user mode or multi user mode. There is less chance of something working in single user mode but failing in multi user mode with only one connected user. In my opinion using the locking code in both instances is an advantage!
In my specs it says:
... therefore your locking system only needs to be concerned with multiple concurrent clients...
I perfectly understand this, but since i am using an Adapter class and RMI, when a client requests for Local Mode/Non-Networking, the clients gets and instance of the Adapter class; and since the Adapter class contain business methods that call lock() say update() and then unlock()(Max's concepts); doesnt it mean that there is still an element of locking in non-network mode ?
Just some friendly advice - sometimes a comment like that can have the wrong effect. You might want to look at "ease up" for information on why.
As usual your prompt responses and advice will highly appreciated!
So basically if my read() method(which throws RecordNotFoundException) threw an IOException, it is safe to assume that i could warp the exception unto a RecordNotFoundException?
Well the update() method will have to be called in order to save the customer number to file. But you will probably have to call some of the other methods before and after the update. Hint: How can you be absolutely sure that no other user has already booked the record you are about to update?
Which method is used when we are about to book for a particular record? I am assuming it is the Update() which would allow a user to write to the field of owner of the datafile! Is this so?
You would probably want something else in that book() business function as well - something to check that the record has not yet been booked?
Thanks also for the book() business function, i know the step involved would be to lock() then update() and then finally unlock() the record
Take a look at the java.util.Properties class. Sun have a "Using Properties to Manage Program Attributes" tutorial on this.
What is a property file(suncertify.properties) and how is one created?In my specs, It says Such configuration must be stored in a persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties...
It is not really linked to the properties file (although both modes will use the properties file, and they might have some different properties for the different modes. But the key thing here is that your program will be using the properties file - it is not the properties file that determines the mode.
How do i implement the flag mode: alone and server; is this linked to this properties file, if so how do i go by implementing one?
and POOF! You're gone! But look, this tiny ad is still here:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton