aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes still confuse with the unreferenced() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "still confuse with the unreferenced()" Watch "still confuse with the unreferenced()" New topic
Author

still confuse with the unreferenced()

Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
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

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Ray Cheeny
Ranch Hand

Joined: Aug 21, 2002
Posts: 74
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.
 
Don't get me started about those stupid light bulbs.
 
subject: still confuse with the unreferenced()