• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 11604
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: 11604
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 )
 
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic