Re: inconsistent exception usage + question

James Grahn <[email protected]> Wed, 28 May 2008 22:58:20 -0400
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Actually, I'm attempting to use the transaction's lease for the purpose 
you outlined below: to release resources.   The issue is that it's not 
just Jini resources that I need to release, so I'm looking for an 
orderly failure that I can intercept and react to.

I don't need to renew the lease; I want the timeout to occur.   But I 
need a method by which I can postmortem the failure of the transaction 
to verify that it was indeed the timeout (rather than, say, the 
transaction manager coming down or the transaction already being 
committed/aborted).

jamesG

Greg Trasuk wrote:
> 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

===========================================================================
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