• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Question about reasonability of exceptions list in the Task 1.1.1

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm a little bit confused about task 1.1.1

In the DB-interface I found:


Here is everything Ok.
Before lock the record with number recNo, I have to check whether this record exists in the database file.
If record does not exist or deleted - throw RecordNotFoundException.

But what I do not understand:

why do we need RecordNotFoundException for unlock?

for example, if I write something like

- should RecordNotFoundException occur - it will happen in the lock-method.

 
Sheriff
Posts: 11606
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pavlo,

First of all: please try to use complete words when you are posting questions, because a lot of not-native english speakers are reading and posting to these forums, and abbreviations makes things less clear, so edit your 1st post. And also provide a more meaningful title of your topic.

If the unlock method signature indicates this method could throw a RecordNotFoundException, it doesn't mean you have to throw it. Your reasoning is spot-on, I myself also didn't throw a RecordNotFoundException from the unlock method, nor from update and/or delete methods.

Kind regards,
Roel
 
Pavlo Rybakov
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Roel !

Hopefully I changed all my abbreviations.
It was without malicious intent.
 
Roel De Nijs
Sheriff
Posts: 11606
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem although I'm a regular on this forum, I had some difficulties decyphering them (could also be the brain inactivity because it's quiet late )
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic