Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About the Unreferenced

 
Jack Yang
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I implement the Unrefernced interface in my RemoteDBImpl,I found after I closed my client,it would take a long time to run the unreferenced().How can I change the default time slot?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jack,
I went thru the same pain as you, worrying about the long time out for unreferenced to be called and even implemented my own time out and finally decided to scrap it and go with the default Unreferenced time out. Peter den Haan had a good discussion on this and if you do a search on Unreferenced it would be good reading. What I ultimately decided was to do each booking in a separate thread and while the booking on a particular record was pending if that row in the table was selected a busy cursor would appear and booking would be disabled. Any number of bookings could then proceed while waiting for the pending bookings to complete. In other words, waiting for a stale lock did not shut down the client.
Hope this helps,
Michael Morris
[ August 23, 2002: Message edited by: Michael Morris ]
 
Jim Bedenbaugh
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Morris:

What I ultimately decided was to do each booking in a separate thread and while the booking on a particular record was pending if that row in the table was selected a busy cursor would appear and booking would be disabled. Any number of bookings could then proceed while waiting for the pending bookings to complete. In other words, waiting for a stale lock did not shut down the client.

So did the thread message back to the client about the success of the booking or was this an asynchronous thread that just booked and ended?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jim,

So did the thread message back to the client about the success of the booking or was this an asynchronous thread that just booked and ended?

Yes. All booking operations, whether successful or not ended with a dialog popping up giving all the details. To keep up with the bookings, I used a Map in the Facade which mapped the thread to the DataInfo. The booking panel also kept a Set of pending bookings so that, if that row was selected in the table, then booking would be disabled and the cursor would be changed to busy.
Michael Morris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic