
Zitat von Vicente Botet Escriba <vicente.botet@wanadoo.fr>:
strasser wrote:
Zitat von Bob Walters <bob.s.walters@gmail.com>:
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 distributed_transaction_service_tag 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 https://svn.boost.org/svn/boost/sandbox/persistent/libs/persistent/doc/html/... and https://svn.boost.org/svn/boost/sandbox/persistent/libs/persistent/doc/html/... for information about services. the one_phase_tag RMs discussed above would be a RM that doesn't offer the DistributedTransactionService.