aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: URLyBird 1.2 - Handling IOExceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "NX: URLyBird 1.2 - Handling IOExceptions" Watch "NX: URLyBird 1.2 - Handling IOExceptions" New topic
Author

NX: URLyBird 1.2 - Handling IOExceptions

Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
The way to communicate an IOException to a Data class method caller, without changing the methods signatures, has been discussed already : I'll wrap it in a custom runtime exception (DataIOException for example) that I will document.
But now I wonder if it does make sense (except for EOFExceptions) to let subsequent calls to run successfully or if it is better to :
  • flag the database as "corrupted"
  • while the flag is on (reset when the db is reopened), throw DataIOException in all methods that read and/or write in the DB without attempting to do it


  • The main idea is to avoid to read/write further in the DB from the moment you know it is corrupted.
    What do you think about it ?
    Regards,
    Philippe.
    Vlad Rabkin
    Ranch Hand

    Joined: Jul 07, 2003
    Posts: 555
    Hi,
    I beleive it is your personal design decision.
    My strategy is
    - to let the clients work as long as possible.
    - try not inhance design more than it is needed,
    because by doing that we can breach specification.
    I have seen here a lot of people, who tried to make inhancement (e.g time-outs for Locking) and failed...
    So, I will not do, what U suggest.
    Jim Yingst
    Wanderer
    Sheriff

    Joined: Jan 30, 2000
    Posts: 18670
    I agree with Vlad here.


    "I'm not back." - Bill Harding, Twister
     
    I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
     
    subject: NX: URLyBird 1.2 - Handling IOExceptions
     
    Similar Threads
    synchronized in Database singleton class
    nx: All of URLy Bird 1.1.3 read/write lock(2)
    NX: Exception handling implementing the DBAccess
    Pulling up File Permissions using Java API ???
    End of file indication