Network Working Group                                         K. Evans
Request for Comments: 2372                                    J. Klein
Category: Informational                               Tandem Computers
                                                               J. Lyon
                                                             Microsoft
                                                             July 1998
        
Network Working Group                                         K. Evans
Request for Comments: 2372                                    J. Klein
Category: Informational                               Tandem Computers
                                                               J. Lyon
                                                             Microsoft
                                                             July 1998
        

Transaction Internet Protocol - Requirements and Supplemental Information

交易互联网协议-要求和补充信息

Status of this Memo

本备忘录的状况

This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited.

本备忘录为互联网社区提供信息。它没有规定任何类型的互联网标准。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (1998). All Rights Reserved.

版权所有(C)互联网协会(1998年)。版权所有。

Abstract

摘要

This document describes the purpose (usage scenarios), and requirements for the Transaction Internet Protocol [1]. It is intended to help qualify the necessary features and functions of the protocol. It also provides supplemental information to aid understanding and facilitate implementation of the TIP protocol.

本文档描述了交易互联网协议的用途(使用场景)和要求[1]。其目的是帮助确认协议的必要特性和功能。它还提供补充信息,以帮助理解和促进TIP协议的实施。

Table of Contents

目录

1. Introduction 2 2. The Transaction Internet Protocol 3 3. Scope 4 4. Anticipated Usage of TIP 4 5. TIP Compliant Systems 4 6. Relationship to the X/Open DTP Model 5 7. Example TIP Usage Scenario 5 8. TIP Transaction Recovery 9 9. TIP Transaction and Application Message Serialisation 10 10. TIP Protocol and Local Actions 10 11. Security Considerations 11 12. TIP Requirements 11 References 14 Authors' Addresses 15 Comments 15 A. An Example TIP Transaction Manager API 16 Full Copyright Statement 24

1. 导言2。交易互联网协议3。范围4。提示4和5的预期用途。TIP兼容系统4 6。与X/Open DTP型号5 7的关系。示例提示使用场景5 8。提示事务恢复9。提示事务和应用程序消息序列化10。TIP协议和本地操作10 11。安全考虑11 12。TIP要求11引用了14位作者的地址15评论15 A。示例TIP事务管理器API 16完整版权声明24

1. Introduction
1. 介绍

Transactions are a very useful programming paradigm, greatly simplifying the writing of distributed applications. When transactions are employed, no matter how many distributed application components participate in a particular unit-of-work, the number of possible outcomes is reduced to only two; that is, either all of the work completed successfully, or none of it did (this characteristic is known as atomicity). Applications programming is therefore much less complex since the programmer does not have to deal with a multitude of possible failure scenarios. Typically, transaction semantics are provided by some underlying system infrastructure (usually in the form of products such as Transaction Processing Monitors, and/or Databases). This infrastructure deals with failures, and performs the necessary recovery actions to guarantee the property of atomicity. The use of transactions enables the development of reliable distributed applications which would otherwise be difficult, if not impossible.

事务是一种非常有用的编程范式,极大地简化了分布式应用程序的编写。当使用事务时,无论有多少分布式应用程序组件参与到特定的工作单元中,可能的结果数量减少到只有两个;也就是说,要么所有的工作都成功完成了,要么一个也没有完成(这个特性称为原子性)。因此,应用程序编程不那么复杂,因为程序员不必处理大量可能的故障场景。通常,事务语义由一些底层系统基础设施(通常以产品的形式,如事务处理监视器和/或数据库)提供。此基础结构处理故障,并执行必要的恢复操作以保证原子性的属性。事务的使用使得开发可靠的分布式应用程序成为可能,否则即使不是不可能,也是很困难的。

A key technology required to support distributed transactions is the two-phase commit protocol (2-pc). 2-pc protocols have been used in commercial Transaction Processing (TP) systems for many years, and are well understood (e.g. the LU6.2 2-pc (syncpoint) protocol was first implemented more than 12 years ago). Today a number of different 2-pc protocols are supported by a variety of TP monitor and database products. 2-pc is used between the components participating in a distributed unit-of-work (transaction) to ensure agreement by all parties regarding the outcome of that work (regardless of any failure).

支持分布式事务所需的一项关键技术是两阶段提交协议(2-pc)。2-pc协议已在商业事务处理(TP)系统中使用多年,并已为人们所熟知(例如,LU6.2 2-pc(syncpoint)协议在12年前首次实施)。如今,各种TP监视器和数据库产品支持多种不同的2-pc协议。2-pc用于参与分布式工作单元(事务)的组件之间,以确保各方就该工作的结果达成一致(无论是否出现故障)。

Today both standard and proprietary 2-pc protocols exist. These protocols typically employ a "one-pipe" model. That is, the transaction and application protocols are tightly-integrated, executing over the same communications channel. An application may use only the particular communications mechanism associated with the transaction protocol. The standard protocols (OSI TP, LU6.2) are complex, with a large footprint and extensive configuration and administration requirements. For these reasons they are not very widely deployed. The net of all this is restricted application flexibility and interoperability if transactions are to be used. Applications may wish to use a number of communications protocols for which there are no transactional variants (e.g. HTTP), and be deployed in very heterogeneous application environments.

如今,标准和专有的2-pc协议都存在。这些协议通常采用“一个管道”模型。也就是说,事务和应用程序协议紧密集成,在同一通信通道上执行。应用程序可以仅使用与事务协议相关联的特定通信机制。标准协议(OSI TP,LU6.2)非常复杂,占用空间大,需要大量的配置和管理。由于这些原因,它们没有得到广泛的部署。如果要使用事务,所有这些都会限制应用程序的灵活性和互操作性。应用程序可能希望使用一些没有事务变体(例如HTTP)的通信协议,并部署在非常异构的应用程序环境中。

In summary, transactions greatly simplify the programming of distributed applications, and the 2-pc protocol is a key transactional technology. Current 2-pc protocols only offer transaction semantics to a limited set of applications, operating

总之,事务大大简化了分布式应用程序的编程,2-pc协议是一项关键的事务技术。当前的2-pc协议仅为有限的一组应用程序提供事务语义,包括

within a special-purpose (complex, homogeneous) infrastructure, using a particular set of intercommunication protocols. The restrictions thus imposed by current 2-pc protocols limits the widespread use of the transaction paradigm, thereby inhibiting the development of new distributed business applications.

在专用(复杂、同质)基础设施内,使用一组特定的内部通信协议。因此,当前2-pc协议施加的限制限制了事务范式的广泛使用,从而抑制了新的分布式业务应用程序的开发。

(See [2] for more information re transactions, atomicity, and two-phase commit protocols in general.)

(请参阅[2]以了解有关一般的重新事务、原子性和两阶段提交协议的更多信息。)

2. The Transaction Internet Protocol (TIP)
2. 交易互联网协议(TIP)

TIP is a 2-pc protocol which is intended to provide ubiquitous distributed transaction support, in a heterogeneous (networked) environment. TIP removes the restrictions of current 2-pc protocols and enables the development of new distributed business applications.

TIP是一种2-pc协议,旨在在异构(网络化)环境中提供无处不在的分布式事务支持。TIP消除了当前2-pc协议的限制,并支持开发新的分布式业务应用程序。

This goal is achieved primarily by satisfying two key requirements:

这一目标主要通过满足两个关键要求来实现:

1) Keep the protocol simple (yet functionally sufficient). If the protocol is complex it will not be widely deployed or quickly adopted. Simplicity also means suitability to a wide range of application environments.

1) 保持协议简单(但功能足够)。如果协议很复杂,它将不会被广泛部署或迅速采用。简单性还意味着适用于广泛的应用程序环境。

2) Enable the protocol to be used with any applications communications protocol (e.g. HTTP). This ensures heterogeneous environments can participate in distributed work.

2) 允许协议与任何应用程序通信协议(例如HTTP)一起使用。这确保了异构环境可以参与分布式工作。

TIP does not reinvent the 2-pc protocol itself, the well-known presumed-abort 2-pc protocol is used as a basis. Rather the novelty and utility of TIP is in its separation from the application communications protocol (the two-pipe model).

TIP并没有重新发明2-pc协议本身,而是以众所周知的假定中止2-pc协议为基础。相反,TIP的新颖性和实用性在于它与应用程序通信协议(双管模型)的分离。

      +-------------+ Application Communication +-------------+
      | Application |---------------------------| Application |
      |   Program   |         "Pipe 1"          |   Program   |
      +-------------+                           +-------------+
             |                                         |
             | TIP TM API                   TIP TM API |
             |                                         |
    +-----------------+   TIP 2-pc Protocol   +-----------------+
    | TIP Transaction |-----------------------| TIP Transaction |
    |     Manager     |       "Pipe 2"        |     Manager     |
    +-----------------+                       +-----------------+
        
      +-------------+ Application Communication +-------------+
      | Application |---------------------------| Application |
      |   Program   |         "Pipe 1"          |   Program   |
      +-------------+                           +-------------+
             |                                         |
             | TIP TM API                   TIP TM API |
             |                                         |
    +-----------------+   TIP 2-pc Protocol   +-----------------+
    | TIP Transaction |-----------------------| TIP Transaction |
    |     Manager     |       "Pipe 2"        |     Manager     |
    +-----------------+                       +-----------------+
        

Fig 1: The two-pipe nature of TIP

图1:TIP的双管特性

3. Scope
3. 范围

TIP does not describe how business transactions or electronic commerce are to be conducted on the internet, it specifies only the 2-pc transaction protocol (which is an aid in the development of such applications). e.g. TIP does not provide a mechanism for non-repudiation. Such protocols might be a subject for subsequent IETF activity, once the requirements for general electronic commerce are better understood. TIP does not preclude the later definition of these protocols.

TIP没有描述如何在互联网上进行商业交易或电子商务,它只指定了2-pc交易协议(这有助于开发此类应用程序)。e、 g.TIP不提供不可抵赖机制。一旦对一般电子商务的要求有了更好的了解,此类协议可能成为后续IETF活动的主题。TIP不排除这些协议的后续定义。

TIP does not specify Application Programming Interfaces (note that an example TIP TM API is included in this document (Appendix A), as an aid to understanding).

TIP未指定应用程序编程接口(请注意,本文档(附录A)中包含了一个示例TIP TM API,以帮助理解)。

4. Anticipated Usage of TIP
4. TIP的预期用途

As described above, transactions are a very useful tool in simplifying the programming of distributed applications. TIP is therefore targeted at any application that involves distributed work. Such applications may comprise components executing within a single system, across a corporate intranet, across the internet, or any other distributed system configuration. The application may be of "enterprise" class (requiring high-levels of performance and availability), or be less demanding. TIP is intended to be generally applicable, meeting the requirements of any application type which would benefit from the provision of transaction semantics.

如上所述,事务是简化分布式应用程序编程的非常有用的工具。因此,TIP针对的是任何涉及分布式工作的应用程序。此类应用程序可包括在单个系统内、跨公司内部网、跨互联网或任何其他分布式系统配置执行的组件。该应用程序可能属于“企业”级(需要高水平的性能和可用性),也可能要求较低。TIP旨在普遍适用,满足任何应用程序类型的要求,这些应用程序类型将受益于事务语义的提供。

5. TIP Compliant Systems
5. TIP兼容系统

There are two classes of TIP compliant Transaction Manager system:

有两类符合TIP的事务管理器系统:

1) Client-only systems. Those which provide an application interface to demarcate TIP transactions, but which do not offer access to local recoverable resources. Such a lightweight implementation is useful for systems which host client applications only (e.g. desktop machines). Such client systems may be unreliable, and are not appropriate as transaction coordinators (their unavailability might cause resources on other transaction participant systems to remain locked and unavailable). These so-called "volatile client" systems therefore delegate the responsibility to coordinate the transaction (and recover from failures), to other "full" (server) TIP system implementations. For these lightweight systems, only the TIP IDENTIFY, BEGIN, COMMIT, and ABORT commands are needed; no transaction log is required.

1) 仅客户端系统。提供应用程序接口来划分TIP事务,但不提供对本地可恢复资源的访问的那些。这种轻量级实现对于仅承载客户端应用程序的系统(例如桌面计算机)非常有用。此类客户端系统可能不可靠,不适合作为事务协调员(其不可用可能导致其他事务参与者系统上的资源保持锁定和不可用)。因此,这些所谓的“易失性客户端”系统将协调事务(并从故障中恢复)的责任委托给其他“完整”(服务器)TIP系统实现。对于这些轻量级系统,只需要TIP标识、开始、提交和中止命令;不需要事务日志。

2) Server systems. Those which offer the above support, plus TIP transaction coordination and recovery services. These systems may also provide access to recoverable resources (e.g. relational databases). Server systems support all TIP commands, and provide a recoverable transaction log.

2) 服务器系统。提供上述支持的服务,以及TIP交易协调和恢复服务。这些系统还可以提供对可恢复资源(例如关系数据库)的访问。服务器系统支持所有TIP命令,并提供可恢复的事务日志。

A TIP compliant Transaction Manager (TM), will also supply application programming interfaces to demarcate transactions (e.g. the X/Open TX interface [3]), plus commands to generate TIP URLs, to PUSH/PULL TIP transactions, and to set the current TIP transaction context. TIP support can be added to TMs with existing APIs and 2-pc protocols, and transactions may comprise both proprietary and TIP transaction branches (it is assumed existing TM implementations will provide "TIP gateway" facilities which will coordinate between TIP and other transaction protocols).

与TIP兼容的事务管理器(TM)还将提供应用程序编程接口来划分事务(例如,X/Open TX接口[3]),以及生成TIP URL、推/拉TIP事务以及设置当前TIP事务上下文的命令。TIP支持可通过现有API和2-pc协议添加到TMs中,事务可包括专有和TIP事务分支(假设现有TM实施将提供“TIP网关”设施,该设施将协调TIP和其他事务协议)。

6. Relationship to the X/Open DTP Model
6. 与X/Open DTP模型的关系

The X/Open Distributed Transaction Processing (DTP) Model [4] defines four components: 1) Application Program (AP), 2) Transaction Manager (TM), 3) Resource Manager (RM), and 4) Communications Resource Manager (CRM). In this model, TIP defines a TM to TM interoperability protocol, which is independent of application communications (there is no such equivalent protocol specified by X/Open, where all transaction and application communication occurs between CRMs (the one-pipe model)). Programmatic interfaces between the AP and TM/RM are unaffected by, and may be used with TIP. The TM to RM interaction is defined via the X/Open XA interface specification [5]. TIP is compatible with XA, and a TIP transaction may comprise applications accessing multiple RMs where the XA interface is being used to coordinate the RM transaction branches.

X/Open分布式事务处理(DTP)模型[4]定义了四个组件:1)应用程序(AP)、2)事务管理器(TM)、3)资源管理器(RM)和4)通信资源管理器(CRM)。在该模型中,TIP定义了一个TM-to-TM互操作性协议,该协议独立于应用程序通信(X/Open没有指定此类等效协议,其中所有事务和应用程序通信都发生在CRM之间(单管模型))。AP和TM/RM之间的编程接口不受TIP的影响,可与TIP一起使用。TM到RM交互是通过X/Open XA接口规范定义的[5]。TIP与XA兼容,TIP事务可能包括访问多个RM的应用程序,其中XA接口用于协调RM事务分支。

7. Example TIP Usage Scenario
7. 示例提示使用场景

It is expected that a typical internet usage of TIP will involve applications using the agency model. In this model, the client node itself is not directly involved in the TIP protocol at all, and does not need the services of a local TIP TM. Instead, an agency (server) application handles the dialogue with the client, and is responsible for the coordination of the TIP transaction. The agency works with other service providers to deliver the service to the client. e.g. as a Travel Agency acts as an intermediate between airlines/hotels/etc and the customer. A big benefit of this model is that the agency is trusted by the service providers, and there are fewer such agencies (compared to user clients), so issues of security and performance are reduced.

预计TIP的典型互联网使用将涉及使用代理模式的应用程序。在该模型中,客户端节点本身根本不直接参与TIP协议,并且不需要本地TIP TM的服务。相反,代理(服务器)应用程序处理与客户端的对话,并负责协调TIP事务。该机构与其他服务提供商合作,向客户提供服务。e、 g.作为一家旅行社,它充当航空公司/酒店/等与客户之间的中间人。该模型的一大好处是,代理受到服务提供商的信任,并且此类代理较少(与用户客户端相比),因此安全性和性能问题减少。

Consider a Travel Agency example. A client running a web browser on a network PC accesses the Travel Agency web page. Via pages served up by the agency (which may in turn be constructed from pages provided by the airline and hotel servers), the client creates an itinerary involving flights and hotel choices. Finally, the client clicks the "make reservation" button. At this point the following sequence of events occurs (user-written application code is invoked by the various web servers, via any of the standard or proprietary techniques available (e.g. CGI)):

Consider a Travel Agency example. A client running a web browser on a network PC accesses the Travel Agency web page. Via pages served up by the agency (which may in turn be constructed from pages provided by the airline and hotel servers), the client creates an itinerary involving flights and hotel choices. Finally, the client clicks the "make reservation" button. At this point the following sequence of events occurs (user-written application code is invoked by the various web servers, via any of the standard or proprietary techniques available (e.g. CGI)):translate error, please retry

1) The travel agency begins a local transaction, and gets a TIP URL for this transaction (both of these functions are performed using the API of the local TM. e.g. "tip_xid_to_url()" would return the TIP URL for the local transaction). The TIP URL contains the listening endpoint IP address of the local TM and the transaction identifier of the local transaction.

1) 旅行社开始本地交易,并获取该交易的提示URL(这两个功能都使用本地TM的API执行。例如,“TIP_xid_to_URL()”将返回本地交易的提示URL)。TIP URL包含本地TM的侦听端点IP地址和本地事务的事务标识符。

2) The travel agency application sends a request to the airline server (via some protocol (e.g. HTTP)), requesting the "book_flight" service, passing the flights selected by the client, and the TIP URL (obtained in 1. above).

2) 旅行社应用程序向航空公司服务器发送一个请求(通过一些协议(例如HTTP)),请求“book_flight”服务,传递客户端选择的航班和TIP URL(在上面1.中获得)。

3) The request is received by the airline server which invokes the book_flight application. This application retrieves the TIP URL from the input data, and passes this on a "tip_pull()" API request to its local TM. The tip_pull() function causes the following to occur:

3) 请求由调用book_flight应用程序的航空公司服务器接收。此应用程序从输入数据检索TIP URL,并通过“TIP_pull()”API请求将其传递给其本地TM。函数的作用是:

a. the local TM creates a local transaction (under which the work will be performed),

a. 本地TM创建本地事务(根据该事务执行工作),

b. if a TIP connection does not already exist to the superior (travel agency) TM (as identified via the IP address passed in the TIP URL), one is created and an IDENTIFY exchange occurs (if multiplexing is to be used on the connection, this is followed by a MULTIPLEX exchange),

b. 如果到superior(travel agency)TM的TIP连接尚不存在(通过TIP URL中传递的IP地址标识),则会创建一个TIP连接并进行标识交换(如果要在连接上使用多路复用,则随后进行多路复用交换),

c. a PULL command is sent to the superior TM,

c. 向上级TM发送拉动命令,

d. in response to the PULL, the superior TM associates the subordinate (airline) TM with the transaction (by associating the connection with the transaction), and sends a PULLED response to the subordinate TM,

d. 为了响应拉取,上级TM将下级(航空公司)TM与事务关联(通过将连接与事务关联),并向下级TM发送拉取响应,

e. the subordinate TM returns control to the book_flight application, which is now executing in the context of the newly created local transaction.

e. 从属TM将控制权返回给book_flight应用程序,该应用程序现在正在新创建的本地事务的上下文中执行。

4) The book_flight application does its work (which may involve access to a recoverable resource manager (e.g. an RDBMS), in which case the local TM will associate the RM with the local transaction (via the XA interface or whatever)).

4) book_flight应用程序执行其工作(可能涉及访问可恢复资源管理器(如RDBMS),在这种情况下,本地TM将RM与本地事务关联(通过XA接口或其他方式)。

5) The book_flight application returns to the travel agency application indicating success.

5) book_flight应用程序返回到旅行社应用程序,表示成功。

6) Steps 2-5 are then repeated with the hotel server "book_room" application. At the conclusion of this, the superior TM has registered two subordinate TMs as participants in the transaction, there are TIP connections between the agency TM and the airline and hotel TMs, and there are inflight transactions at the airline and hotel servers. [Note that steps 2-5 and 6 could be performed in parallel.]

6) 然后对酒店服务器“book_room”应用程序重复步骤2-5。最后,superior TM已将两个下属TMs注册为交易参与者,代理商TM与航空公司和酒店TMs之间存在TIP连接,航空公司和酒店服务器上存在机上交易。[注意,步骤2-5和6可以并行执行。]

7) The travel agency application issues a "commit transaction" request (using the API of the local TM). The local TM sends a PREPARE command on the TIP connections to the airline and hotel TMs (as these are registered as subordinate transaction participants).

7) 旅行社应用程序发出“提交事务”请求(使用本地TM的API)。本地TM在TIP连接上向航空公司和酒店TMs发送一个PREPARE命令(因为它们已注册为下级事务参与者)。

8) The TMs at the airline and hotel servers perform the necessary steps to prepare their local recoverable resources (e.g. by issuing xa_prepare() requests). If successful, the subordinate TMs change their TIP transaction state to Prepared, and log recovery information (e.g. local and superior transaction branch identifiers, and the IP address of the superior TM). The subordinate TMs then send PREPARED commands to the superior TM.

8) 航空公司和酒店服务器上的TMs执行必要的步骤来准备其本地可恢复资源(例如,通过发出xa_prepare()请求)。如果成功,下级TM将其TIP事务状态更改为“已准备”,并记录恢复信息(例如本地和上级事务分支标识符,以及上级TM的IP地址)。然后,下级TM向上级TM发送准备好的命令。

9) If both subordinates respond PREPARED, the superior TM logs that the transaction is Committed, with recovery information (e.g. local and subordinate transaction identifiers, and subordinate TM IP addresses). The superior TM then sends COMMIT commands on the two subordinate TIP connections.

9) 如果两个下级都已准备好响应,上级TM将记录事务已提交,并提供恢复信息(例如本地和下级事务标识符以及下级TM IP地址)。然后上级TM在两个下级TIP连接上发送提交命令。

10) The TMs at the airline and hotel servers perform the necessary steps to commit their local recoverable resources (e.g. by issuing xa_commit() requests). The subordinate TMs forget the transaction. The subordinate TMs then send COMITTED commands to the superior TM.

10) 航空公司和酒店服务器上的TMs执行必要的步骤以提交其本地可恢复资源(例如,通过发出xa_commit()请求)。下级TMs忘记了事务。然后,下级TM向上级TM发送COMITED命令。

11) The superior TM forgets the transaction. The TIP connections between the superior and subordinate TMs return to Idle state (not associated with any transaction). The superior TM returns success to the travel agency application "commit transaction" request.

11) 上级TM忘记了交易。上级和下级TMs之间的TIP连接返回空闲状态(与任何事务无关)。superior TM向旅行社申请“提交交易”请求返回成功。

12) The travel agency application returns "reservation made" to the client.

12) 旅行社申请将“预订”返回给客户。

This example illustrates the use of PULL. If PUSH were to be used instead, events 2) and 3) above would change as follows:

这个例子说明了PULL的用法。如果改为使用推送,则上述事件2)和3)的变化如下:

2) The travel agency application:

2) 旅行社申请:

a. passes the TIP URL obtained in 1. above, together with the listening endpoint address of the TM at the airline server, to its local TM via a "tip_push()" API request. The tip_push() function causes the following to occur:

a. 传递在1中获得的提示URL。以及航空公司服务器上TM的侦听端点地址,通过“tip_push()”API请求发送到其本地TM。函数的作用是:

i. if a TIP connection does not already exist to the subordinate (airline server) TM (as identified via the IP address passed on the tip_push), one is created and an IDENTIFY exchange occurs (if multiplexing is to be used on the connection, this is followed by a MULTIPLEX exchange),

i. 如果到从属(航空公司服务器)TM的TIP连接尚不存在(通过TIP_push上传递的IP地址标识),则会创建一个TIP连接并进行标识交换(如果要在连接上使用多路复用,则随后进行多路复用交换),

ii. a PUSH command is sent to the subordinate TM,

二,。向下级TM发送推送命令,

iii. in response to the PUSH, the subordinate TM creates a local transaction, associates this transaction with the connection, and sends a PUSHED response to the superior TM,

iii.为了响应推送,下级TM创建本地事务,将该事务与连接关联,并向上级TM发送推送响应,

iv. in response to the PUSHED response, the superior TM associates the subordinate TM with the transaction,

iv.响应推送响应,上级TM将下级TM与交易关联,

v. the superior TM returns control to the travel agency application.

v. superior TM将控制权返回给旅行社应用程序。

b. the travel agency application sends a request to the airline server (via some protocol (e.g. HTTP)), requesting the "book_flight" service, passing the flights selected by the client, and the TIP URL (obtained in 1 above).

b. 旅行社应用程序向航空公司服务器发送一个请求(通过一些协议(例如HTTP)),请求“book_flight”服务,传递客户端选择的航班和TIP URL(在上面的1中获得)。

3) The request is received by the airline server which invokes the book_flight application. This application retrieves the TIP URL from the input data, and passes this on a "tip_pull()" API request to its local TM. Since the local TM has already "seen" this URL (it was already pushed), it simply returns to the book_flight application, which is now executing in the context of the previously created local transaction.

3) 请求由调用book_flight应用程序的航空公司服务器接收。此应用程序从输入数据检索TIP URL,并通过“TIP_pull()”API请求将其传递给其本地TM。因为本地TM已经“看到”了这个URL(它已经被推送),所以它只返回到book_flight应用程序,该应用程序现在正在先前创建的本地事务的上下文中执行。

[Note that although in this example the transaction coordinator role is performed by a node which is also a participant in the transaction (the Travel Agency), other configurations are possible (e.g. where the transaction coordinator role is performed by a non-participant 3rd-party node).]

[注意,尽管在本例中,交易协调员角色由同时也是交易参与者的节点(旅行社)执行,但也可以进行其他配置(例如,交易协调员角色由非参与者第三方节点执行)。]

8. TIP Transaction Recovery
8. TIP事务恢复

Until the transaction reaches the Prepared state, any failure results in the transaction being aborted. If an error occurs once the transaction has reached the Prepared state, then transaction recovery must be performed. Recovery behaviour is different for superior and subordinate; the details depend upon the outcome of the transaction (committed or aborted), and the precise point at which failure occurs.

在事务达到准备状态之前,任何失败都会导致事务中止。如果事务达到准备状态后发生错误,则必须执行事务恢复。上级和下级的恢复行为不同;详细信息取决于事务的结果(提交或中止),以及故障发生的确切时间点。

In the travel agency application for example, if the connection to the hotel server fails before the COMMIT command has been received by the hotel TM, then (once the connection is restored):

例如,在旅行社应用程序中,如果在hotel TM收到COMMIT命令之前,与酒店服务器的连接失败,则(一旦连接恢复):

1) The superior (travel agency) TM sends a RECONNECT command (passing the subordinate transaction identifier (recovered from the transaction log if necessary)).

1) 上级(旅行社)TM发送重新连接命令(传递下级事务标识符(必要时从事务日志恢复))。

2) The subordinate (hotel) TM responds RECONNECTED (since it never received the COMMIT command, and still has the transaction in Prepared state (if the failure had occurred after the subordinate had responded COMMITTED, then the subordinate would have forgotten the transaction, and responded NOTRECONNECTED to the RECONNECT command)).

2) 下级(hotel)TM响应已重新连接(因为它从未收到COMMIT命令,并且事务仍处于准备状态(如果故障发生在下级响应已提交之后,则下级将忘记事务,并响应NOTRONECONNECT命令))。

3) The superior TM sends a COMMIT command. The subordinate TM commits the transaction and responds COMMITTED. The transaction is now resolved.

3) 上级TM发送提交命令。下级TM提交事务并响应提交的事务。交易现在已解决。

4) If the subordinate TM restores the connection to the superior TM before receiving a RECONNECT command, then it may send a QUERY command. In this case, the superior TM will respond QUERIEDEXISTS, and the subordinate TM should wait for the superior to send a RECONNECT command. If the transaction had been aborted, then the superior may respond QUERIEDNOTFOUND, in which case the subordinate should abort the transaction (note that the superior is not obliged to send a RECONNECT command for an aborted transaction (i.e. it could just forget the transaction after sending ABORT and before receiving an ABORTED response)).

4) 如果下级TM在收到重新连接命令之前恢复与上级TM的连接,则可能会发送查询命令。在这种情况下,上级TM将响应QUERIEDEXISTS,下级TM应等待上级发送重新连接命令。如果事务已中止,则上级可能会响应QUERIEDNOTFOUND,在这种情况下,下级应中止事务(注意,上级没有义务为中止的事务发送重新连接命令(即,在发送中止后和接收中止响应之前,它可能会忘记事务))。

There are failure circumstances in which the client application (the one calling "commit") may not receive a response indicating the final outcome of the transaction (even though the transaction itself is successfully completed). This is a common problem, and one not unique to TIP. In such circumstances, it is up to the application to ascertain the final outcome of the transaction (a TIP TM may facilitate this by providing some implementation specific mechanism. e.g. writing the outcome to a user-log).

在某些失败情况下,客户端应用程序(调用“提交”的应用程序)可能无法收到指示事务最终结果的响应(即使事务本身已成功完成)。这是一个常见的问题,不是TIP独有的问题。在这种情况下,由应用程序确定事务的最终结果(TIP TM可以通过提供一些特定于实现的机制来促进这一点,例如,将结果写入用户日志)。

9. TIP Transaction and Application Message Serialisation
9. TIP事务和应用程序消息序列化

A relationship exists between TIP commands and application messages: a TIP transaction must not be committed until it is certain that all participants have properly registered, and have finished work on the transaction. Because of the two-pipe nature of TIP, this behaviour cannot necessarily be enforced by the TIP system itself (although it may be possible in some implementations). It is therefore incumbent upon the application to behave properly. Generally, an application must not:

TIP命令和应用程序消息之间存在一种关系:在确定所有参与者都已正确注册并完成事务处理之前,不得提交TIP事务。由于TIP的双管特性,这种行为不一定由TIP系统本身强制执行(尽管在某些实现中可能)。因此,应用程序有义务正确操作。一般而言,申请不得:

1) call it's local TMs "commit" function when it has any requests associated with the transaction still outstanding.

1) 当它有任何与事务相关的请求尚未完成时,调用它的本地TMs“commit”函数。

2) positively respond to a transactional request from a partner application prior to having registered it's local TM with the transaction.

2) 在向事务注册其本地TM之前,积极响应合作伙伴应用程序的事务请求。

10. TIP Protocol and Local Actions
10. TIP协议和本地操作

In order to ensure that transaction atomicity is properly guaranteed, a system implementing TIP must perform other local actions at certain points in the protocol exchange. These actions pertain to the creation and deletion of transaction "log-records" (the necessary information which survives failures and ensures that transaction recovery is correctly executed). The following information regarding the relationship between the TIP protocol and logging events is advisory, and is not intended to be definitive (see [2] for more discussion on this subject):

为了确保事务原子性得到适当保证,实现TIP的系统必须在协议交换中的某些点执行其他本地操作。这些操作与创建和删除事务“日志记录”(在故障中幸存下来并确保正确执行事务恢复的必要信息)有关。关于TIP协议和日志记录事件之间关系的以下信息是建议性的,并不打算确定(有关此主题的更多讨论,请参见[2]):

1) before sending a PREPARED response, the system should create a prepared-recovery-record for the transaction.

1) 在发送准备好的响应之前,系统应为事务创建准备好的恢复记录。

2) having created a prepared-recovery-record, this record should not be deleted until after: a. an ABORT message is received; or b. a COMMIT message is received; or c. a QUERIEDNOTFOUND response is received.

2) 创建了准备好的恢复记录后,在以下时间之前不应删除此记录:a。接收到中止消息;或者b。接收到提交消息;或者c。收到QUERIEDNOTFOUND响应。

3) the system should not send a COMMITTED or NOTRECONNECTED message if a prepared-recovery-record exists.

3) 如果存在准备好的恢复记录,则系统不应发送已提交或未重新连接的消息。

4) before creating a commit-recovery-record for the transaction, the system should have received a PREPARED response.

4) 在为事务创建提交恢复记录之前,系统应已收到准备好的响应。

5) before sending a COMMIT message in Prepared state, the system should have created a commit-recovery-record for the transaction.

5) 在以准备状态发送提交消息之前,系统应该已经为事务创建了提交恢复记录。

6) having created a commit-recovery-record, this record should not be deleted until after: a. a COMMITTED message is received; or b. a NOTRECONNECTED message is received.

6) 创建了提交恢复记录后,在:a之后才应删除此记录。接收到提交的消息;或者b。接收到未重新连接的消息。

11. Security Considerations
11. 安全考虑

The means by which applications communicate and perform distributed work are outside the scope of the TIP protocol. The mechanisms used for authentication and authorisation of clients to access programs and information on a particular system are part of the application communications protocol and the application execution infrastructure. Use of the TIP protocol does not affect these considerations.

应用程序通信和执行分布式工作的方式不在TIP协议的范围内。用于验证和授权客户端访问特定系统上的程序和信息的机制是应用程序通信协议和应用程序执行基础结构的一部分。使用TIP协议不会影响这些注意事项。

Security relates to the TIP protocol itself inasmuch that systems require to protect themselves from the receipt of unauthorised TIP commands, or the impersonation of a trusted partner TIP TM. Probably the worst consequence of this is the possibility of undetected data inconsistency resulting from violations of the TIP commitment protocol (e.g. a COMMIT command is injected on a TIP connection in place of an ABORT command). TIP uses the Transport Layer Security protocol [6] to restrict access to only trusted partners (i.e. to control from which remote endpoints TIP transactions will be accepted, and to verify that an end-point is genuine), and to encrypt TIP commands. Usage of TLS (or not) is negotiated between partner TIP TMs. See [1] for details of how TLS is used with TIP.

安全性与TIP协议本身有关,因为系统需要保护自己免受未经授权的TIP命令的接收或受信任伙伴TIP TM的模拟。最糟糕的后果可能是,违反TIP提交协议(例如,在TIP连接上注入提交命令而不是中止命令)可能导致未检测到的数据不一致。TIP使用传输层安全协议[6]将访问权限限制为仅受信任的合作伙伴(即,控制接受TIP事务的远程端点,并验证端点是否真实),以及加密TIP命令。TLS的使用(或不使用)由合作伙伴TIP TMs协商。有关TLS如何与TIP一起使用的详细信息,请参见[1]。

TIP TM implementations will also likely provide local means to time-out and abort transactions which have not completed within some time period (thereby preventing unavailability of resources due to malicious intent). Transaction time-out also serves as a means of deadlock resolution.

TIP TM实现还可能提供本地方法来超时和中止在某个时间段内未完成的事务(从而防止恶意意图导致资源不可用)。事务超时还可以作为死锁解决的一种手段。

12. TIP Requirements
12. 小费要求

Most of these requirements stem from the primary objective of making transactions a ubiquitous system service, available to all application classes (much as TCP may be assumed to be available everywhere). In general this requires imposing as few restrictions

这些需求中的大多数源于使事务成为无处不在的系统服务的主要目标,对所有应用程序类都可用(就像TCP可能被认为在任何地方都可用一样)。一般来说,这需要施加尽可能少的限制

regarding the use of TIP as possible (applications should not be required to execute in some "special" environment in order to use transactions), and keeping the protocol simple and efficient. This enables the widespread implementation of TIP (it's cheap to do), on a wide range of systems (it's cheap to run).

尽可能使用TIP(应用程序不需要在某些“特殊”环境中执行才能使用事务),并保持协议简单高效。这使得TIP能够在广泛的系统(运行成本低廉)上广泛实施。

1) Application Communications Protocol Independence

1) 应用程序通信协议独立性

The TIP protocol must be defined independently of the communications protocol used for transferring application data, to allow TIP usage in conjunction with any application protocol. It must be possible for applications using arbitrary communications protocols to begin, end, and propagate TIP transactions.

TIP协议必须独立于用于传输应用程序数据的通信协议进行定义,以允许TIP与任何应用程序协议结合使用。使用任意通信协议的应用程序必须能够开始、结束和传播TIP事务。

This implies that the TIP protocol employ a 2-pipe model of operation. This model requires the separation of application communications and transaction coordination, into two discrete communication channels (pipes). This separation enables the use of the transaction coordination protocol (TIP), with any application communications protocol (e.g. HTTP, ODBC, plain TCP/UDP, etc).

这意味着TIP协议采用双管操作模型。该模型要求将应用程序通信和事务协调分离为两个离散的通信通道(管道)。这种分离允许将事务协调协议(TIP)与任何应用程序通信协议(例如HTTP、ODBC、普通TCP/UDP等)一起使用。

2) Support for Transaction Semantics

2) 对事务语义的支持

The TIP protocol must provide the functionality of the de-facto standard presumed-abort 2-pc protocol, to guarantee transactional atomicity even in the event of failure. It should provide a means to construct the transaction tree, as well as provide commitment and recovery functions.

TIP协议必须提供事实上的标准推定中止2-pc协议的功能,以保证即使在发生故障时事务原子性。它应该提供一种构造事务树的方法,并提供承诺和恢复功能。

3) Application Transaction Propagation and Interoperability

3) 应用程序事务传播和互操作性

In order to facilitate protocol independence, application interoperability, and provide a means for TIP transaction context propagation, a standard representation of the TIP transaction context information is required (in the form of a URL). This information must include the listening endpoint address of the partner TIP TM, and transaction identifier information.

为了促进协议独立性、应用程序互操作性,并提供TIP事务上下文传播的方法,需要TIP事务上下文信息的标准表示(以URL的形式)。此信息必须包括partner TIP TM的侦听端点地址和事务标识符信息。

4) Ease of Implementation

4) 易于实施

The TIP protocol must be simple to implement. It should support only those features necessary to provide a useful, performant 2-pc protocol service. The protocol should not add complexity in the form of extraneous optimisations.

TIP协议必须易于实现。它应该只支持那些提供有用、高性能的2-pc协议服务所必需的功能。协议不应以无关优化的形式增加复杂性。

5) Suitability for All Application Classes

5) 适用于所有应用类别

The TIP protocol should be complete and robust enough not only for electronic commerce on the web, but also for intranet applications and for traditional TP applications spanning heterogenous transaction manager environments. The protocol should be performant and scaleable enough to meet the needs of low to very high throughput applications.

TIP协议应足够完整和健壮,不仅适用于web上的电子商务,也适用于intranet应用程序和跨异构事务管理器环境的传统TP应用程序。该协议应具有足够的性能和可扩展性,以满足低到极高吞吐量应用的需求。

a. the TIP protocol should support the concept of client-only transaction participants (useful for ultra-lightweight implementations on low-end platforms).

a. TIP协议应该支持仅客户端事务参与者的概念(对于低端平台上的超轻量级实现非常有用)。

b. since some clients may be unreliable, TIP must provide support for delegation of transaction coordination (to a more reliable (trusted) node).

b. 由于某些客户端可能不可靠,TIP必须支持事务协调的委托(到更可靠(受信任)的节点)。

c. the TIP protocol must scale between 1 and n (> 1) concurrent transactions per TCP connection.

c. TIP协议必须在每个TCP连接的1到n(>1)个并发事务之间伸缩。

d. TIP commands should be able to be concatenated (pipelined).

d. TIP命令应该能够连接(流水线)。

e. TIP should be compatible with the X/Open XA interface.

e. TIP应与X/Open XA接口兼容。

6) Security

6) 安全

The TIP protocol must be compatible with existing security mechanisms, potentially including encryption, firewalls, and authorization mechanisms (e.g. TLS may be used to authenticate the sender of a TIP command, and for encryption of TIP commands). Nothing in the protocol definition should prevent TIP working within any security environment.

TIP协议必须与现有安全机制兼容,可能包括加密、防火墙和授权机制(例如,TLS可用于验证TIP命令的发送者,并用于TIP命令的加密)。协议定义中的任何内容都不应阻止TIP在任何安全环境中工作。

7) TIP Protocol Transport Independence

7) TIP协议传输独立性

It would be beneficial to some applications to allow the TIP protocol to flow over different transport protocols. The benefit is when using different transport protocols for the application data, the same transport can be used for the TIP 2PC protocol. TIP must therefore not preclude use with other transport protocols.

允许TIP协议在不同的传输协议上流动对某些应用程序是有益的。好处是,当对应用程序数据使用不同的传输协议时,相同的传输可用于TIP 2PC协议。因此,TIP不得排除与其他传输协议一起使用。

8) Recovery

8) 恢复

Recovery semantics need to be defined sufficiently to avoid ambiguous results in the event of any type of communications transport failure.

需要充分定义恢复语义,以避免在发生任何类型的通信传输故障时出现不明确的结果。

9) Extensibility

9) 扩展性

The TIP protocol should be able to be extended, whilst maintaining compatibility with previous versions.

TIP协议应能够扩展,同时保持与以前版本的兼容性。

References

工具书类

[1] Lyon, J., Evans, K., and J. Klein, "The Transaction Internet Protocol Version 3.0", RFC 2371, July 1998.

[1] Lyon,J.,Evans,K.,和J.Klein,“交易互联网协议版本3.0”,RFC 2371,1998年7月。

[2] Transaction Processing: Concepts and Techniques. Morgan Kaufmann Publishers. (ISBN 1-55860-190-2). J. Gray, A. Reuter.

[2] 事务处理:概念和技术。摩根·考夫曼出版社。(ISBN 1-55860-190-2)。J.格雷,A.路透社。

[3] X/Open CAE Specification, April 1995, Distributed Transaction Processing: The TX Specification. (ISBN 1-85912-094-6).

[3] X/Open CAE规范,1995年4月,分布式事务处理:TX规范。(ISBN 1-85912-094-6)。

[4] X/Open Guide, November 1993, Distributed Transaction Processing: Reference Model Version 2. (ISBN 1-85912-019-9).

[4] X/Open Guide,1993年11月,分布式事务处理:参考模型版本2。(ISBN 1-85912-019-9)。

[5] X/Open CAE Specification, December 1991, Distributed Transaction Processing: The XA Specification. (ISBN 1-872630-24-3).

[5] X/OpenCAE规范,1991年12月,分布式事务处理:XA规范。(ISBN 1-872630-24-3)。

[6] Dierks, T., et. al., "The TLS Protocol Version 1.0", Work in Progress.

[6] Dierks,T.等人,“TLS协议1.0版”,正在进行中。

Authors' Addresses

作者地址

Keith Evans Tandem Computers Inc, LOC 252-30 5425 Stevens Creek Blvd Santa Clara, CA 95051-7200, USA

Keith Evans Tandem Computers Inc,地址:美国加利福尼亚州圣克拉拉史蒂文斯克里克大道252-30 5425号,邮编:95051-7200

   Phone: +1 (408) 285 5314
   Fax:   +1 (408) 285 5245
   EMail: Keith.Evans@Tandem.Com
        
   Phone: +1 (408) 285 5314
   Fax:   +1 (408) 285 5245
   EMail: Keith.Evans@Tandem.Com
        

Johannes Klein Tandem Computers Inc. 10555 Ridgeview Court Cupertino, CA 95014-0789, USA

约翰内斯·克莱恩串联计算机公司,美国加利福尼亚州库比蒂诺市里奇维尤法院10555号,邮编95014-0789

   Phone: +1 (408) 285 0453
   Fax:   +1 (408) 285 9818
   EMail: Johannes.Klein@Tandem.Com
        
   Phone: +1 (408) 285 0453
   Fax:   +1 (408) 285 9818
   EMail: Johannes.Klein@Tandem.Com
        

Jim Lyon Microsoft Corporation One Microsoft Way Redmond, WA 98052-6399, USA

吉姆·里昂微软公司美国华盛顿州雷德蒙微软大道一号,邮编:98052-6399

   Phone: +1 (206) 936 0867
   Fax:   +1 (206) 936 7329
   EMail: JimLyon@Microsoft.Com
        
   Phone: +1 (206) 936 0867
   Fax:   +1 (206) 936 7329
   EMail: JimLyon@Microsoft.Com
        

Comments

评论

Please send comments on this document to the authors at <JimLyon@Microsoft.Com>, <Keith.Evans@Tandem.Com>, <Johannes.Klein@Tandem.Com>, or to the TIP mailing list at <Tip@Tandem.Com>. You can subscribe to the TIP mailing list by sending mail to <Listserv@Lists.Tandem.Com> with the line "subscribe tip <full name>" somewhere in the body of the message.

请将对本文件的评论发送至以下地址的作者:<JimLyon@Microsoft.Com>基思。Evans@Tandem.Com>约翰。Klein@Tandem.Com>,或发送至<Tip@Tandem.Com>. 您可以通过将邮件发送到订阅TIP邮件列表<Listserv@Lists.Tandem.Com>在邮件正文的某个地方写上“订阅提示<全名>”。

Appendix A. An Example TIP Transaction Manager Application Programming Interface.

附录A.TIP事务管理器应用程序编程接口示例。

Note that this API is included solely for informational purposes, and is not part of the formal TIP specification (TIP conformant implementations are free to define alternative APIs).

请注意,此API仅用于提供信息,不是正式TIP规范的一部分(符合TIP的实现可以自由定义替代API)。

1) tip_open() - establish a connection to a TIP TM. Synopsis int tip_open ([out] tip_handle_t *ptiptm) Parameters ptiptm [out] Pointer to the TIP TM handle. Description tip_open() establishes a connection to a TIP TM. The call returns a handle which identifies the TIP TM. This function must be called before any work can be performed on a TIP transaction.

