69.

previous chapter table of contents next chapter
  

Transaction Identifiers

Restricting Jini transactions to a two-phase commit model without associating a particular semantics to it means that a transaction can be represented in a simple way, as a long identifier. This identifier is obtained from a transaction manager and will uniquely label the transaction to that manager. (It is not guaranteed to be unique between managers, though ”unlike service IDs.) All participants in the transaction communicate with the transaction manager using this identifier to label which transaction they belong to.

The participants in a transaction may disappear, or the transaction manager may disappear. As a result, transactions are managed by a lease, which will expire unless it is renewed. When a transaction manager is asked for a new transaction, it returns a TransactionManager.Created object, which contains the transaction identifier and lease:

 public interface TransactionManager {     public static class Created {         public final long id;         public final Lease lease;     }     ... } 

A Created object may be passed around between participants in the lease, and one of them will need to look after lease renewals. All the participants will use the transaction identifier in communication with the transaction manager.

  


A Programmer[ap]s Guide to Jini Technology
A Programmer[ap]s Guide to Jini Technology
ISBN: 1893115801
EAN: N/A
Year: 2000
Pages: 189

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net