• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

unreferenced()

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
My RemoteData objects implement Unreferenced. When this object locks a record I assign the locked record number to a private instance variable called lockedRecord. If the client dies I have implemented the unreferenced method as follows :
public void unreferenced() {
if (this.lockedRecord != 0) {
lockManager.unlock(this, this.lockedRecord );
}
}
Is this correct?
I have tested it and it works. Is there a more elegant way of doing this?
Regards
Fred
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the unreferenced interface is so you can clean up after the client, and isn't that what you are doing, cleaning up the locked records?
Mark
 
I can't take it! You are too smart for me! Here is the tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic