This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RemoteException and IOException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RemoteException and IOException" Watch "RemoteException and IOException" New topic
Author

RemoteException and IOException

Samual Harvey
Ranch Hand

Joined: Aug 06, 2002
Posts: 119
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 ]

Samual Harvey<br />SCJP2<br />SCJD2
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Samual,

Currenlty my lock method inside Data throws both java.rmi.RemoteException and java.io.IOException exceptions.

Actually you don't even have to throw RemoteException from lock() since RemoteException is an IOException.

... And unlock does not throw IOException. Should unlock also throw both java.rmi.RemoteException and IOException.

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
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
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://aspose.com/file-tools
 
subject: RemoteException and IOException
 
Similar Threads
Writing Data Client
Local and remote interfaces
Diffrent Excpetion thrown by Data class constructor & methods
FBN : Exception in High level Data Interface
Basic design for review