• 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

update and delete shouldnt throw RNFE?

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

In a previous post (https://coderanch.com/forums/posts/list/40/427863#2237145) Roel says that update, unlock and delete shouldnt throw RNFE.
I just wanted to expand on this a little further.

So Roel's reasoning is that the client should have first locked the record to do an update, unlock or delete.

I agree that unlock shouldn't throw RNFE - because a client may have locked, then deleted a record.

However, what about the case where we have a *dumb* client.
What if the client which owns the lock decides to delete a record, then tries to delete the record again or update it after deleting it? Shouldn't these cases throw RNFE?

Cheers,
Jason
 
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 Jason,

That's not a "dumb" client, but a serious bug from a developer. And such code should never pass through testing (could be easily found when making test cases using EasyMock for example). If the API is used correctly, a correct sequence is lock, update (or delete) and unlock. Of course that's just my opinion. Your update/delete methods may throw the RNFE, even your unlock method may do that. I documented my decision thoroughly and apparently the accessor was quiet happy with it

Kind regards,
Roel
reply
    Bookmark Topic Watch Topic
  • New Topic