• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unreferenced()

 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic