Currenlty my lock method inside Data access Interface throws both java.rmi.RemoteException and java.io.IOException exceptions. And unlock does not throw IOException. Should unlock also throw both java.rmi.RemoteException and IOException. Or if these methods just throw IOExcpetion then it is fine. Also does the data close method has to throw a IOException? And does all the methods inside the Data access Interface has to throw DatabaseException, because not all methods inside Data class throws DatabaseException example getFieldInfo(). Thanks. [ September 10, 2002: Message edited by: Samual Harvey ] [ September 10, 2002: Message edited by: Samual Harvey ]
Nope. Just throw RemoteException in unlock(). unlock() simply ignores invalid requests by the requirements, so there is no need to throw IOException.
Also does the data close method has to throw a IOException?
Nope. The designer of Data has gone out of his way to ignore the possible IOException thrown by RandomAccessFile's close() method. Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Samual Harvey
Ranch Hand
Joined: Aug 06, 2002
Posts: 119
posted
0
Michael, How about this:-
And does all the methods inside the Data access Interface has to throw DatabaseException, because not all methods inside Data class throws DatabaseException example getFieldInfo().
Thanks.
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Samual, Nope. Just leave it like it is. Data has been designed to throw a DatabaseException whenever the RandomAccessFile cannot be accessed or when attempting to create or delete an invalid record. Michael Morris
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.