1) tip_open()-建立与tip TM的连接。简介int tip_open([out]tip_handle_t*PTM)参数ptiptm[out]指向tip TM手柄的指针。说明tip_open()建立到tip TM的连接。该调用返回一个句柄,该句柄标识TIP TM。在对TIP事务执行任何工作之前,必须调用此函数。

      Return Values
         [TIPOK]
               Connection has been successfully established.
         [TIPNOTCONNECTED]
               User has been disconnected from the TIP TM.
         [TIPNOTCONFIGURED]
               TIP TM has not been configured.
         [TIPTRANSIENT]
               Too many openers; re-try the open.
         [TIPERROR]
               An unexpected error occurred.
        
      Return Values
         [TIPOK]
               Connection has been successfully established.
         [TIPNOTCONNECTED]
               User has been disconnected from the TIP TM.
         [TIPNOTCONFIGURED]
               TIP TM has not been configured.
         [TIPTRANSIENT]
               Too many openers; re-try the open.
         [TIPERROR]
               An unexpected error occurred.
        
   2) tip_close() - close a connection to a TIP TM.
      Synopsis
         int tip_close([in] tip_handle_t handle)
      Parameters
         handle [in]
                 The TIP TM handle.
      Description
         tip_close() closes a connection to a TIP TM. All outstanding
         requests associated with that connection will be cancelled.
      Return Values
         [TIPOK]
               Connection has been successfully closed.
         [TIPINVALIDPARM]
               Invalid connection handle specified.
         [TIPERROR]
               An unexpected error occurred.
        
   2) tip_close() - close a connection to a TIP TM.
      Synopsis
         int tip_close([in] tip_handle_t handle)
      Parameters
         handle [in]
                 The TIP TM handle.
      Description
         tip_close() closes a connection to a TIP TM. All outstanding
         requests associated with that connection will be cancelled.
      Return Values
         [TIPOK]
               Connection has been successfully closed.
         [TIPINVALIDPARM]
               Invalid connection handle specified.
         [TIPERROR]
               An unexpected error occurred.
        
   3) tip_push() - export a local transaction to a remote node and
                   return a TIP transaction identifier for the
                   associated remote transaction.
      Synopsis
         int tip_push ([in] tip_handle_t TM,
                       [in] char *tm_url,
                       [in] void *plocal_xid,
                       [out] char *pxid_url,
                       [in] unsigned int url_length)
      Parameters
         TM [in]
                 The TIP TM handle.
         tm_url [in]
                 Pointer to the TIP URL of the remote transaction manager.
                 A TIP URL for a transaction manager takes the form:
                 TIP://<host>[:<port>]
         plocal_xid [in]
                 Pointer to the local transaction identifier. The
                 structure of the transaction identifier is defined by the
                 local transaction manager.
         pxid_url [out]
                 Pointer to the TIP URL of the associated remote
                 transaction. A TIP URL for a transaction takes the form:
                 TIP://<host>[:<port>]/<transaction identifier>
         url_length [in]
                 The size in bytes of the buffer for the remote
                 transaction URL.
      Description
         tip_push() exports (pushes) a local transaction to a remote
         node. If a local transaction identifier is not supplied, the
         caller's current transaction context is used. The call returns
         a TIP URL for the associated remote transaction. The TIP
         transaction identifier may be passed on application requests to
         the remote node (as part of a TIP URL). The receiving process
         uses this information in order to do work on behalf of the
         transaction.
      Return Values
         [TIPOK]
               Transaction has been successfully pushed to the remote
               node.
         [TIPINVALIDXID]
               An invalid transaction identifier has been provided.
         [TIPNOCURRENTTX]
               Process is currently not associated with a transaction
               (and none was supplied).
         [TIPINVALIDHANDLE]
               Invalid connection handle specified.
         [TIPNOTPUSHED]
        
   3) tip_push() - export a local transaction to a remote node and
                   return a TIP transaction identifier for the
                   associated remote transaction.
      Synopsis
         int tip_push ([in] tip_handle_t TM,
                       [in] char *tm_url,
                       [in] void *plocal_xid,
                       [out] char *pxid_url,
                       [in] unsigned int url_length)
      Parameters
         TM [in]
                 The TIP TM handle.
         tm_url [in]
                 Pointer to the TIP URL of the remote transaction manager.
                 A TIP URL for a transaction manager takes the form:
                 TIP://<host>[:<port>]
         plocal_xid [in]
                 Pointer to the local transaction identifier. The
                 structure of the transaction identifier is defined by the
                 local transaction manager.
         pxid_url [out]
                 Pointer to the TIP URL of the associated remote
                 transaction. A TIP URL for a transaction takes the form:
                 TIP://<host>[:<port>]/<transaction identifier>
         url_length [in]
                 The size in bytes of the buffer for the remote
                 transaction URL.
      Description
         tip_push() exports (pushes) a local transaction to a remote
         node. If a local transaction identifier is not supplied, the
         caller's current transaction context is used. The call returns
         a TIP URL for the associated remote transaction. The TIP
         transaction identifier may be passed on application requests to
         the remote node (as part of a TIP URL). The receiving process
         uses this information in order to do work on behalf of the
         transaction.
      Return Values
         [TIPOK]
               Transaction has been successfully pushed to the remote
               node.
         [TIPINVALIDXID]
               An invalid transaction identifier has been provided.
         [TIPNOCURRENTTX]
               Process is currently not associated with a transaction
               (and none was supplied).
         [TIPINVALIDHANDLE]
               Invalid connection handle specified.
         [TIPNOTPUSHED]
        
               Transaction could not be pushed to the remote node.
         [TIPNOTCONNECTED]
               Caller has been disconnected from the TIP TM.
         [TIPINVALIDURL]
               Invalid endpoint URL is provided.
         [TIPTRANSIENT]
               Transient error occurred; re-try the operation.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the TIP
               transaction identifier.
         [TIPERROR]
               An unexpected error occurred.
        
               Transaction could not be pushed to the remote node.
         [TIPNOTCONNECTED]
               Caller has been disconnected from the TIP TM.
         [TIPINVALIDURL]
               Invalid endpoint URL is provided.
         [TIPTRANSIENT]
               Transient error occurred; re-try the operation.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the TIP
               transaction identifier.
         [TIPERROR]
               An unexpected error occurred.
        
   4) tip_pull() - create a local transaction and join it with the TIP
                   transaction.
      Synopsis
         int tip_pull([in] tip_handle_t TM,
                      [in] char *pxid_url,
                      [out] void *plocal_xid,
                      [in] unsigned int xid_length)
      Parameters
         TM [in]
               The TIP TM handle.
         pxid_url [in]
               Pointer to the TIP URL of the associated remote
               transaction. A TIP URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         plocal_xid [out]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         xid_length [in]
               The size in bytes of the buffer for the local transaction
               identifier.
      Description
         tip_pull() creates a local transaction and joins the local
         transaction with the TIP transaction (the caller becomes a
         subordinate participant in the TIP transaction). The remote TIP
         TM is identified via the URL (*pxid_url). The local transaction
         identifier is returned. If a local transaction has already been
         created for the TIP transaction identifier supplied, then
         [TIPOK] is returned (with the local transaction identifier),
         and no other action is taken.
      Return Values
         [TIPOK]
               The local transaction has been successfully created
               and joined with the TIP transaction.
         [TIPINVALIDHANDLE]
        
   4) tip_pull() - create a local transaction and join it with the TIP
                   transaction.
      Synopsis
         int tip_pull([in] tip_handle_t TM,
                      [in] char *pxid_url,
                      [out] void *plocal_xid,
                      [in] unsigned int xid_length)
      Parameters
         TM [in]
               The TIP TM handle.
         pxid_url [in]
               Pointer to the TIP URL of the associated remote
               transaction. A TIP URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         plocal_xid [out]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         xid_length [in]
               The size in bytes of the buffer for the local transaction
               identifier.
      Description
         tip_pull() creates a local transaction and joins the local
         transaction with the TIP transaction (the caller becomes a
         subordinate participant in the TIP transaction). The remote TIP
         TM is identified via the URL (*pxid_url). The local transaction
         identifier is returned. If a local transaction has already been
         created for the TIP transaction identifier supplied, then
         [TIPOK] is returned (with the local transaction identifier),
         and no other action is taken.
      Return Values
         [TIPOK]
               The local transaction has been successfully created
               and joined with the TIP transaction.
         [TIPINVALIDHANDLE]
        
               Invalid connection handle specified.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the local
               transaction identifier.
         [TIPNOTPULLED]
               Joining of the local transaction with the TIP
               transaction has failed.
         [TIPNOTCONNECTED]
               Caller has been disconnected from the TIP TM.
         [TIPINVALIDURL]
               Invalid URL has been supplied.
         [TIPTRANSIENT]
               Transient error occurred; retry the operation.
         [TIPERROR]
               An unexpected error occurred.
        
               Invalid connection handle specified.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the local
               transaction identifier.
         [TIPNOTPULLED]
               Joining of the local transaction with the TIP
               transaction has failed.
         [TIPNOTCONNECTED]
               Caller has been disconnected from the TIP TM.
         [TIPINVALIDURL]
               Invalid URL has been supplied.
         [TIPTRANSIENT]
               Transient error occurred; retry the operation.
         [TIPERROR]
               An unexpected error occurred.
        
   5) tip_pull_async() - create a local transaction and join it with the
                         TIP transaction. Control is returned to the
                         caller as soon as a local transaction is
                         created.
      Synopsis
         int tip_pull_async ([in] tip_handle_t TM
                             [in] char *pxid_url,
                             [out] void *plocal_xid,
                             [in] unsigned int xid_length)
      Parameters
         TM [in]
               The TIP gateway handle.
         pxid_url [in]
               Pointer to the TIP URL of the associated remote
               transaction. A TIP URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         plocal_xid [out]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         xid_length [in]
               The size in bytes of the buffer for the local transaction
               identifier.
      Description
         tip_pull_async() creates a local transaction and joins the
         local transaction with the TIP transaction (the caller
         becomes a subordinate participant in the TIP transaction). The
         remote TIP TM is identified via the URL (*pxid_url). The local
         transaction identifier is returned. A call to tip_pull_async()
         returns immediately after the local transaction has been
         created (before the TIP PULL protocol command is sent). A
         subsequent call to tip_pull_complete() must be issued to check
        
   5) tip_pull_async() - create a local transaction and join it with the
                         TIP transaction. Control is returned to the
                         caller as soon as a local transaction is
                         created.
      Synopsis
         int tip_pull_async ([in] tip_handle_t TM
                             [in] char *pxid_url,
                             [out] void *plocal_xid,
                             [in] unsigned int xid_length)
      Parameters
         TM [in]
               The TIP gateway handle.
         pxid_url [in]
               Pointer to the TIP URL of the associated remote
               transaction. A TIP URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         plocal_xid [out]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         xid_length [in]
               The size in bytes of the buffer for the local transaction
               identifier.
      Description
         tip_pull_async() creates a local transaction and joins the
         local transaction with the TIP transaction (the caller
         becomes a subordinate participant in the TIP transaction). The
         remote TIP TM is identified via the URL (*pxid_url). The local
         transaction identifier is returned. A call to tip_pull_async()
         returns immediately after the local transaction has been
         created (before the TIP PULL protocol command is sent). A
         subsequent call to tip_pull_complete() must be issued to check
        
         for successful completion of the pull request.
      Return Values
         [TIPOK]
               The local transaction has been successfully created.
         [TIPINVALIDHANDLE]
               Invalid connection handle specified.
         [TIPNOTCONNECTED]
               User has been disconnected from the TIP TM.
         [TIPINVALIDURL]
               Invalid URL has been supplied.
         [TIPTRANSIENT]
               Transient error has occurred; retry the operation.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the local
               transaction identifier.
         [TIPERROR]
               An unexpected error occurred.
        
         for successful completion of the pull request.
      Return Values
         [TIPOK]
               The local transaction has been successfully created.
         [TIPINVALIDHANDLE]
               Invalid connection handle specified.
         [TIPNOTCONNECTED]
               User has been disconnected from the TIP TM.
         [TIPINVALIDURL]
               Invalid URL has been supplied.
         [TIPTRANSIENT]
               Transient error has occurred; retry the operation.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the local
               transaction identifier.
         [TIPERROR]
               An unexpected error occurred.
        
   6) tip_pull_complete() - check whether a previous tip_pull_async()
                            request has been successfully completed.
      Synopsis
         int tip_pull_complete ([in] tip_handle_t TM,
                                [in] void *plocal_xid)
      Parameters
         TM [in]
               The TIP TM handle.
         plocal_xid [in]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
      Description
         tip_pull_complete() checks whether a previous call to
         tip_pull_async() has been successfully completed. i.e. whether
         the local transaction has been successfully joined with the TIP
         transaction. The caller supplies the local transaction
         identifier returned by the previous call to tip_pull_async().
         Repeated calls to tip_pull_complete() for the same local
         transaction identifier are idempotent.
      Return Values
         [TIPOK]
               The local transaction has been successfully joined with
               the TIP transaction.
         [TIPINVALIDHANDLE]
               Invalid connection handle specified.
         [TIPINVALIDXID]
               An invalid transaction identifier has been provided.
         [TIPNOTPULLED]
               Joining of the local transaction with the TIP transaction
        
   6) tip_pull_complete() - check whether a previous tip_pull_async()
                            request has been successfully completed.
      Synopsis
         int tip_pull_complete ([in] tip_handle_t TM,
                                [in] void *plocal_xid)
      Parameters
         TM [in]
               The TIP TM handle.
         plocal_xid [in]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
      Description
         tip_pull_complete() checks whether a previous call to
         tip_pull_async() has been successfully completed. i.e. whether
         the local transaction has been successfully joined with the TIP
         transaction. The caller supplies the local transaction
         identifier returned by the previous call to tip_pull_async().
         Repeated calls to tip_pull_complete() for the same local
         transaction identifier are idempotent.
      Return Values
         [TIPOK]
               The local transaction has been successfully joined with
               the TIP transaction.
         [TIPINVALIDHANDLE]
               Invalid connection handle specified.
         [TIPINVALIDXID]
               An invalid transaction identifier has been provided.
         [TIPNOTPULLED]
               Joining of the local transaction with the TIP transaction
        

has failed. The local transaction has been aborted. [TIPNOTCONNECTED] Caller has been disconnected from the TIP TM. [TIPERROR] An unexpected error occurred.

失败了。本地事务已中止。[TIPNOTCONNECTED]呼叫方已断开与TIP TM的连接。[Tiperor]发生意外错误。

   7) tip_xid_to_url() - return a TIP transaction identifier for a local
                         transaction identifier.
      Synopsis
         int tip_xid_to_url ([in] tip_handle_t TM,
                             [in] void *plocal_xid,
                             [out] char *pxid_url,
                             [in] unsigned int url_length)
      Parameters
         TM [in]
               The TIP TM handle.
         plocal_xid [in]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         pxid_url [out]
               Pointer to the TIP URL of the local transaction.
               A TIP URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         url_length [in]
               The size in bytes of the buffer for the TIP URL.
      Description
         tip_xid_to_url() returns a TIP transaction identifier for a
         local transaction identifier. The TIP transaction identifier
         can be passed to remote applications to enable them to do work
         on the transaction. e.g. to pull the local transaction to the
         remote node. If a local transaction identifier is not supplied,
         the caller's current transaction context is used. The constant
         TIPURLSIZE defines the size of a TIP transaction identifier in
         bytes. This value is implementation specific.
      Return Values
         [TIPOK]
               TIP transaction identifier has been returned.
         [TIPNOTCONNECTED]
               Caller has been disconnected from the TIP TM.
         [TIPNOCURRENTTX]
               Process is currently not associated with a transaction
               (and none was supplied).
         [TIPINVALIDXID]
               An invalid local transaction identifier has been
               supplied.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the TIP
        
   7) tip_xid_to_url() - return a TIP transaction identifier for a local
                         transaction identifier.
      Synopsis
         int tip_xid_to_url ([in] tip_handle_t TM,
                             [in] void *plocal_xid,
                             [out] char *pxid_url,
                             [in] unsigned int url_length)
      Parameters
         TM [in]
               The TIP TM handle.
         plocal_xid [in]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         pxid_url [out]
               Pointer to the TIP URL of the local transaction.
               A TIP URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         url_length [in]
               The size in bytes of the buffer for the TIP URL.
      Description
         tip_xid_to_url() returns a TIP transaction identifier for a
         local transaction identifier. The TIP transaction identifier
         can be passed to remote applications to enable them to do work
         on the transaction. e.g. to pull the local transaction to the
         remote node. If a local transaction identifier is not supplied,
         the caller's current transaction context is used. The constant
         TIPURLSIZE defines the size of a TIP transaction identifier in
         bytes. This value is implementation specific.
      Return Values
         [TIPOK]
               TIP transaction identifier has been returned.
         [TIPNOTCONNECTED]
               Caller has been disconnected from the TIP TM.
         [TIPNOCURRENTTX]
               Process is currently not associated with a transaction
               (and none was supplied).
         [TIPINVALIDXID]
               An invalid local transaction identifier has been
               supplied.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the TIP
        

transaction identifier. [TIPERROR] An unexpected error occurred.

事务标识符。[Tiperor]发生意外错误。

   8) tip_url_to_xid() - return a local transaction identifier for a TIP
                         transaction identifier.
      Synopsis
           int tip_url_to_xid ([in] tip_handle_t TM,
                             [in] char *pxid_url,
                             [out] void *plocal_xid,
                             [in] unsigned int xid_length)
      Parameters
         TM [in]
               The TIP TM handle.
         pxid_url [in]
               Pointer to the TIP URL of the local transaction. A TIP
               URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         plocal_xid [out]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         xid_length [in]
               The size in bytes of the buffer for the local transaction
               identifier.
      Description
         tip_url_to_xid() returns a local transaction identifier for a
         TIP transaction identifier (note that the local transaction
         must have previously been created via a tip_push(), or tip_pull
         (or tip_pull_async()). The constant TIPXIDSIZE defines the size
         of a local transaction identifier in bytes. This value is
         implementation specific.
      Return Values
         [TIPOK]
               Local transaction identifier is returned.
         [TIPINVALIDURL]
               An invalid TIP transaction identifier has been provided.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the local
               transaction identifier.
         [TIPERROR]
               An unexpected error occurred.
        
   8) tip_url_to_xid() - return a local transaction identifier for a TIP
                         transaction identifier.
      Synopsis
           int tip_url_to_xid ([in] tip_handle_t TM,
                             [in] char *pxid_url,
                             [out] void *plocal_xid,
                             [in] unsigned int xid_length)
      Parameters
         TM [in]
               The TIP TM handle.
         pxid_url [in]
               Pointer to the TIP URL of the local transaction. A TIP
               URL for a transaction takes the form:
               TIP://<host>[:<port>]/<transaction identifier>
         plocal_xid [out]
               Pointer to the local transaction identifier. The
               structure of the transaction identifier is defined by the
               local transaction manager.
         xid_length [in]
               The size in bytes of the buffer for the local transaction
               identifier.
      Description
         tip_url_to_xid() returns a local transaction identifier for a
         TIP transaction identifier (note that the local transaction
         must have previously been created via a tip_push(), or tip_pull
         (or tip_pull_async()). The constant TIPXIDSIZE defines the size
         of a local transaction identifier in bytes. This value is
         implementation specific.
      Return Values
         [TIPOK]
               Local transaction identifier is returned.
         [TIPINVALIDURL]
               An invalid TIP transaction identifier has been provided.
         [TIPTRUNCATED]
               Insufficient buffer size is specified for the local
               transaction identifier.
         [TIPERROR]
               An unexpected error occurred.
        
9)  tip_get_tm_url() - get the name of the local TIP transaction
                       manager in TIP URL form.
    Synopsis
       int tip_get_tm_url ([in] tip_handle_t TM,
                           [out] char *tm_url,
                           [in] int tm_len);
    Parameters
       TM[in]
            The TIP TM handle.
       tm_url [in]
            Pointer to the TIP URL of the local transaction manager. A
            TIP URL for a transaction manager takes the form:
            TIP://<host>[:<port>]
       tm_len [out]
            The size in bytes of the buffer for the TIP URL of the local
            transaction manager.
    Description
       tip_get_tm_url() gets the name of the  local transaction
       manager in TIP URL form (i.e. TIP://<host>[:<port>])
    Return Values
       [TIPOK]
             The name of the local transaction manager has been
             successfully returned.
       [TIPTRUNCATED]
             The name of the local transaction manager has been
             truncated due to insufficient buffer size. Retry the
             operation with larger buffer size.
        
9)  tip_get_tm_url() - get the name of the local TIP transaction
                       manager in TIP URL form.
    Synopsis
       int tip_get_tm_url ([in] tip_handle_t TM,
                           [out] char *tm_url,
                           [in] int tm_len);
    Parameters
       TM[in]
            The TIP TM handle.
       tm_url [in]
            Pointer to the TIP URL of the local transaction manager. A
            TIP URL for a transaction manager takes the form:
            TIP://<host>[:<port>]
       tm_len [out]
            The size in bytes of the buffer for the TIP URL of the local
            transaction manager.
    Description
       tip_get_tm_url() gets the name of the  local transaction
       manager in TIP URL form (i.e. TIP://<host>[:<port>])
    Return Values
       [TIPOK]
             The name of the local transaction manager has been
             successfully returned.
       [TIPTRUNCATED]
             The name of the local transaction manager has been
             truncated due to insufficient buffer size. Retry the
             operation with larger buffer size.
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (1998). All Rights Reserved.

版权所有(C)互联网协会(1998年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。