Re: inconsistent exception usage + question
Greg Trasuk <[email protected]> Wed, 28 May 2008 22:19:18 -0400
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <1212027558.15608.454.camel@cameron> |
On Wed, 2008-05-28 at 19:02, James Grahn wrote: > > My question is this: > I'm using the TransactionFactory presently, and the only way I see of > testing the remaining lease time of a transaction is by getting its > lease and checking the expiration against currentTimeMillis. > > Is there a more elegant way to determine if the transaction has expired > due to a timeout? > What you really ought to do is hand the lease to a LeaseRenewalManager, so that the lease is properly renewed and the transaction lasts as long as you need it. The concept of a "transaction timeout" that you see in, for example, database transactions, is really just a nod to the fact that services have to release resources at some point. The Lease concept addresses the problem directly. When the lease holder stops renewing the lease, the service can release any resources associated with that lease. Greg. > jamesG > > =========================================================================== > To unsubscribe, send email to [email protected] and include in the body > of the message "signoff JAVASPACES-USERS". For general help, send email to > [email protected] and include in the body of the message "help". > > To view past JAVASPACES-USERS postings, please see: > http://archives.java.sun.com/archives/javaspaces-users.html -- Greg Trasuk, President StratusCom Manufacturing Systems Inc. - We use information technology to solve business problems on your plant floor. http://stratuscom.com =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff JAVASPACES-USERS". For general help, send email to [email protected] and include in the body of the message "help". To view past JAVASPACES-USERS postings, please see: http://archives.java.sun.com/archives/javaspaces-users.html