Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

still confuse with the unreferenced()

 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
1>I still confuse with the unreferenced().
I use the record number as the key in my LockManager and the object of RemoteAccess as the
values.In my unreferenced() method(in RemoteAccess),I just call unlock(this) which will
iterate all the records in Map and remove it.
Is that right?
2>Did you refresh the combox and when ?
I think when add a new record ,maybe there will add some new origin airport,dest airpot or carrier?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray,

In my unreferenced() method(in RemoteAccess),I just call unlock(this) which will
iterate all the records in Map and remove it.
Is that right?

Probably not. You need to keep a set of locked records in each remote connection object. Then, when unreferenced() is called on that object, you iterate thru that set and call unlock() on each lock in the clint's set.
Hope this helps,
Michael Morris
 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Probably not. You need to keep a set of locked records in each remote connection object.

I have those in my LockManager.Do you mean I should have another in my RemoteDataAccess?
Or I have a set of locks which only this object have?
when unreferenced() is called on that object, you iterate thru that set and call unlock() on each lock in the clint's set.

If the unreferenced() is called ,I should unlock
all the locks even if it dose not belong to that object?
2>Did you refresh the combox and when ?
I think when add a new record ,maybe there will add some new origin airport,dest airpot or carrier?

Could you answer it?Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic