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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "About the Unreferenced" Watch "About the Unreferenced" New topic
Author

About the Unreferenced

Jack Yang
Ranch Hand

Joined: Jan 31, 2002
Posts: 59
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?


SCJD2,SCBCD,SCJWD,SCJP2
Michael Morris
Ranch Hand

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

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
Jim Bedenbaugh
Ranch Hand

Joined: Nov 09, 2001
Posts: 171
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?


Regards,
Jim
SCJP, SCJD, SCWCD, SCEA Part I
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About the Unreferenced