Boost logo

Boost :

Subject: Re: [boost] [transaction] New Boost.Transaction library under discussion
From: strasser_at_[hidden]
Date: 2010-01-27 12:33:50

Zitat von Vicente Botet Escriba <vicente.botet_at_[hidden]>:

> strasser wrote:
>> Zitat von Bob Walters <bob.s.walters_at_[hidden]>:
>> I´ve been thinking about introducing a RM category for that:
>> typedef one_phase_tag category;
>> //only supports one-phase commit.
>> or
>> typedef persistent_tag category;
>> //supports two-phase, persistent
>> or
>> typedef transient_tag category;
>> //supports two-phase, non-persistent
>> only when 2 or more persistent_tag RMs are used in a global
>> transaction the TM has to prepare both and write to its log to have a
>> unique commit point, otherwise the commit of the only persistent_tag
>> RM is the commit point.
>> (any ideas for a better name for "one_phase_tag"?)
> non_recoverable?

is there a reason why this can't be a Service of the resource manager?
I don't have a clear definition of a Service so far, and neither does
the XA standard linked above.
services usually are domain-specific functions intended to be called
by the user interface (e.g. a function to get an instance of a
persistent object), not functions handling transactions itself, but is
there a reason why the optional interface for distributed transactions
can't use the usual service interface?
I can't think of one right now.

the concept would probably look something like this:

concept DistributedTransactionService{
   typedef unspecified services; //MPL sequence containing
   typedef unspecified transaction;
   typedef unspecified transaction_id; //must be POD

   static bool const persistent=unspecified;

   bool prepare_transaction(transaction &);

   transaction_id get_transaction_id(transaction const &);

   template<class InputIterator> //must yield transaction_id
   void recover(InputIterator b,InputIterator e);

see and for information about

the one_phase_tag RMs discussed above would be a RM that doesn't offer
the DistributedTransactionService.

Boost list run by bdawes at, gregod at, cpdaniel at, john at