JPH06223007A - Two-phase commit control method - Google Patents
Two-phase commit control methodInfo
- Publication number
- JPH06223007A JPH06223007A JP5009430A JP943093A JPH06223007A JP H06223007 A JPH06223007 A JP H06223007A JP 5009430 A JP5009430 A JP 5009430A JP 943093 A JP943093 A JP 943093A JP H06223007 A JPH06223007 A JP H06223007A
- Authority
- JP
- Japan
- Prior art keywords
- commit
- journal
- request
- transaction
- preparation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Multi Processors (AREA)
- Computer And Data Communications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
(57)【要約】 (修正有)
【構成】 分散トランザクション処理システムにおける
第1段階として、調整者10からコミット準備要求を受
けた各参加者11,12は、自己のコミット準備ジャー
ナルをコミット準備要求に付加した後、コミット準備要
求を次順の巡回先へ送信し、最後の参加者は、自己のコ
ミット準備ジャーナルをコミット準備ジャーナルに併合
した後、コミット準備要求をジャーナル記録者21へ送
信し、ジャーナル記録者21は、全参加者のコミット準
備ジャーナルが記録された後、その旨を調整者10へ報
告する。第2段階として、調整者10は、すべての参加
者名を含む巡回先情報を付加したコミット要求をジャー
ナル記録者21へ送信し、すべての参加者のコミットジ
ャーナルが記録された後、次順の巡回先へ送信され、最
後の参加者がコミット要求を受けた旨を調整者へ報告す
る。
【効果】 ジャーナルサーバへの通信回数とジャーナル
ファイルへの入出力回数を削減できる。
(57) [Summary] (Modified) [Configuration] As the first step in the distributed transaction processing system, each of the participants 11 and 12 receiving the commit preparation request from the coordinator 10 requests the commit preparation journal of its own. , The commit preparation request is sent to the next round destination, and the last participant merges its commit preparation journal with the commit preparation journal and then sends the commit preparation request to the journal recorder 21. After recording the commit preparation journals of all the participants, the journal recorder 21 reports the fact to the coordinator 10. As the second stage, the coordinator 10 sends a commit request to the journal recorder 21 with the visit destination information including all the participant names, and after the commit journals of all the participants are recorded, It is sent to the patrol destination and reports to the coordinator that the last participant received a commit request. [Effect] It is possible to reduce the number of times of communication to the journal server and the number of times of input / output to / from the journal file.
Description
【0001】[0001]
【産業上の利用分野】本発明は、分散トランザクション
処理における2フェーズコミット処理に係り、特に電文
送信回数並びにジャーナル記録回数の削減を行う2フェ
ーズコミット制御方法に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to two-phase commit processing in distributed transaction processing, and more particularly to a two-phase commit control method for reducing the number of message transmissions and the number of journal recordings.
【0002】[0002]
(1) コミット制御方法 トランザクションとは、ファイルやデータベース操作を
含む各種の操作の並びのことをいう。トランザクション
は、回復や同時実行の処理単位であり、トランザクショ
ン開始命令によりまたはトランザクションが適用される
資源であるファイルやデータベースに対する最初の操作
時に開始され、コミットまたはロールバックのトランザ
クション制御命令により終了する。データベースに対す
る更新処理を実際に確定させることをコミットといい、
その更新処理をキャンセルして更新を行わないようにす
ることをロールバック(またはアボート)という。トラ
ンザクションは、コミットまたはロールバック命令によ
り終了するまで、そのトランザクションが行った全ての
変更を他のトランザクションにアクセスさせない。トラ
ンザクションがコミットされると、そのトランザクショ
ンが行った全ての変更は他のトランザクションに対して
アクセス可能となる。またトランザクションがロールバ
ックされると、そのトランザクションによって行われた
全ての変更が無効になる。コミットされた変更を取り消
すことはできない。このような処理をトランザクション
処理と呼ぶ。トランザクションの概念が適用される資源
はファイルやデータベースである。(1) Commit control method A transaction is a sequence of various operations including file and database operations. A transaction is a processing unit of recovery or concurrent execution, which is started by a transaction start command or at the first operation on a file or database which is a resource to which the transaction is applied, and is ended by a commit or rollback transaction control command. It is called commit to actually confirm the update process to the database,
Rolling back (or aborting) cancels the update process so that the update is not performed. A transaction does not allow all changes made by that transaction to be accessed by other transactions until it ends with a commit or rollback instruction. When a transaction is committed, all changes made by that transaction are accessible to other transactions. Also, when a transaction is rolled back, all changes made by that transaction are invalidated. You cannot undo committed changes. Such processing is called transaction processing. Resources to which the concept of transactions apply are files and databases.
【0003】尚、以降の記述においては適用資源をデー
タベースと記述するがファイルであってもかまわない。
またデータベースとファイルが混在した構成であっても
よい。In the following description, the applicable resource is described as a database, but it may be a file.
Further, the database and the file may be mixed.
【0004】通信ネットワークにより接続された分散処
理システムにおいてトランザクション処理を行う場合、
論理的なトランザクションは、部分的な処理即ちサブト
ランザクションに分割されネットワーク内のいずれかの
計算機で処理される。このような分散処理システムでの
トランザクション処理を分散トランザクション処理と呼
ぶ。When performing transaction processing in a distributed processing system connected by a communication network,
A logical transaction is divided into partial processes, that is, sub-transactions and processed by any computer in the network. Transaction processing in such a distributed processing system is called distributed transaction processing.
【0005】分散トランザクション処理においてトラン
ザクションをコミットする方法として2フェーズコミッ
トと呼ばれるトランザクション制御方法が提案されてい
る。すなわち、このコミット処理は、データベースを有
する各計算機上で、更新の前後の情報を保持しておきデ
ータベースを仮の更新状態とする第1の処理フェーズ
(コミット準備段階)と、すべての計算機における更新
承認に応じて上記更新の前後情報に基づいてデータベー
スの実際の更新を行う(あるいは1つでも承認が得られ
ない場合には仮の更新状態をキャンセルする)第2の処
理フェーズとからなる。As a method for committing a transaction in distributed transaction processing, a transaction control method called two-phase commit has been proposed. In other words, this commit processing includes a first processing phase (commit preparation step) in which information before and after updating is held on each computer having a database and the database is temporarily updated, and an update in all computers. It comprises a second processing phase in which the database is actually updated based on the information before and after the update in response to the approval (or the temporary update state is canceled when even one is not approved).
【0006】このようなトランザクション制御方法の詳
細は、M.Tamer Ozsu,Patrick V
alduriez 共著「PRINCIPLE OF
DISTRIBUTED DATABASE SYST
EMS 」PlenticeーHall Intern
ational出版社1991年発行の第322ページ
から第364ページにおいて記載されている。The details of such a transaction control method are described in M. Tamer Ozsu, Patrick V
Alduriez co-authored "PRINCIPLE OF
DISTRIBUTED DATABASE SYSTEM
EMS "Plentice-Hall Intern
National Publishers, 1991, pp. 322-364.
【0007】一般に、分散トランザクション処理が適用
されるのはオンライントランザクション処理と呼ばれる
信頼性の要求されるシステムである。オンライントラン
ザクション処理は、入金出金や残高紹介などを処理する
銀行のオンラインシステムや旅行業のような予約システ
ムの処理を指す。これらは、多数の計算機や端末を接続
したシステム形態を取る。これらオンラインシステムは
データベースの極一部をアクセスしコミット処理を行
う。この典型的な例としては、データベースベンチマー
クとして知られるTPC(Transaction Processing per
formance Council)ベンチマークがあり、その代表的な
ものとしてTPC−Bと呼ばれるベンチマークが用意さ
れる。このベンチマークでは、1秒間に幾つのトランザ
クションを処理可能かが測定の対象となる。TPC−B
では、3種類のデータベースに対する検索、更新が行わ
れる。これらの処理では、1トランザクションにおける
データベースアクセス量は一般的に小さい。しかし、デ
ータベースアクセスを行うサーバが複数のノードに分割
された場合、トランザクションの2フェーズコミット処
理が必要となる。TPC−Bのようなケースの場合、デ
ータベースが分散されると、1トランザクションの30
%から半分近くの処理が2フェーズコミットの通信とジ
ャーナル記録に費やされる。In general, the distributed transaction processing is applied to a system called online transaction processing which requires reliability. Online transaction processing refers to the processing of a bank's online system that processes deposit / withdrawal, balance introduction, etc., and the reservation system of the travel industry. These take a system form in which many computers and terminals are connected. These online systems access a very small part of the database and perform commit processing. A typical example of this is TPC (Transaction Processing per), which is known as a database benchmark.
formance Council) There is a benchmark, and a typical one is a benchmark called TPC-B. In this benchmark, the number of transactions that can be processed in one second is measured. TPC-B
Then, a search and an update are performed on three types of databases. In these processes, the database access amount in one transaction is generally small. However, when the server that accesses the database is divided into a plurality of nodes, the transaction two-phase commit processing is required. In the case of TPC-B, if the database is distributed, 30 transactions per transaction
% To nearly half of the processing is spent on two-phase commit communication and journal recording.
【0008】図2は分散トランザクション処理システム
の構成の概要を示す。図2においてフロントエンドサー
バ(以下FESと略す)とバックエンドサーバ(以下B
ESと略す)11,12,13は通信網160で接続さ
れ、個々のサーバと他のサーバとの間で通信網を介して
通信ができる。ここでサーバとはある特定の処理を行う
機能単位であり任意の計算機上で動作することが許され
る。FIG. 2 shows an outline of the configuration of the distributed transaction processing system. In FIG. 2, a front-end server (hereinafter abbreviated as FES) and a back-end server (hereinafter B)
ES (abbreviated as ES) 11, 12, and 13 are connected by a communication network 160, and individual servers can communicate with other servers via the communication network. Here, the server is a functional unit that performs a certain specific process, and is allowed to operate on any computer.
【0009】FES10は、アプリケーションプログラ
ム130(以下APと略す)からのデータベース処理要
求を受け、BES11,12,13に処理要求を送信す
る。個々のBESは、データベース141,142,1
43を持ち、データベース処理要求を受信すると、デー
タベース処理を行いFESを介して処理結果をAPに転
送する。FES,BESは、データベース操作の中でデ
ータベースの更新前後ジャーナルやトランザクション制
御に関するジャーナルを各サーバの持つ不揮発な記録媒
体であるジャーナルファイル201,202,203に
記録する。The FES 10 receives a database processing request from an application program 130 (hereinafter abbreviated as AP) and sends the processing request to the BESs 11, 12 and 13. The individual BESs are stored in the databases 141, 142, 1
When the database processing request is received, the database processing is performed and the processing result is transferred to the AP via the FES. FES and BES record journals before and after database update and journals related to transaction control in journal files 201, 202, and 203, which are nonvolatile recording media of each server, during database operations.
【0010】図2における2フェーズコミット制御方法
の概要を図3で説明する。調整者FES10は、トラン
ザクション内でデータベース処理を行う参加者バックエ
ンドサーバ(以下BESと略す)にトランザクション内
で発生したデータベース操作要求を送信し、その処理を
要求する。参加者BES11,12,13はその要求に
基づいてデータベース操作を行う。データベース操作が
終了した段階で、トランザクションを確定する為に以下
の手順を行う。アプリケーションプログラムはcomm
itと呼ばれるコマンドを実行する。commitコマ
ンドはFES10に渡り、コミット処理が開始される。An outline of the two-phase commit control method in FIG. 2 will be described with reference to FIG. The coordinator FES10 sends a database operation request generated in a transaction to a participant backend server (hereinafter abbreviated as BES) that performs database processing in the transaction, and requests the processing. The participants BES 11, 12, and 13 perform database operations based on the request. When the database operation is completed, follow the procedure below to confirm the transaction. Application program is comm
Executes a command called it. The commit command is passed to the FES 10 and the commit process is started.
【0011】まず第1段階、即ちコミット準備段階で、
調整者FES10は、各参加者BES11,12,13
に対してコミット準備(図中のprepare)を要求
する。各BESは、BES中に存在するジャーナルファ
イル201,202,203に対してコミット準備ジャ
ーナル(図中の BES11PJ,BES12PJ,B
ES13PJ)を記録する。コミット準備ジャーナル
は、各トランザクションの状態を障害発生時に復旧する
ために、各BESにおいて記録要求時点でジャーナルフ
ァイル上に記録しなければならない。コミット準備ジャ
ーナルを記録したことにより各参加者は次の指示即ち第
2段階での要求(コミットまたはロールバック)に従い
トランザクションをいずれかの状態にすることが可能に
なる。各BESにおいてこの準備が完了すると、コミッ
ト準備完了の応答(図3コミット準備段階のack)を
各BESがFES10に返す。FES10は、全参加者
BESからコミット準備完了を受けると、ジャーナルフ
ァイル200に自分自身のコミット準備ジャーナル(図
中の FES10PJ)を記録する。BESが障害等の
理由により上記の処理ができない場合、失敗応答を返
す。以上の処理で2フェーズコミット制御方法の第1段
階が完了する。First, in the first stage, that is, the commit preparation stage,
The coordinator FES10 includes the participants BES11, 12, 13
Request commit preparation (prepare in the figure). Each BES has a commit preparation journal (BES11PJ, BES12PJ, B in the figure) for the journal files 201, 202, 203 existing in the BES.
Record ES13PJ). The commit preparation journal must be recorded in the journal file at the recording request time in each BES in order to recover the state of each transaction when a failure occurs. By recording the commit preparation journal, it becomes possible for each participant to put the transaction into any state according to the following instruction, that is, the request (commit or rollback) in the second stage. When this preparation is completed in each BES, each BES returns a commit preparation completion response (ack in the commit preparation stage in FIG. 3) to the FES 10. Upon receiving the commit preparation completion from all the participants BES, the FES 10 records its own commit preparation journal (FES10PJ in the figure) in the journal file 200. When the BES cannot perform the above processing due to a failure or the like, it returns a failure response. The above processing completes the first stage of the two-phase commit control method.
【0012】次に第2段階として以下の処理が行われ
る。FESがトランザクションをコミット確定されたこ
と示すコミットジャーナル(図中のFES10CJ)を
ジャーナルファイル200に記録した後、全参加者BE
Sにコミット(commit)を指示する。各BESは
FESの指示に従い、コミットジャーナルをそれぞれの
ジャーナルファイルに記録し、コミット処理を行った後
に、FESにコミット完了報告(ack)を行う。FE
Sは全BESの完了報告を受けてトランザクションを終
了させる。コミット準備段階である一定時間内に応答を
返さないか、または失敗応答を返した参加者がいると、
FESはロールバック決定を行い、トランザクションが
ロールバック確定されたこと示すアボートジャーナルを
ジャーナルファイル200に記録した後、全参加者にロ
ールバック要求を行う。Next, as the second step, the following processing is performed. After recording the commit journal (FES10CJ in the figure) indicating that the FES has committed the transaction in the journal file 200, all participants BE
Instruct S to commit. Each BES records a commit journal in each journal file according to the instruction of the FES, performs a commit process, and then issues a commit completion report (ack) to the FES. FE
S receives the completion report of all BESs and terminates the transaction. If there is a participant who does not respond or returns a failure response within a certain time, which is the stage of commit preparation,
The FES makes a rollback decision, records an abort journal indicating that the transaction is rollback confirmed in the journal file 200, and then makes a rollback request to all participants.
【0013】(2)ジャーナルサーバの独立 ローカルエリアネットワークに代表される小中規模な分
散トランザクション処理では、特定の隣接した計算機群
をファイルサーバまたはデータベースサーバとし、ネッ
トワークで接続利用することで負荷分散と集中運用を同
居させたシステム構築が一般的となっている。(2) Independent journal server In small-to-medium-scale distributed transaction processing typified by a local area network, load distribution can be performed by connecting and using a specific adjacent computer group as a file server or database server. It is common to build a system that allows centralized operation to live together.
【0014】上記環境において問題になるのはジャーナ
ルファイルの運用である、従来の分散トランザクション
処理は個々のサーバにおいてジャーナルを取得する。し
かし、各サーバは独立しているがその配置は集中する
(同サイトに設置する)ような集中配置分散トランザク
ション処理では、各サーバがジャーナル取得する場合、
個々のサーバでジャーナルファイルまたはジャーナル記
録装置(磁気ディスクや磁気テープ)を設け、その保守
管理を行わなければならない。ユーザに簡便なジャーナ
ル運用を提供するために、システム側はジャーナルファ
イルを集中運用することが必要になる。この要求に対し
一般的な方法は、ジャーナル処理を独立した計算機で行
うジャーナルサーバ化である。分散トランザクション処
理においてジャーナル処理をFES,BESから独立化
することでジャーナルの集中運用が実現できる。同ジャ
ーナルサーバの独立化は後述する特願平2ー33160
5号「分散処理システムの分散トランザクションファイ
ル制御方法」中に記載されている。The problem in the above environment is the operation of the journal file. In the conventional distributed transaction processing, the journal is acquired in each server. However, in the case of centralized distributed transaction processing in which each server is independent but its distribution is centralized (installed at the same site), when each server acquires a journal,
Each server must be equipped with a journal file or journal recording device (magnetic disk or magnetic tape) and its maintenance must be performed. In order to provide users with a simple journal operation, the system side needs to centrally operate journal files. A general method for this request is to use a journal server in which journal processing is performed by an independent computer. In the distributed transaction processing, journal processing can be made independent from FES and BES to realize centralized journal operation. Independence of the journal server will be described later in Japanese Patent Application No. Hei 2-333160.
No. 5 "Distributed transaction file control method for distributed processing system".
【0015】図2のシステムにおいてジャーナル処理を
独立した分散トランザクション処理システムの概要を図
1に示す。同図においてFES10とBES11,1
2,13とジャーナルサーバ(以下JSと略す。)2
1,22は通信網160で接続され、個々のサーバから
通信網を介してサーバ間の通信ができる。FES10は
アプリケーションプログラム130(以下APと略す)
からのデータベース処理要求を受け、BES11,1
2,13に処理要求を送信する。個々のBESはデータ
ベース141,142,143を持ち、データベース処
理要求を受信するとデータベース処理を行いその処理結
果をFESを介してAPに転送する。FES,BES
は、データベース操作の中でデータベースの更新前後ジ
ャーナルやトランザクション制御に関するジャーナルを
JS21,22に送信する。JS21,22は不揮発な
記録媒体であるジャーナルファイル151,152を持
ち、FESやBESからのジャーナル記録要求を処理す
る。An outline of a distributed transaction processing system in which journal processing is independent in the system of FIG. 2 is shown in FIG. In the figure, FES10 and BES11,1
2, 13 and journal server (hereinafter abbreviated as JS) 2
1 and 22 are connected by a communication network 160, and individual servers can communicate with each other via the communication network. The FES 10 is an application program 130 (hereinafter abbreviated as AP)
Received a database processing request from BES11,1
The processing request is transmitted to Nos. 2 and 13. Each BES has databases 141, 142, 143. When a database processing request is received, database processing is performed and the processing result is transferred to the AP via FES. FES, BES
Sends a journal before and after database update and a journal relating to transaction control to JSs 21 and 22 during database operation. The JSs 21 and 22 have journal files 151 and 152, which are non-volatile recording media, and process journal recording requests from FES and BES.
【0016】以上のような分散データベース環境におけ
る2フェーズコミット制御のコミット成功時の制御概要
を図4に示す。基本的な処理の流れは図3の一般的な2
フェーズコミット制御方法と変わらない。ただし、JS
が独立化したことによりジャーナル記録要求は通信網を
介してJS側へ送られ、JS側で処理され、結果が要求
元に送信される。尚、図4の例では、JSを共用するサ
ーバごとにグループ化し、FES10,BES11,B
ES12がJS21に、BES13がJS22にジャー
ナルを記録するようにしている。勿論、JSを2台用い
る例を示したが、は1台であってもよい。FIG. 4 shows a control outline of the two-phase commit control in the above distributed database environment when the commit is successful. The basic processing flow is 2 in FIG.
Same as the phase commit control method. However, JS
The journal recording request is sent to the JS side via the communication network, processed by the JS side, and the result is sent to the request source. In the example of FIG. 4, the servers sharing the JS are grouped into FES10, BES11, B.
ES12 records the journal in JS21 and BES13 records the journal in JS22. Of course, an example using two JSs is shown, but one may be used.
【0017】第1段階のコミット準備段階で、FES1
0はコミット準備ジャーナル(FES10PJ)をJS
21に対して記録し、全BESにコミット準備要求(図
中のprepare)を送る。各BESのコミット準備
ジャーナル(BES11PJ,BES12PJ,BES
13PJ)はJS側に送信され、ジャーナルファイルに
記録する。その結果、ジャーナル記録完了報告(図4中
のコミット準備段階のJSからBESへのack)が各
BESに送信されたのち、各BESからコミット準備完
了報告(ack)がFES10に送信される。At the commit preparation stage of the first stage, FES1
0 is JS for commit preparation journal (FES10PJ)
21 is recorded, and a commit preparation request (prepare in the figure) is sent to all BESs. Commit preparation journal of each BES (BES11PJ, BES12PJ, BES
13PJ) is transmitted to the JS side and recorded in the journal file. As a result, after the journal recording completion report (ack from JS to BES at the commit preparation stage in FIG. 4) is transmitted to each BES, the commit preparation completion report (ack) is transmitted from each BES to the FES 10.
【0018】第2段階では,FES10がコミット段階
に移行した旨を記録するコミットジャーナル(FES1
0CJ)をJS21に記録し、その正常終了(ack)
を受ける。この段階でトランザクション状態はコミット
決定となる。次にFES10は各BESに対してコミッ
ト処理要求(図のcommit)を送る。各BESはコ
ミット処理要求を受け、コミットジャーナル(BES1
1CJ,BES12CJ,BES13CJ)を各JSに
記録要求する。各JSは、コミットジャーナル記録要求
を実行し、完了報告を各BESに送信する。各BESは
ジャーナル正常終了を受けFES10にコミット完了を
報告する。FES10は全BESの正常完了報告を受け
ることでトランザクションを終了する。In the second stage, a commit journal (FES1) recording that the FES10 has transitioned to the commit stage.
0CJ) is recorded in JS21 and its normal end (ack)
Receive. At this stage, the transaction status becomes commit decision. Next, the FES 10 sends a commit processing request (commit in the figure) to each BES. Each BES receives a commit processing request and receives a commit journal (BES1
1CJ, BES12CJ, BES13CJ) is requested to be recorded to each JS. Each JS executes a commit journal recording request and sends a completion report to each BES. Each BES receives the normal end of the journal and reports the commit completion to the FES 10. The FES 10 ends the transaction by receiving the normal completion report of all BESs.
【0019】(3)巡回2フェーズコミット制御方法 上記2フェーズコミット制御方法の変形として、特開昭
59ー11564号「巡回式2フェーズコミットメント
制御方法」が提案されている。この技術では、ジャーナ
ル処理内蔵型分散処理システムにおいて、コミット準備
要求とコミット準備完了とを複合させた電文を巡回させ
ることによってコミット準備完了を確認する。その目的
は、調整者FESと各参加者BES間における2フェー
ズコミット制御方法における通信回数の削減である。通
信は、処理コストがかかる為にできるだけその回数を削
減することが望ましい。一般にコミット準備における論
理的な通信電文回数は参加者数×2回必要となる。この
公知技術では、コミット準備要求とコミット準備完了を
複合させた電文を各参加者に巡回させることにより、通
信回数を参加者数+1回とすることで通信回数の削減を
実現している。(3) Cyclic Two-Phase Commit Control Method As a modification of the above two-phase commit control method, Japanese Patent Laid-Open No. 59-11564 “Cyclic Two-Phase Commitment Control Method” has been proposed. In this technique, in the distributed processing system with a built-in journal processing, the commit preparation completion is confirmed by circulating a telegram that combines a commit preparation request and a commit preparation completion. The purpose is to reduce the number of communications in the two-phase commit control method between the coordinator FES and each participant BES. Since communication requires a processing cost, it is desirable to reduce the number of times as much as possible. Generally, the number of logical communication messages in the commit preparation is required to be the number of participants × 2 times. In this publicly known technique, the number of communications is reduced by making the number of communications +1 the number of communications by causing each participant to circulate a telegram that combines a commit preparation request and a commit preparation completion.
【0020】(4)分散トランザクションファイル制御
方法 上記JS独立時の分散データベース処理において、特願
平2ー331605号「分散処理システムの分散トラン
ザクションファイル制御方法」が提案されている。同方
法は、あるトランザクションにおいて同じJSにジャー
ナル記録するBESから独立に記録要求されたコミット
準備ジャーナルまたはコミットジャーナルを待ち合わせ
により全て一括し、それぞれ一回でジャーナルファイル
へ記録し、全ての要求元BESへコミット準備ジャーナ
ルまたはコミットジャーナルの記録完了報告を送信する
ことを特徴としている。この方法の目的は、不要なジャ
ーナル記録を抑止してジャーナル記録回数を削減するこ
とにある。(4) Distributed Transaction File Control Method In the above-mentioned distributed database processing when JS is independent, Japanese Patent Application No. 2-331605 "Distributed transaction file control method for distributed processing system" has been proposed. In this method, the commit preparation journals or commit journals that are requested to be recorded independently from the BESs that are journal-recorded in the same JS in a certain transaction are put together by waiting, and each is recorded in a journal file at once, and all the requesting BESs are recorded. It is characterized by transmitting the record completion report of the commit preparation journal or the commit journal. The purpose of this method is to suppress unnecessary journal recording and reduce the number of journal recordings.
【0021】[0021]
【発明が解決しようとする課題】JSを独立化させた場
合、従来のジャーナル処理内蔵型の2フェーズコミット
制御方法に対して以下のような問題が生じる。When the JS is made independent, the following problems occur with respect to the conventional two-phase commit control method with a built-in journal processing.
【0022】(1)通信回数の増加 トランザクション処理におけるコミット準備ジャーナル
処理やコミットジャーナル処理では、不揮発な記録媒体
であるジャーナルファイルへ各ジャーナルを記録したあ
とでなければ次の処理が行えない。故にJSが独立化し
たことでFESおよび各BESからJSへジャーナルフ
ァイル記録のための通信が増加する。即ちFES並びに
BESからのコミット準備ジャーナル並びにコミットジ
ャーナル記録時にかならず通信網を経由した通信が必要
となる。コミット処理時の通信回数は、JS非独立な2
フェーズコミット制御方法に比べて、(FES数(=
1)+BES数)×4回(コミット準備の送受信+コミ
ットの送受信)の通信回数増加となる。(1) Increase in the number of communications In commit preparation journal processing and commit journal processing in transaction processing, the following processing can be performed only after recording each journal in a journal file which is a non-volatile recording medium. Therefore, since the JS becomes independent, the communication for recording the journal file from the FES and each BES increases to the JS. That is, communication via the communication network is always required when recording the commit preparation journal and the commit journal from the FES and BES. The number of communications during commit processing is 2 independent of JS.
Compared with the phase commit control method, ((FES number (=
1) + number of BES) × 4 times (transmission / reception of commit preparation + transmission / reception of commit).
【0023】なお、前記特開昭59ー11564号の
「巡回式2フェーズコミットメント制御方法」は、ジャ
ーナル処理内蔵型分散トランザクション処理に関するも
のであり、JSが独立化することにより発生するジャー
ナル記録の通信回数増加には対処できない。The "cyclic two-phase commitment control method" of Japanese Patent Laid-Open No. 59-11564 relates to distributed transaction processing with a built-in journal processing, and communication of journal recording generated by JS becoming independent. It cannot cope with the increase in the number of times.
【0024】(2)記録回数(入出力要求回数)の増加 前述のようにFES,BESからは、独立してジャーナ
ル記録要求が発生する為にそれぞれのジャーナル要求に
対応してジャーナル記録を行わなければならない。すな
わち、従来技術では、2フェーズコミットの制御に利用
されるコミット準備ジャーナル,コミットジャーナル,
ロールバックジャーナル(アボートジャーナルともい
う)は、トランザクションの状態を確実に記録する目的
からジャーナル記録要求到着後、不揮発な記録媒体であ
るジャーナルファイルへ記録する必要がある。故にJS
は、あるトランザクションのコミット時に(FES数
(=1)+BES数)×2回の記録要求を処理しなけれ
ばならない。この記録回数削減を提案しているのが前記
特願平2ー331605号「分散処理システムの分散ト
ランザクションファイル制御方法」である。本技術を利
用することでトランザクション中のあるJSにおいて、
ジャーナルサーバ数×2回の記録回数でジャーナル記録
処理が実現される。しかしながら本方法では、ジャーナ
ルサーバでのジャーナル記録待ち合わせのために複雑な
処理が必要である。また、前述のように通信回数に対す
る考慮がなされていない。(2) Increase in number of recordings (number of input / output requests) As described above, since journal recording requests are generated independently from the FES and BES, journal recording must be performed in response to each journal request. I have to. That is, in the conventional technique, a commit preparation journal, a commit journal, which is used for controlling two-phase commit,
The rollback journal (also referred to as an abort journal) needs to be recorded in a journal file which is a non-volatile recording medium after the arrival of a journal recording request in order to reliably record the transaction state. Therefore JS
Must process (FES number (= 1) + BES number) × 2 recording requests at the time of committing a certain transaction. This Japanese Patent Application No. 2-331605 "Distributed transaction file control method for distributed processing system" proposes to reduce the number of recordings. By using this technology, in a certain JS that is in a transaction,
The journal recording process is realized by the number of journal servers × 2 times of recording. However, this method requires complicated processing to wait for journal recording in the journal server. Moreover, as described above, the number of communications is not taken into consideration.
【0025】本発明の目的は、ジャーナルサーバが独立
した分散トランザクション処理システムにおいて、2フ
ェーズコミット処理を効率的に行うことができる2フェ
ーズコミット制御方法を提供することにある。An object of the present invention is to provide a two-phase commit control method capable of efficiently performing two-phase commit processing in a distributed transaction processing system with independent journal servers.
【0026】[0026]
【課題を解決するための手段】本発明による2フェーズ
コミット制御方法は、あるトランザクションにおける2
フェーズコミットの調整者となる計算機と、サブトラン
ザクションを処理し参加者となる計算機と、トランザク
ション状態履歴情報としてのトランザクションジャーナ
ルを不揮発性記録媒体に記録するジャーナル記録者とな
る計算機とを通信ネットワークで相互に接続した分散ト
ランザクション処理システムにおける2フェーズコミッ
ト制御方法であって、2フェーズコミットの第1段階と
して、前記調整者は、前記ジャーナル記録者に対してコ
ミット準備ジャーナルを記録させるとともに、すべての
前記参加者名および前記ジャーナル記録者を含む巡回先
情報を付加したコミット準備要求を行い、該コミット準
備要求を受けた各参加者は、自己のコミット準備ジャー
ナルを当該コミット準備要求に付加した後、該コミット
準備要求を次順の巡回先へ送信し、最後の参加者は、自
己のコミット準備ジャーナルを前記コミット準備ジャー
ナルに併合した後、当該コミット準備要求を前記ジャー
ナル記録者へ送信し、前記ジャーナル記録者は、各参加
者のコミット準備ジャーナルが付加された前記コミット
準備要求を受けて、全参加者のコミット準備ジャーナル
を記録した後、その旨を前記調整者へ報告し、2フェー
ズコミットの第2段階として、前記調整者は、すべての
参加者名を含む巡回先情報を付加したコミット要求を前
記ジャーナル記録者へ送信し、前記ジャーナル記録者
は、前記コミット要求を受けてすべての参加者のコミッ
トジャーナルを記録した後、次順の巡回先へコミット要
求を送信し、該コミット要求を受けた各参加者は、順次
前記コミット要求を次順の巡回先へ送信し、最後の参加
者は前記コミット要求を受けた旨を前記調整者へ報告す
ることを特徴とする。A two-phase commit control method according to the present invention is a method for controlling two transactions in a transaction.
A computer that is the coordinator of phase commit, a computer that processes subtransactions and that is a participant, and a computer that is a journal recorder that records a transaction journal as transaction status history information on a non-volatile recording medium In the two-phase commit control method in the distributed transaction processing system connected to, the coordinator causes the journal recorder to record a commit preparation journal as a first step of the two-phase commit, and all the participation. Each participant who receives the commit preparation request by adding the visit destination information including the name of the person and the journal recorder, and adds the commit preparation journal of its own to the commit preparation request, Prepare request next The final participant, after merging its own commit preparation journal with the commit preparation journal, sends the commit preparation request to the journal recorder, and the journal recorder In response to the commit preparation request to which the commit preparation journal is added, after recording the commit preparation journals of all the participants, the fact is reported to the coordinator, and as the second stage of the two-phase commit, the coordinator , A commit request to which the visit destination information including all the participant names is added is transmitted to the journal recorder, and the journal recorder receives the commit request and records the commit journals of all the participants. The commit request is transmitted to the next round destination, and each participant who receives the commit request sequentially sends the commit request to the next round destination. And, last of the participants, characterized in that it reports the fact that has received the commit request to the coordinator.
【0027】前記第1段階において、前記各参加者は、
コミット準備ジャーナルをコミット準備要求に付加せ
ず、ジャーナル記録者が各参加者のコミット準備ジャー
ナルを生成して記録するようにすることも可能である。In the first stage, each of the participants is
Instead of adding the commit preparation journal to the commit preparation request, the journal recorder can generate and record the commit preparation journal of each participant.
【0028】また、前記第2段階において、前記ジャー
ナル記録者が記録するコミットジャーナルは、ジャーナ
ル記録者が生成することができるが、調整者が生成して
ジャーナル記録者に送信するようにしてもよい。In the second stage, the commit journal recorded by the journal recorder can be generated by the journal recorder, but may be generated by the coordinator and transmitted to the journal recorder. .
【0029】[0029]
【作用】以下、本発明の代表的な構成として、ジャーナ
ル記録者(JS)がメインとサブの2台ある場合につい
て、本発明の作用を説明する。The operation of the present invention will be described below as a typical configuration of the present invention in the case where there are two journal recorders (JS), the main and sub journal recorders.
【0030】あるトランザクションにおいて、調整者
(FES)のコミット準備ジャーナルを記録した後、同
一JSへジャーナル記録をする同一グループの参加者
(BES)のコミット準備ジャーナルを巡回マージ(併
合)した後、巡回マージされたジャーナルをそのJSへ
記録する。各JSは各BESのコミット準備完了報告を
FESへ返す。FESは各JSから完了報告を受けてコ
ミット要求をFESのJSに送信する。In a certain transaction, after recording the commit preparation journal of the coordinator (FES), after cyclically merging (combining) the commit preparation journals of the participants (BES) of the same group who record the journal in the same JS, the circulation is performed. Record the merged journal in the JS. Each JS returns the commit ready report of each BES to the FES. The FES receives a completion report from each JS and sends a commit request to the JS of the FES.
【0031】FESのJS(メインJS)はコミットジ
ャーナルを記録し、他のJSへコミット要求を送信す
る。各JSは各BESグループのコミットジャーナルを
一括して記録した後、各BESグループへコミット要求
を送信する。各BESはコミット要求によりコミット処
理を行いそのサブトランザクションを終了する。The FES JS (main JS) records a commit journal and sends a commit request to another JS. Each JS collectively records the commit journal of each BES group, and then sends a commit request to each BES group. Each BES completes its sub-transaction by performing a commit process in response to a commit request.
【0032】上記において、本来BESが個々にコミッ
ト準備ジャーナル記録を行うべきところ、コミット準備
要求を巡回させ、コミット準備要求処理時に、同一JS
に記録するBES毎に各コミット準備ジャーナルをまと
めてそのJSへ一括記録する。コミット時も同様に、ジ
ャーナルと、制御要求と、完了報告をまとめてJSへ送
信し一括記録する。In the above description, where the BES should originally perform the commit preparation journal recording, the commit preparation request is circulated, and the same JS is executed when the commit preparation request is processed.
All commit preparation journals are collectively recorded for each JES recorded for each JES. Similarly, at the time of commit, the journal, the control request, and the completion report are collectively transmitted to the JS and collectively recorded.
【0033】上記によりJSを独立させた場合において
も、巡回電文により通信回数が削減され、かつ巡回時に
ジャーナルをマージすることによりジャーナルの一括記
録を行い、個別に行う場合に比べてジャーナルファイル
への記録回数(I/O回数)を軽減することができる。
さらにJSにおけるジャーナル待ち合わせといった処理
が不要となる。Even when the JSs are made independent as described above, the number of communications is reduced by the cyclic telegram, and the journals are collectively recorded by merging the journals during the patrol, and compared to the case where the journals are individually recorded, the journal file is recorded. The number of recordings (number of I / Os) can be reduced.
Further, a process such as journal waiting in JS is unnecessary.
【0034】[0034]
【実施例】以下、本発明の実施例について詳細に説明す
る。EXAMPLES Examples of the present invention will be described in detail below.
【0035】まず、図5により本発明の2フェーズコミ
ット制御の概略を説明する。図5は、図1に示したジャ
ーナルサーバ(JS)を有するシステムに本発明を適用
した場合のコミット処理のためのトランザクション制御
命令とコミット準備ジャーナル,コミットジャーナル,
ジャーナル処理完了報告の電文送信の概要を示してい
る。図5において、FES10とBES11,12はJ
S21にジャーナルを記録し、BES13はJS22に
ジャーナルを記録するものとする。First, the outline of the two-phase commit control of the present invention will be described with reference to FIG. FIG. 5 is a transaction control command for commit processing and a commit preparation journal, a commit journal, when the present invention is applied to the system having the journal server (JS) shown in FIG.
It shows an outline of the electronic message transmission of the journal processing completion report. In FIG. 5, FES10 and BES11, 12 are J
The journal is recorded in S21, and the BES 13 records the journal in JS22.
【0036】図1のAP130からコミット命令が発行
されるとFES10はコミット処理を開始する。When the commit command is issued from the AP 130 of FIG. 1, the FES 10 starts the commit process.
【0037】以下、コミットが成功する場合を図5を用
いて述べる。The case where the commit succeeds will be described below with reference to FIG.
【0038】第1段階のコミット準備段階でFES10
はJS21にコミット準備ジャーナル(FES10P
J:どのBESでトランザクション処理を行ったかを示
す参加者情報を含む)をJS21に送る。JS21はこ
れをジャーナルファイル151に記録する。JS21か
らの処理報告(図5のJS21から出力される右側のa
ck)受信後、FES10はコミット準備要求(pre
pare)をBES11に送信する。コミット準備要求
には次に巡回すべきすべてのBES及びJSに関する情
報(BES12,JS21)が付加されている。BES
11は、FES10から送られてきたコミット準備要求
に対して自己(BES11)のコミット準備ジャーナル
(図のBES11PJ)を併合した電文(prepar
e(JS21),BES11PJ)を、次の巡回先であ
るBES12へ送信する。この際、コミット準備要求中
の次巡回先BES12は不要となったので削除されてい
る。BES12が巡回されてきた電文を受けると、この
コミット準備要求に対して自己(BES12)のコミッ
ト準備ジャーナルBES12PJを併合した電文(図の
prepare,BES11PJ,BES12PJ)を
JS21へ送信する。この電文では、次巡回先であるJ
S21が削除されている。JS21は、BES12が編
集した電文のうち、コミット準備要求(prepar
e)を除いたジャーナル(BES11PJ,BES12
PJ)をそのままジャーナルファイル151に記録す
る。ジャーナル記録後、JS21は、BES11と12
のコミット準備完了報告(図5のJS21から出力され
る左側のack)をFES10に送信する。At the first stage, the commit preparation stage, FES10
JS21 to commit preparation journal (FES10P
J: (including participant information indicating in which BES the transaction processing was performed) is sent to JS21. The JS 21 records this in the journal file 151. Processing report from JS21 (a on the right side output from JS21 in FIG. 5)
After receiving ck), the FES 10 requests the commit preparation (pre
pare) to BES11. Information (BES12, JS21) regarding all BESs and JSs to be visited next is added to the commit preparation request. BES
Reference numeral 11 denotes a message (prepar) that merges its own (BES11) commit preparation journal (BES11PJ in the figure) with respect to the commit preparation request sent from the FES10.
e (JS21), BES11PJ) is transmitted to BES12 which is the next destination. At this time, the next round-trip destination BES 12 in the commit preparation request is no longer necessary and is deleted. When the BES 12 receives the circulated message, it transmits a message (prepare, BES11PJ, BES12PJ in the figure) that merges the commit preparation journal BES12PJ of its own (BES12) in response to this commit preparation request. In this message, J, the next destination
S21 has been deleted. JS21 selects the commit preparation request (prepar) from the message edited by BES12.
Journals excluding e) (BES11PJ, BES12)
PJ) is recorded in the journal file 151 as it is. After recording the journal, JS21 has BES11 and 12
Of the commit preparation completion message (ac on the left side output from the JS 21 in FIG. 5) is transmitted to the FES 10.
【0039】BES13についても上記と同様に、JS
22およびジャーナルファイル152に対する処理を行
う。As for the BES13, the JS
22 and the journal file 152.
【0040】FES10は、JS21と22からのコミ
ット準備完了報告を受け、コミット要求(図5中のコミ
ット段階におけるcommit(BES12,BES1
1,JS22,BES13))を、FES10のジャー
ナル記録先であるJS21(これをマスタJSという)
へ送信する。JS21は、この送信を受けて、FES1
0のコミットジャーナル(FES10CJ)とJS21
に記録されるべきBES11,12のコミットジャーナ
ルBES11CJとBES12CJを内部的に生成し、
生成されたジャーナルをジャーナルファイル151に記
録する。The FES 10 receives the commit preparation completion reports from the JSs 21 and 22, and sends a commit request (commit (BES12, BES1 at the commit stage in FIG. 5).
1, JS22, BES13)), which is the journal recording destination of FES10 (this is called the master JS).
Send to. Upon receiving this transmission, JS21 receives FES1.
0 Commit Journal (FES10CJ) and JS21
To internally generate commit journals BES11CJ and BES12CJ of BES11, 12 to be recorded in
The generated journal is recorded in the journal file 151.
【0041】JS21はジャーナル記録後、このトラン
ザクションでJS21にジャーナル記録を行う各BES
(BS12,BS11)へのコミット要求を巡回させ
る。またコミット要求に他のJSがある場合、マスタJ
Sと同様の処理を行う為にそのJSへ同様の情報を送信
する。図5ではJS22に対してコミット要求を送信し
巡回させている。After recording the journal, the JS21 records each journal in the JS21 by this transaction.
The commit request to (BS12, BS11) is circulated. If there is another JS in the commit request, the master J
In order to perform the same processing as S, the same information is sent to that JS. In FIG. 5, a commit request is sent to the JS 22 to make a round.
【0042】本発明において、2フェーズコミットのプ
ロトコルを守り、通信並びにジャーナル記録回数の削減
を実現するための重要点は、上記FESからJSへの巡
回電文送信とジャーナル記録にある。FESのコミット
ジャーナルが記録された時点でこのトランザクションの
コミットが決定される。つまり各BESはコミット準備
ジャーナル(PJ)を転送しその記録完了を待っている
段階であるが、この段階で調整者であるFESはコミッ
ト決定を下す。つまりトランザクションとしてはコミッ
トが確定されることになる。BESは第1段階の中でコ
ミット準備ジャーナル記録待ちとなる。In the present invention, important points for keeping the protocol of two-phase commit and reducing the number of communication and journal recording are the transmission of the cyclic message from the FES to the JS and the journal recording. When the FES commit journal is recorded, the commit of this transaction is decided. In other words, each BES is in the stage of transferring the commit preparation journal (PJ) and waiting for the completion of the recording thereof, but at this stage, the coordinator FES makes a commit decision. That is, the commit is confirmed as a transaction. The BES waits for the commit preparation journal recording in the first stage.
【0043】なお、上記コミット準備ジャーナルの電文
巡回の際、各BESにおいてジャーナル併合を行ってい
るが、図31に示すように、巡回BES数が増加するこ
とによりジャーナル量が増加し、これに伴って通信量が
増大する。これを改善するために、ジャーナルの併合を
行わずに、巡回先BES、JS情報をFESから送信さ
れたそのものを用いる。つまり、個々のFES,BES
で次の巡回先情報を削除しない。これにより、巡回先B
ES情報が残ったままメッセージがJSに到着し、JS
での記録時に各コミット準備ジャーナルをJS側で内部
的に生成することにより、巡回メッセージの通信量を削
減することが可能となる。この具体的な例については後
述する。Although the journals are merged in each BES at the time of circulating the message of the commit preparation journal, as shown in FIG. 31, the number of circulating BESs increases and the journal amount increases. Communication volume increases. In order to improve this, the destination BES and JS information transmitted from the FES itself is used without merging the journals. That is, individual FES, BES
Do not delete the next tour information. As a result, the destination B
The message arrived at JS with the ES information remaining, and JS
By internally generating each commit preparation journal at the time of recording in J.S., it is possible to reduce the communication amount of the cyclic message. A specific example of this will be described later.
【0044】次に本発明の2フェーズコミット制御方法
におけるトランザクションの状態遷移について説明す
る。Next, the state transition of a transaction in the two-phase commit control method of the present invention will be described.
【0045】図8にFESトランザクション状態遷移、
図9にBESのトランザクション状態遷移,JSのトラ
ンザクション状態遷移を示す。これらの状態遷移図にお
いて円内がトランザクション状態、矢印は状態遷移を起
こすイベントを示す。尚、前述のようにFESがジャー
ナル記録するJSをマスタJS,BESがジャーナル記
録するJSをサブJSと呼ぶ。FESとBESが共用し
て使うJSはマスタJSである。またサーバがCPU障
害,OS障害,通信障害等の理由により異なるサーバか
らの処理要求を処理できない状態をダウン状態またはダ
ウンと呼ぶ。FIG. 8 shows the FES transaction state transition,
FIG. 9 shows the transaction state transition of BES and the transaction state transition of JS. In these state transition diagrams, circles indicate transaction states, and arrows indicate events that cause state transitions. The JS recorded by the FES as a journal as described above is called a master JS, and the JS recorded by the BES as a journal is called a sub JS. The JS shared by FES and BES is the master JS. A state in which a server cannot process a processing request from a different server due to a CPU fault, an OS fault, a communication fault, or the like is called a down state or down.
【0046】図8のFESの状態遷移について説明す
る。The state transition of the FES shown in FIG. 8 will be described.
【0047】トランザクションの初期状態はフリー80
1である。トランザクション開始即ちトランザクション
開始命令の発行により処理中802に遷移する。The initial state of a transaction is free 80
It is 1. When the transaction is started, that is, the transaction start command is issued, the process transits to 802.
【0048】処理中802においてAPからデータベー
ス操作命令が発行され、データベースに対する検索変更
追加削除等の操作が行われる。APからコミットコマン
ドが発行されるとcommit準備処理中803に遷移
し、ロールバックコマンドが発行されるとrollba
ck仮決定808に遷移する。During processing 802, a database operation command is issued from the AP, and operations such as search change addition / deletion to the database are performed. When the AP issues a commit command, the state transitions to 803 during commit preparation processing, and when a rollback command is issued, rollba
The ck temporary decision 808 is entered.
【0049】commit準備処理中803はFESの
コミット準備ジャーナルを記録し、各BESに対する巡
回電文を組立て、あるJSにジャーナル記録するBES
に巡回電文を送信し、電文巡回後、JSからのack応
答またはBESからのnakを待つ状態である。JSま
たはBESからの応答を受け、正常完了応答(ack)
であればコミット仮決定804に遷移する。もしいずれ
かの応答がnakの場合、またはBES、JS障害等の
理由により電文の応答がある一定時間無い場合、ロール
バック仮決定808に遷移する。During commit preparation processing 803, a commit preparation journal of the FES is recorded, a circuit message for each BES is assembled, and a journal is recorded in a certain JS.
In this state, the patrol message is transmitted to, and after the message is patrolled, an ack response from JS or a nak from BES is waited for. Receives a response from JS or BES, and returns normal completion (ack)
If so, the transition to the temporary commit decision 804 is made. If any response is nak, or if there is no response from the electronic message for a certain period of time due to reasons such as BES or JS failure, the rollback provisional decision 808 is entered.
【0050】コミット仮決定804、はFESはコミッ
トを決定したがコミットジャーナルが未記録状態にある
状態である。ここでコミット要求とコミットの巡回を行
うための情報をマスタJSへ送信する。送信後、コミッ
ト保留805に遷移する。同送信時通信障害、JSダウ
ン等でJSに電文を送信できない場合その状態が保留さ
れる。コミット要求に必要な情報は、本トランザクショ
ンに参加しているマスタJS,サブJSとマスタ,各サ
ブJSにジャーナル出力するBES群の識別子具体的に
は各サーバ名である。The temporary commit decision 804 is a state in which the FES has decided to commit, but the commit journal is in an unrecorded state. Here, the information for performing the commit request and the commit round is transmitted to the master JS. After the transmission, the state transits to the commit hold 805. If a message cannot be transmitted to JS due to a communication failure during transmission, JS down, etc., that state is held. The information required for the commit request is the master JS participating in this transaction, the sub JS and the master, and the identifier of the BES group journal-outputted to each sub JS, specifically, each server name.
【0051】コミット保留805は、コミットを仮決定
した状態でJSから巡回してBESを経由して返される
コミット完了命令を巡回先数即ちJS数分待つ状態であ
る。この状態で全巡回先からの処理結果が正常終了(a
ck)の場合、そのトランザクションがコミットされた
とし、そのトランザクションを完了つまりフリー801
の状態となる。状態805である一定時間たってもどの
巡回先からも応答がない場合、マスタJS判定806を
行う。この場合、マスタJSへのコミット要求がJSダ
ウンにより正常に行われない場合のトランザクション回
復を行う。一部のJSから応答がない場合、マスタJS
へのコミットジャーナルは正常完了しているので未応答
の巡回先の各BESに対してコミット再送を行う(80
7)。The commit hold 805 is a state in which a commit completion command, which is patrolled from JS and returned via BES, is waited for the number of traversing destinations, that is, JSs, in the state where the commit is tentatively decided. In this state, the processing results from all the patrol destinations are completed normally (a
ck), it is assumed that the transaction has been committed, and the transaction is completed, that is, free 801.
It becomes the state of. When there is no response from any of the patrol destinations in the state 805 for a certain period of time, the master JS determination 806 is performed. In this case, the transaction is recovered when the commit request to the master JS is not normally made due to JS down. If there is no response from some JS, master JS
Since the commit journal has been normally completed, the commit is retransmitted to each BES that has not responded yet (80
7).
【0052】マスタJS判定806は、マスタJSが障
害または全ての巡回路で障害が発生した等の理由でダウ
ンした場合に、そのトランザクションをコミットするか
ロールバックするかを決定する処理である。このマスタ
JS判定では、当トランザクションのFESのコミット
ジャーナルがマスタJS上にあるか否かを判断する。も
しコミットジャーナルがあれば各BESに対してcom
mit再送807を行う。The master JS judgment 806 is a process for deciding whether to commit or roll back the transaction when the master JS goes down due to a failure or a failure in all circuits. In this master JS determination, it is determined whether or not the commit journal of the FES of this transaction is on the master JS. If there is a commit journal, com for each BES
mit retransmission 807 is performed.
【0053】commit再送807は、全BESにc
ommitを再送し、全BESからackがあればトラ
ンザクション状態はフリー801となる。BESがダウ
ンしていればその回復を待つ。状態806で、もしコミ
ットジャーナルが無い場合、マスタJS AJ(アボー
トジャーナル)記録811へ遷移する。マスタJSがダ
ウンしている場合、その回復を待つ。The commit retransmission 807 is c for all BESs.
If the omit is retransmitted and ack is received from all BESs, the transaction status becomes free 801. If BES is down, wait for its recovery. If there is no commit journal in the state 806, a transition is made to the master JS AJ (abort journal) record 811. If the master JS is down, wait for its recovery.
【0054】ロールバック仮決定808は、そのトラン
ザクションを無効化することを決定したがアボートジャ
ーナルAJが未記録状態にある状態である。マスタJS
へロールバック要求を行い、ロールバック保留809に
遷移する。The rollback provisional decision 808 is a state in which the abort journal AJ has been decided to be invalidated but the abort journal AJ is in an unrecorded state. Master JS
A rollback request is made to and a transition is made to rollback suspension 809.
【0055】ロールバック保留809は、ロールバック
を仮決定した状態でJSから巡回してBESを経由して
返されるロールバック完了ackを巡回先数即ちJS数
分待つ状態である。この状態で全巡回先からの正常終了
の場合、そのトランザクションを完了つまりフリー80
1の状態に遷移する。ロールバック保留809の状態
で、巡回先のいずれかのJSでダウン、またはJS,B
ESが巡回処理中にダウンした等によるタイムアウトに
よりサーバダウンと検知した場合、トランザクションの
状態はrollback再送812に遷移する。The rollback suspension 809 is a state in which the rollback completion ack is returned from the JS by way of the BES while the rollback is tentatively decided, and waits for the number of patrol destinations, that is, the number of JS. In this state, if all the patrol destinations are completed normally, the transaction is completed, that is, free 80
The state changes to 1. With rollback pending 809, down at any JS of the patrol destination, or JS, B
When the server is detected to be down due to a timeout due to the ES going down during the patrol process, the transaction status transits to rollback retransmission 812.
【0056】マスタJS AJ判定810は、FESダ
ウンからの回復過程で、ダウン時に完了していないトラ
ンザクションを、マスタJSのジャーナルに基づいて元
に回復する場合に回復途中のトランザクションの最初の
開始状態となる。まずトランザクションがアボート決定
されているのか否かを判定する。マスタJSに当トラン
ザクションのFESのアボートジャーナルが有った場
合、トランザクションはロールバック決定済みであり、
トランザクションはフリー状態801となる。コミット
準備ジャーナルが存在し、アボートジャーナルが無い場
合、マスタJSAJ記録811に遷移する。コミット準
備ジャーナルPJが記録されていない場合、同トランザ
クションは無効である為にトランザクション状態はフリ
ー801となる。もしマスタJSがダウン等の理由で応
答しない場合、その回復を待つ。The master JS AJ judgment 810 is the first start state of a transaction in the middle of recovery when recovering a transaction that has not been completed at the time of down in the recovery process from FES down based on the journal of the master JS. Become. First, it is determined whether or not the transaction has been aborted. If the master JS has the abort journal of the FES of this transaction, the transaction has already been decided to be rolled back,
The transaction becomes free state 801. When the commit preparation journal exists and the abort journal does not exist, the transition is made to the master JSAJ record 811. If the commit preparation journal PJ is not recorded, the transaction status is free 801 because the same transaction is invalid. If the master JS does not respond due to down or the like, it waits for its recovery.
【0057】マスタJS AJ記録811は,本トラン
ザクション状態が障害等の理由により中途半端な状態に
なっているのをロールバック化するものである。マスタ
JSがアボートジャーナルを出力し正常完了するとトラ
ンザクションはrollback再送812となる。マ
スタJSがダウン中の場合その回復を待つ。The master JS AJ record 811 is for rolling back this transaction state which is halfway due to a failure or the like. When the master JS outputs the abort journal and completes normally, the transaction becomes rollback retransmission 812. If the master JS is down, wait for its recovery.
【0058】rollback再送812では、各BE
Sに対してrollback再送を行なう。全BESか
らackがあればトランザクションはフリー801とな
る。BESがダウン中であればその回復を待つ。In the rollback retransmission 812, each BE is
The rollback is retransmitted to S. If there is ack from all BESs, the transaction becomes free 801. If BES is down, wait for its recovery.
【0059】次にBESの状態遷移について述べる。Next, the state transition of BES will be described.
【0060】BESのトランザクションはサブトランザ
クションである。The BES transaction is a sub-transaction.
【0061】サブトランザクションの初期状態はフリー
901である。BESサブトランザクションはサブトラ
ンザクション開始コマンドまたは最初のデータベース処
理要求時に処理中902に遷移する。尚、フリー901
でコミット要求またはロールバック要求を受けると正常
終了を返してフリー901のままである。The initial state of a sub-transaction is free 901. The BES sub-transaction transits to in-process 902 when a sub-transaction start command or the first database processing request. Free 901
When a commit request or rollback request is received at, the normal end is returned and the free 901 remains.
【0062】処理中902はデータベースを操作中の状
態である。FESまたは巡回中の1つ前のBESからコ
ミット準備要求かつ準備完了要求があるとコミット処理
を行い、コミット保留状態903となる。自分自身がコ
ミット処理に失敗した場合、rollback保留90
5となる。FESからロールバック要求があると、当該
サブトランザクションは無効となり、フリー状態901
となる。Processing 902 is a state in which the database is being operated. When there is a commit preparation request and a preparation completion request from the FES or the BES immediately before the circulating BES, the commit process is performed and the commit pending state 903 is set. If the commit process fails on its own, rollback pending 90
It becomes 5. When there is a rollback request from FES, the sub-transaction becomes invalid and free state 901
Becomes
【0063】コミット保留状態903は、BESがサブ
トランザクションに関するコミット準備をJSに要求
後、コミットまたはロールバック要求を待機している状
態である。この状態からコミット要求またはロールバッ
ク要求がされると、サブトランザクションがコミットま
たはロールバックされ、サブトランザクションはフリー
状態901に遷移する。巡回路上のBES,JS,FE
Sがダウンし応答が無い場合、FES判定906に遷移
する。The commit-pending state 903 is a state in which the BES waits for a commit or rollback request after requesting the JS to prepare for committing a subtransaction. When a commit request or rollback request is issued from this state, the subtransaction is committed or rolled back, and the subtransaction transits to the free state 901. BES, JS, FE on the circuit
When S goes down and there is no response, the process transits to FES determination 906.
【0064】ロールバック保留状態905からはロール
バック要求によりフリー状態901に遷移する。From the rollback pending state 905, a transition to the free state 901 is made by a rollback request.
【0065】サブJS判定904は、BESダウン後、
トランザクション回復時の開始状態である。サブJS判
定904では、当該トランザクションのコミットジャー
ナルCJ,アボートジャーナルAJがある場合とコミッ
ト準備ジャーナルPJが無い場合、トランザクションは
フリー901の状態に遷移する。コミット準備ジャーナ
ルPJの無い場合またはコミットジャーナルCJの無い
場合、FES判定906に遷移する。サブJSダウンの
場合、サブJSの回復待ちとなる。The sub-JS judgment 904 is after the BES is down.
This is the start state at the time of transaction recovery. In the sub-JS determination 904, the transaction transits to the free 901 state when there is the commit journal CJ and the abort journal AJ of the transaction and when there is no commit preparation journal PJ. When there is no commit preparation journal PJ or when there is no commit journal CJ, the process transits to FES determination 906. If the sub-JS is down, the sub-JS is on standby for recovery.
【0066】FES判定906は,FESに対してトラ
ンザクションの状態を問い合わせトランザクション状態
を確定する段階である。FESがダウン中またはFES
がマスタJSに対してトランザクション状態を確定しよ
うとしている場合、待ち状態になる。FESからコミッ
トまたロールバック要求が再送されるかFESのトラン
ザクションがすでにフリーの場合、サブJSジャーナル
記録907へ遷移する。The FES judgment 906 is a step of inquiring the transaction status of the FES to determine the transaction status. FES is down or FES
Is waiting for the master JS to determine the transaction status. When a commit or rollback request is retransmitted from the FES or the FES transaction is already free, the sub JS journal record 907 is entered.
【0067】サブJSジャーナル記録907では、サブ
JSにジャーナルが記録されていない場合、サブJSに
ジャーナルを記録する。サブJSがダウン等の理由で応
答しない場合、サブJSの回復を待つ。In the sub-JS journal recording 907, when the journal is not recorded in the sub-JS, the journal is recorded in the sub-JS. If the sub-JS does not respond due to down or the like, wait for the sub-JS to recover.
【0068】次にJSの状態遷移について述べる。Next, the state transition of JS will be described.
【0069】JSにおけるトランザクション初期状態は
フリー910である。コミット準備要求時にはコミット
保留状態911に遷移し、ロールバック要求時にはフリ
ー910のままである。The initial state of a transaction in JS is free 910. When a commit preparation request is made, the state transits to the commit pending state 911, and when a rollback request is made, the state remains free 910.
【0070】コミット保留中911は、FESまたはマ
スタJSからの要求を受けて状態遷移する。コミット要
求またはロールバック要求されるとフリー910に遷移
する。The commit pending state 911 changes its state in response to a request from the FES or the master JS. When a commit request or a rollback request is made, the state transitions to free 910.
【0071】JSダウンの場合、トランザクションの状
態を回復するためにジャーナルファイルを読み、その内
容をFESまたはBESの問い合わせに対して報告す
る。また、JSダウン時、準備ジャーナルがあり、コミ
ットジャーナルおよびアボートジャーナルがない場合は
コミット保留911から開始し、その他はフリー910
から開始する。In the case of JS down, the journal file is read in order to recover the transaction state, and the contents are reported to the inquiry of FES or BES. Also, when JS is down, if there is a preparation journal, and there is no commit journal or abort journal, it starts from the commit pending 911, and the others are free 910.
Start with.
【0072】次に、本発明におけるより具体的な実施例
を示す。Next, more specific examples of the present invention will be shown.
【0073】図6にこの具体例のシステム構成を示す。
各サーバ構成の詳細を説明する。FES10は、ユーザ
のアプリケーションプログラムAP130のデータベー
ス操作要求を各BESに処理させる。BES11,1
2,13はデータベースアクセスを行う。JS21,2
2はジャーナル処理を行う。なお、図では便宜上、BE
S11,12,13を同一のサーバとして示し、JS2
1,22を同一のサーバとして示している。FIG. 6 shows the system configuration of this specific example.
The details of each server configuration will be described. The FES 10 causes each BES to process the database operation request of the user's application program AP130. BES11,1
2 and 13 access the database. JS21, 2
2 performs journal processing. In the figure, for convenience, BE
S11, 12, 13 are shown as the same server, and JS2
1 and 22 are shown as the same server.
【0074】FES側トランザクション処理部602
は、トランザクション管理表603(図7)に管理され
るトランザクション並びにサブトランザクションの状態
情報を操作してAP130のトランザクション状態の操
作を行う。AP130からcommitやrollba
ck命令が発行されると、commit,rollba
ck処理を行う。さらに、データベース操作要求がAP
130から発行されると操作要求を解析し、通信処理部
604を介して、操作対象データベースを保持するBE
Sに操作要求を送信する。またトランザクション処理部
602中で発生するジャーナル記録要求をJSに送信す
る。Transaction processing unit 602 on FES side
Operates the transaction status of the AP 130 by operating the status information of the transaction and sub-transaction managed in the transaction management table 603 (FIG. 7). From AP130 commit and rollba
When the ck command is issued, commit, rollba
ck processing is performed. Furthermore, the database operation request is AP
The BE that analyzes the operation request when issued from 130 and holds the operation target database via the communication processing unit 604.
The operation request is transmitted to S. Further, the journal recording request generated in the transaction processing unit 602 is transmitted to JS.
【0075】BES側トランザクション処理部606
は、トランザクション管理表609に管理されるトラン
ザクション(サブトランザクションの状態情報)を操作
してAP130のトランザクション状態の操作を行う。
通信処理部605を介してFES10からcommit
やrollback命令を受信すると、commit,
rollback処理を行う。同命令の巡回の仲介も行
う。FES10からデータベース操作要求が発行される
とデータベースを操作し処理結果をFESに送信する。BES side transaction processing unit 606
Manipulates the transaction (sub-transaction status information) managed in the transaction management table 609 to manipulate the transaction status of the AP 130.
Commit from FES10 via communication processing unit 605
When receiving the command or rollback command, commit,
Performs rollback processing. It also mediates the patrol of the same command. When the database operation request is issued from the FES 10, the database is operated and the processing result is transmitted to the FES.
【0076】JSは、ジャーナル処理部608、トラン
ザクション管理表610および通信処理部607を有す
る。The JS has a journal processing unit 608, a transaction management table 610 and a communication processing unit 607.
【0077】通信処理部604,605,607は、通
信網を経由して行われる電文の送受信制御を行う。各サ
ーバ内のトランザクション処理部602,606やジャ
ーナル処理部608は相手サーバを特定する識別子を指
定して各サーバへの電文送信を通信処理部604,60
5,607に依頼する。本実施例においてはサーバ名と
いう識別子で送受信される。受信は通信処理部が送信元
からの電文を受け、相手サーバ側通信処理部に送信す
る。相手サーバ側通信処理部は受信先サーバが電文を受
信可能になるまで送信電文を保持する。サーバ側で電文
受信要求を行い受信可能になった場合、保持している電
文を渡す。The communication processing units 604, 605, 607 control transmission / reception of electronic messages performed via a communication network. The transaction processing units 602 and 606 and the journal processing unit 608 in each server specify an identifier for identifying the partner server and transmit a message to each server by the communication processing units 604 and 60.
Request 5,607. In the present embodiment, transmission / reception is performed using an identifier called a server name. For reception, the communication processing unit receives a message from the transmission source and transmits it to the communication processing unit on the partner server side. The partner server-side communication processing unit holds the transmission message until the reception destination server can receive the message. When the server makes a request to receive a message and it becomes possible to receive it, the retained message is passed.
【0078】電文は以下の形式をもつ。The message has the following format.
【0079】(1)送信先サーバ識別子(サーバ名) (2)送信元サーバ識別子(サーバ名) (3)トランザクション識別子 (4)サブトランザクション識別子(FES,BES間
送信時) (5)処理要求(コミット要求、ロールバック要求等) (6)処理要求に伴うパラメタ(巡回先リスト等) (7)その他のデータや処理結果(データベース操作
文,データベース操作データ等) 尚、以降(1)から(4)の部分を電文ヘッダと呼ぶ。
以下の説明では各電文は電文へッダが付けられているこ
とを仮定する。(1) Destination server identifier (server name) (2) Source server identifier (server name) (3) Transaction identifier (4) Subtransaction identifier (when transmitting between FES and BES) (5) Processing request ( (6) Parameters accompanying the processing request (tour destination list, etc.) (7) Other data and processing results (database operation statement, database operation data, etc.) In addition, from (1) to (4) ) Is called a message header.
In the following description, it is assumed that each message has a message header.
【0080】ジャーナル処理部608は各サーバからの
ジャーナル記録要求を処理する。またトランザクション
処理に関する電文巡回の仲介を行う。The journal processing unit 608 processes journal recording requests from each server. It also acts as an intermediary for the electronic message circulation related to transaction processing.
【0081】図30(a)にジャーナルの形式を示す。The format of the journal is shown in FIG.
【0082】ジャーナルヘッダ3101は、ジャーナル
通番3104、トランザクション識別子3105、サブ
トランザクション識別子3106、調整者名3107、
その他3108から構成される。これらの情報は、FE
SやBESが異常終了した場合、APがロールバックし
た場合にジャーナルを利用した回復を行うために必要な
情報である。ジャーナル通番3104は、ジャーナルに
一意に付与された一連番号である。トランザクション識
別子3105は、FESで発生したトランザクションに
一意に付与された識別子、具体的には一連番号である。
サブトランザクション識別子3106は、トランザクシ
ョン内で他のノードで発生したサブトランザクションに
付与された識別子である。The journal header 3101 includes a journal serial number 3104, a transaction identifier 3105, a subtransaction identifier 3106, a coordinator name 3107,
Others 3108. This information is FE
This information is necessary for recovery using the journal when S or BES ends abnormally or when the AP rolls back. The journal serial number 3104 is a serial number uniquely assigned to the journal. The transaction identifier 3105 is an identifier uniquely assigned to a transaction generated in FES, specifically, a serial number.
The sub-transaction identifier 3106 is an identifier given to a sub-transaction generated in another node within the transaction.
【0083】ジャーナル種別3102は記録が行われた
ジャーナルの種別である。コミット準備、コミット、ロ
ールバック、トランザクション開始、トランザクション
終了、データベースの更新前後ジャーナル等のジャーナ
ル種別を示す。ジャーナル記録要求時に直ちにジャーナ
ルファイル上に記録しなければならないのは、コミット
準備、コミット、ロールバックの各ジャーナルである。
他のジャーナルは、JSに送信されてもジャーナルバッ
ファ(JSのジャーナル処理部608内にある)上に順
序を保証されて蓄積され、ジャーナルバッファ満杯やコ
ミット準備、コミット、ロールバックジャーナルの記録
時に一括してジャーナルファイルに記録されればよい。
トランザクション開始ジャーナルやトランザクション終
了ジャーナルは、後述するトランザクション開始時、ト
ランザクションフリー時にJSのジャーナルバッファに
蓄積される。データベース更新前後ジャーナルは、デー
タベース更新時にその都度JSに送信されジャーナルバ
ッファに蓄積される。The journal type 3102 is the type of the recorded journal. Indicates the type of journal such as commit preparation, commit, rollback, transaction start, transaction end, and before / after database update journal. It is the commit preparation, commit, and rollback journals that must be immediately recorded in the journal file when a journal recording request is made.
Other journals are stored in the journal buffer (in the JS journal processing unit 608) with guaranteed order even when sent to JS, and are collectively recorded when the journal buffer is full, commit preparation, commit, and rollback journal are recorded. Then, it may be recorded in the journal file.
The transaction start journal and the transaction end journal are accumulated in the JS journal buffer when the transaction is started and the transaction is free, which will be described later. The journals before and after the database update are transmitted to the JS each time the database is updated and accumulated in the journal buffer.
【0084】ジャーナルデータ3103には、ジャーナ
ル種別に対応したデータが格納される。The journal data 3103 stores data corresponding to the journal type.
【0085】図30(b)に、各ジャーナル種別に対応
したジャーナルデータの内容を示す。コミット準備ジャ
ーナルであって、調整者が出力するコミット準備ジャー
ナルにおいては、障害からの回復に必要な巡回先BES
名とJS名のリスト情報がデータとなる。その他のコミ
ット準備ジャーナルに関しては、サブトランザクション
が発生したBES名がそのデータとなる。データベース
の変更前後ジャーナルは、データベース等の資源に対す
る変更(データの追加、削除、更新)を行った場合の変
更前後のデータを記録する。上記以外のジャーナル種別
に関しては、対応するジャーナルデータは存在しない。FIG. 30B shows the contents of journal data corresponding to each journal type. In the commit preparation journal output by the coordinator, which is the commit preparation journal, the BES to be visited, which is necessary for recovery from a failure,
List information of names and JS names becomes data. For other commit preparation journals, the BES name in which the sub-transaction occurred is the data. The pre- and post-change database journal records the data before and after the change when the resource such as the database is changed (data is added, deleted, or updated). For journal types other than the above, there is no corresponding journal data.
【0086】次に図7に示したトランザクション管理表
について説明する。図7はFESにおけるトランザクシ
ョン管理表である。Next, the transaction management table shown in FIG. 7 will be described. FIG. 7 is a transaction management table in FES.
【0087】トランザクション管理表603は以下の項
目から成る。トランザクション識別子702はFESで
発生するトランザクションにシステム内一意に付与され
た識別子である。トランザクション状態情報703はト
ランザクション識別子702で特定されるトランザクシ
ョンの現在の状態を保持する。トランザクションの状態
とは、図8,図9で示したトランザクション状態遷移の
トランザクション状態である。The transaction management table 603 includes the following items. The transaction identifier 702 is an identifier uniquely given in the system to a transaction generated in FES. The transaction status information 703 holds the current status of the transaction identified by the transaction identifier 702. The transaction state is the transaction state of the transaction state transition shown in FIGS. 8 and 9.
【0088】APのプロセス番号704は、当トランザ
クションがどのプロセス即ちAPに割り当てられている
かを示す。サブトランザクション情報へのポインタ70
5はサブトランザクション管理表706のサブトランザ
クション情報へのポインタである。The AP process number 704 indicates to which process, ie, AP, this transaction is assigned. Pointer to subtransaction information 70
Reference numeral 5 is a pointer to subtransaction information in the subtransaction management table 706.
【0089】JS数710は、本トランザクション内で
ジャーナル記録を行うJSの数である。JS管理表への
ポインタ711はJS管理表712へのポインタであ
る。The JS number 710 is the number of JSs for which journal recording is performed within this transaction. The pointer 711 to the JS management table is a pointer to the JS management table 712.
【0090】サブトランザクション管理表706は以下
の項目からなる。サブトランザクション識別子707は
システム内で発生するサブトランザクションにおいて一
意な識別子である。BES名715は、サブトランザク
ションを割り付けたBESの名称である。記録先JS名
709は、各BESがジャーナルを記録するJSの名称
を持つ。The sub-transaction management table 706 consists of the following items. The sub-transaction identifier 707 is a unique identifier in a sub-transaction generated in the system. The BES name 715 is the name of the BES to which the sub transaction is assigned. The recording destination JS name 709 has the name of the JS in which each BES records a journal.
【0091】JS管理表712は以下の項目からなる。
JS名713は、あるトランザクションがそのトランザ
クション中で関係するJSの名称を持つ。巡回電文状態
情報714は、巡回電文処理がack受信済みか再送要
かまたはその他の状態であるかを記録する。The JS management table 712 consists of the following items.
The JS name 713 has the name of the JS to which a transaction is related in the transaction. The cyclic message status information 714 records whether the cyclic message processing is ack received, retransmission is required, or any other status.
【0092】BESのトランザクション管理表609
は、FESにおけるトランザクション管理表603にお
けるサブトランザクション管理表706とジャーナルサ
ーバ管理表712を持たない。トランザクション識別子
にはサブトランザクション識別子が記録されている。BES transaction management table 609
Does not have the sub-transaction management table 706 and the journal server management table 712 in the transaction management table 603 in FES. A sub-transaction identifier is recorded in the transaction identifier.
【0093】JSのトランザクション管理表610もB
ESのトランザクション管理表同様サブトランザクショ
ン管理表とJS管理表を持たない。各サーバのトランザ
クション管理表は各サーバの起動時に作成される。The JS transaction management table 610 is also B
Similar to the ES transaction management table, it does not have a sub-transaction management table and a JS management table. The transaction management table of each server is created when each server is started.
【0094】次に、図10を用いてAPの処理概要を以
下に示す。Next, the processing outline of the AP will be described below with reference to FIG.
【0095】AP130が処理を開始するとデータベー
ス操作文の実行要求1001が行われる。その結果をア
プリケーションプログラム処理1002で加工する。上
記処理はアプリケーションプログラム毎に任意の処理が
行われる。データベース操作文を利用した処理が終了し
た後、そのアプリケーションが、そのトランザクション
をコミットして良いか否か判定(1003)する。When the AP 130 starts processing, a database operation statement execution request 1001 is made. The result is processed by the application program processing 1002. The above processing is performed arbitrarily for each application program. After the processing using the database operation statement is completed, the application determines whether or not the transaction can be committed (1003).
【0096】コミット可能な場合COMMIT要求10
04を発行する。コミット不可と判断されるとロールバ
ック要求1005を要求し、そのトランザクションで操
作したデータベースの内容を無効化する。COMMIT request 10 if committable
Issue 04. When it is determined that the commit is impossible, the rollback request 1005 is requested and the contents of the database operated by the transaction are invalidated.
【0097】図11にデータベース操作文の実行要求1
001の処理内容を示す。FIG. 11 shows a database operation statement execution request 1
The processing content of 001 is shown.
【0098】データベース操作文の実行要求はAPの延
長でトランザクション処理部で処理される。APからの
データベース操作要求が要求されると当該データベース
操作要求を処理するBESの決定処理(1101)を行
い、データベース操作を行うBESを決定する。BES
名はこの段階で決定される。一般的にBESと分散して
いるデータベースの対応はデータベース定義時に決定さ
れる。当該BESに処理要求を送る前にサブトランザク
ションの登録(1102)を処理する。A request for executing a database operation statement is processed by the transaction processing unit by extending AP. When a database operation request from the AP is requested, a BES determining process (1101) for processing the database operation request is performed to determine a BES for database operation. BES
The name is determined at this stage. Generally, the correspondence between BES and distributed databases is determined at the time of database definition. The subtransaction registration (1102) is processed before sending a processing request to the BES.
【0099】サブトランザクション登録後、決定BES
へデータベース操作文とトランザクション識別子とサブ
トランザクション識別子を送信(1103)する。同デ
ータベース操作要求はBESのトランザクション処理部
で処理される。データベース操作が完了すると、その処
理結果がBESから送信される。この時、その処理結果
が当該トランザクションにおけるBESに対する最初の
データベース操作要求であれば(1104)、そのBE
Sがジャーナル記録するJS名が併合された形式で電文
が送信されるので、JS名と処理結果を受信(110
6)する。After registration of subtransaction, decision BES
The database operation statement, transaction identifier, and sub-transaction identifier are transmitted to (1103). The database operation request is processed by the transaction processing unit of BES. When the database operation is completed, the processing result is transmitted from BES. At this time, if the processing result is the first database operation request to the BES in the transaction (1104), the BE
Since the electronic message is transmitted in a format in which the JS name recorded by S in the journal is merged, the JS name and the processing result are received (110
6) Do.
【0100】送信されたJS名がJS管理表に登録され
ているか否か判断(1108)し、登録されていなけれ
ばJS管理表にJS名を登録(1109)する。この
時、トランザクション管理表のJS数に1を加える。次
にBESに割り当てられたサブトランザクション識別子
に対応するJS名項目に送信された記録先JS名を設定
(1111)する。It is judged whether the transmitted JS name is registered in the JS management table (1108), and if not registered, the JS name is registered in the JS management table (1109). At this time, 1 is added to the JS number of the transaction management table. Next, the transmitted recording destination JS name is set (1111) in the JS name item corresponding to the sub-transaction identifier assigned to the BES.
【0101】上記手段により、このトランザクションが
関連するBESが記録するJSの名称が取得される。も
しBESからの処理結果が最初のデータベース操作要求
でなければ処理結果のみ受信(1105)する。データ
ベースの処理結果を受信後、各結果をAPへ転送(11
12)することで、APはデータベース処理結果に対し
て操作を行う。By the above means, the name of the JS recorded by the BES related to this transaction is acquired. If the processing result from the BES is not the first database operation request, only the processing result is received (1105). After receiving the database processing results, transfer each result to the AP (11
By doing 12), the AP operates on the database processing result.
【0102】サブトランザクションの発生に関連して各
BESのJS識別子を取得する手段を上記に示した。J
S名の取得は上記動的取得手段だけでなく各FESの構
成定義パラメタに指定する方法もある。構成定義パラメ
タは分散トランザクションにおけるシステム構成を定義
したパラメタであり、分散トランザクション処理に参加
する全てのFES,BES,JSの一覧が定義されてい
なければならない。The means for obtaining the JS identifier of each BES in relation to the occurrence of a sub-transaction has been shown above. J
The S name can be acquired not only by the dynamic acquisition means described above but also by specifying it in the configuration definition parameter of each FES. The configuration definition parameter is a parameter that defines the system configuration in the distributed transaction, and a list of all FESs, BESs, and JSs that participate in the distributed transaction processing must be defined.
【0103】図12にサブトランザクションの登録処理
を示す。トランザクションがBES上で処理される場
合、そのトランザクションはサブトランザクションとし
て起動される。図12はFES側でのトランザクション
の発生とサブトランザクションの登録を管理する処理で
ある。FIG. 12 shows subtransaction registration processing. When a transaction is processed on BES, it is activated as a subtransaction. FIG. 12 shows a process of managing transaction generation and subtransaction registration on the FES side.
【0104】サブトランザクション登録が要求されると
該当アプリケーションからの最初のデータベース操作要
求か否か判断(1201)する。具体的にはトランザク
ション管理表中のプロセス番号即ちオペレーティングシ
ステムによってAPに一意に付与される番号がすでにト
ランザクション管理表のプロセス番号に登録済みか否か
を判断することで当該APの最初の登録を判断する。最
初の登録であればトランザクション識別子を発生し、ト
ランザクション管理表にトランザクションを登録(12
02)する。発生したトランザクションの状態情報を処
理中(1203)とし、そのトランザクションを管理す
るサブトランザクション管理表を割当て(1204)、
トランザクション管理表中のJS数を1個(FESが対
象とするマスタJS分)とし、JS管理表を割当て(1
205)る。When the sub-transaction registration is requested, it is judged (1201) whether it is the first database operation request from the corresponding application. Specifically, the first registration of the AP is judged by judging whether the process number in the transaction management table, that is, the number uniquely assigned to the AP by the operating system has already been registered in the process number in the transaction management table. To do. If it is the first registration, a transaction identifier is generated and the transaction is registered in the transaction management table (12
02) The status information of the generated transaction is set to “in process” (1203), and a sub-transaction management table for managing the transaction is allocated (1204),
The number of JS in the transaction management table is set to 1 (for the master JS targeted by FES), and the JS management table is allocated (1
205).
【0105】ステップ1201において、すでにトラン
ザクション(サブトランザクション)が登録されている
場合には上記処理を行わない。In step 1201, if the transaction (sub-transaction) is already registered, the above process is not performed.
【0106】データベース操作文を処理するBESに対
するサブトランザクションの有無を、データベース操作
文を処理するBES名とサブトランザクション管理表中
のBES名から判定(1206)後、登録されていない
場合サブトランザクションを発生すなわちトランザクシ
ョン内で一意となるサブトランザクション識別子を発生
させサブトランザクション管理表に登録(1207)す
る。登録完了後またはサブトランザクションが既に存在
する場合、サブトランザクション登録処理を完了する。After the presence or absence of a sub-transaction for the BES processing the database operation statement is determined from the BES name processing the database operation statement and the BES name in the sub-transaction management table (1206), a sub-transaction is generated if not registered. That is, a unique sub-transaction identifier is generated in the transaction and registered in the sub-transaction management table (1207). After the registration is completed or if the sub-transaction already exists, the sub-transaction registration processing is completed.
【0107】次にコミット処理(1004)について述
べる。図14から図18にコミット処理を示す。Next, the commit process (1004) will be described. The commit process is shown in FIGS. 14 to 18.
【0108】APからコミット要求が起こると、FES
のコミット準備ジャーナルをマスタJS(FESのジャ
ーナル記録JS)へ送信後、その完了報告を受信する。
記録先JSが同じBES群に対してコミット準備を指示
するコミット準備指示と巡回先BES名リストをマージ
した電文を送信する。この巡回では、記録先JSが同一
のBES全てを巡回する。最後に記録先JSを経た後、
処理結果がFESへ送信される。全JSからの完了報告
受信後、コミットジャーナル指示とコミット指示を巡回
させる。JS,BESのリストをマスタJSに送る。各
巡回からの処理結果が正常完了するとコミット処理は完
了しトランザクションが完了する。以下にその詳細を示
す。When a commit request is issued from AP, FES
After sending the commit preparation journal to the master JS (FES journal record JS), the completion report is received.
The recording destination JS transmits a telegram in which the commit preparation instruction for instructing the commit preparation for the same BES group and the traveling destination BES name list are merged. In this patrol, the recording destination JS patrols all the same BES. Finally, after going through the recording destination JS,
The processing result is transmitted to FES. After receiving the completion reports from all the JSs, the commit journal instruction and the commit instruction are circulated. Send the list of JS and BES to the master JS. When the processing result from each round is completed normally, the commit processing is completed and the transaction is completed. The details are shown below.
【0109】まず図14においてトランザクション状態
をコミット準備処理中(1400)とし、FESのコミ
ット準備ジャーナルをマスタJSへ送信する。コミット
準備ジャーナルには以降の巡回先BES名とJS名をま
とめた巡回先リストが含まれる。本情報はこのトランザ
クションのサブトランザクション管理表の写しであって
も良い。本情報は障害発生時にサブトランザクションに
対するコミット,ロールバックの際に利用する。マスタ
JSからの処理結果を受信(1402)し、正常に記録
されたか判断(1403)する。ダウン中の場合、再送
を試みる。正常の場合、コミット準備要求を組み立て
る。巡回先数を(JS数)を初期化(1404)し、J
S管理表中の各JSに対し、以下の処理を行なう。まず
JSにジャーナル記録する各BESに関する巡回先BE
S名(最初の巡回先BES名を除く)とJS名をまとめ
た巡回先リストを送信電文に編集(1405)する。送
信する電文の内容は以下になる。First, in FIG. 14, the transaction status is set to commit preparation processing (1400), and the commit preparation journal of FES is transmitted to the master JS. The commit preparation journal includes a to-be-listed list that summarizes the to-be-visited BES names and JS names thereafter. This information may be a copy of the sub-transaction management table for this transaction. This information is used when committing or rolling back a sub-transaction when a failure occurs. The processing result from the master JS is received (1402), and it is judged whether the recording is normal (1403). If it is down, try to resend. If normal, assemble a commit preparation request. The number of patrol destinations (the number of JS) is initialized (1404), and J
The following processing is performed for each JS in the S management table. First, the visit destination BE for each BES recorded in the JS journal
The S destination (excluding the first visit destination BES name) and the JS name are edited in the visit destination list (1405). The contents of the transmitted message are as follows.
【0110】(1)電文ヘッダ+コミット準備要求(巡
回先リスト) 上記電文を最初の巡回先BESに送信(1406)す
る。(1) Message header + commit preparation request (tour destination list) The above-mentioned message is transmitted to the first destination BES (1406).
【0111】上記をトランザクション管理表中のJS管
理表に登録されたJS数分繰り返す。(1408) JS数分送信した後、トランザクションとしてコミット
準備が成功したか否か判断するコミット準備成功フラグ
をオン(仮に成功)(1501)し、各JSまたはBE
Sからの処理結果を受信(1502)し、以下の処理を
JS数だけ繰り返す(1506)。The above is repeated for the number of JSs registered in the JS management table in the transaction management table. (1408) After sending JS number of times, the commit preparation success flag for judging whether or not the commit preparation is successful as a transaction is turned on (provisionally successful) (1501), and each JS or BE
The processing result from S is received (1502), and the following processing is repeated for the number of JS (1506).
【0112】JSからの処理結果は以下の内容である。The processing results from JS are as follows.
【0113】(1)ack:全巡回先でコミット準備成
功 (2)nak:少なくとも1つの巡回先でコミット処理
失敗またはタイムオーバ(応答なし) JSまたはBESからの処理結果が受信またはタイムオ
ーバ等を検知すると、個々の巡回先BESのコミット準
備が成功したか否かを判定(1503)する。もしいず
れかのBESでコミット準備が失敗したか(BESから
のnak応答)、いずれかのBES,JSがダウンして
いた場合、トランザクションをロールバックするために
コミット準備成功フラグをオフ(失敗)(1504)と
する。(1) ack: Commit preparation succeeded in all round destinations (2) nak: Commit processing failed or timed out in at least one rounded destination (no response) When the processing result from JS or BES is received or timed out, etc. Upon detection, it is determined (1503) whether or not the preparations for committing the individual visiting BESs have succeeded. If commit preparation failed at any BES (nak response from BES) or if either BES or JS was down, the commit preparation success flag was turned off (failed) to roll back the transaction (failure) ( 1504).
【0114】上記でコミット準備が成功したか否かコミ
ット準備成功フラグから判断(1507)後、失敗して
いた場合、ロールバック処理(図19の1900以降)
を行う。After determining whether or not the commit preparation has succeeded (1507) based on the commit preparation success flag, if it has failed, rollback processing (1900 and later in FIG. 19)
I do.
【0115】成功していた場合、トランザクション状態
情報をコミット仮決定(1508)とし、FESはコミ
ット要求に次の巡回リストを付加した電文をマスタJS
へ送信する(1509,1510)。巡回リストは、次
のものである。If the transaction is successful, the transaction status information is set to the temporary commit decision (1508), and the FES sends a message to the master JS that adds the next cyclic list to the commit request.
(1509, 1510). The tour list is:
【0116】(1)FESのJSの巡回路のBES名の
リスト (2)他の全JSについてはJS名を先頭としそのJS
の巡回路のBES名リスト この送信でJSへトランザクションのコミットジャーナ
ルが送信され、送信JS側でジャーナル処理を行い、各
JSとそれに属するBESのコミット要求が各JSへ巡
回される。FESのコミットジャーナルがJSのジャー
ナルファイル上に記録された段階で当トランザクション
のコミットが決定されたことになる。(1) List of BES names of JS tours of FES (2) For all other JSs, the JS name is set as the head and the JS
BES name list of the circuit of this transaction The transaction commit journal is transmitted to the JS by this transmission, the journal processing is performed on the transmitting JS side, and the commit request of each JS and the BES belonging to it is circulated to each JS. The commit of this transaction is decided when the commit journal of FES is recorded in the journal file of JS.
【0117】BESを経てJSを経てコミットジャーナ
ルの記録が完了すると各JSからその処理結果が受信さ
れる。コミットの成功フラグと巡回先JS数をカウント
する初期化(1601)(コミット成功フラグを成功に
し、巡回JS数を1にする)する。When recording of the commit journal is completed via BES and JS, the processing result is received from each JS. Initialization (1601) is performed to count the success flag of the commit and the number of JSs to be visited (set the success flag to success and set the number of JS to 1).
【0118】処理電文中の送信元から送信者即ち巡回の
端末であるJSのJS名を取得する(1602)。処理
結果中には巡回中の各BESのコミット準備に対する処
理結果が報告されるのでその処理結果を判定(160
3)する。全巡回結果が正常にコミット準備処理を終え
た場合、そのJS名に対応するJS管理表の巡回電文状
態情報をack受信済み(1605)とする。もし、巡
回結果中にコミット準備に失敗したものがある場合、コ
ミット成功フラグをオフ(1604)にし、巡回電文状
態情報は再送待ちとなる。The sender, that is, the JS name of the JS that is the patrol terminal is acquired from the sender in the processing message (1602). In the processing result, the processing result for the commit preparation of each circulating BES is reported, so the processing result is determined (160
3) Do. When the result of all rounds is that the commit preparation processing is completed normally, the round trip message status information of the JS management table corresponding to the JS name is set as ack received (1605). If there is a commit failure in the cyclic results, the commit success flag is turned off (1604), and the cyclic message status information waits for retransmission.
【0119】巡回先JS数に1を加え(1607)、巡
回JS数分受信が完了したか判定(1608)する。One is added to the number of JS to be visited (1607), and it is determined whether reception is completed by the number of JS to be visited (1608).
【0120】上記において受信タイマオーバ等の理由で
受信制約時間をオーバした場合には、ステップ1602
の受信処理で異常が報告され、ステップ1603の巡回
処理結果で失敗となる。In the above case, when the reception restriction time is exceeded due to the reception timer being over, etc., step 1602
An error is reported in the reception processing of No. 1, and the result of the cyclic processing in step 1603 fails.
【0121】コミットの巡回処理が全て成功したか否か
をコミット成功フラグで判定(1609)する。成功し
た場合にはトランザクション状態情報をフリー(161
0)にし、そのトランザクションが利用したJS管理表
とトランザクション管理表を解放(1611)し、当該
トランザクションは完了する。The commit success flag is used to determine whether or not all the commit rounds have been successful (1609). If successful, transaction status information is free (161
0), the JS management table and the transaction management table used by the transaction are released (1611), and the transaction is completed.
【0122】コミット巡回処理が一部または全て失敗し
た場合、巡回経路上で障害が発生しているので、トラン
ザクションをコミットするかロールバックするか決定す
る。If the commit patrol process partially or completely fails, a failure has occurred on the patrol path, so it is determined whether to commit or roll back the transaction.
【0123】全ての巡回先から応答があるかないか判定
(1701)する。具体的には、ステップ1605と1
606においてJS管理表に記録された巡回電文状態情
報が全て再送待ちになっているか、一部のみかを判定
(1701)する。It is judged (1701) whether or not there is a response from all the patrol destinations. Specifically, steps 1605 and 1
In 606, it is determined whether all the patrol message status information recorded in the JS management table is waiting for retransmission or only a part thereof (1701).
【0124】全ての巡回からの応答が無い場合、マスタ
JS,サブJS,BESのいずれで障害が発生している
かはわからない。マスタJSが障害を起こしている場
合、コミットジャーナルが記録されていない場合があ
る。トランザクションのコミット/ロールバックの決定
はマスタJSのジャーナルファイル上に当トランザクシ
ョンのコミットジャーナルまたはアボートジャーナルが
記録されているか否かよる。そこでFESは本トランザ
クションが確実にコミットされているか否かを判定する
為にマスタJSに対して本トランザクションのジャーナ
ルが記録されているかについて問い合わせ(1702)
を行う。JSからの処理結果を受信(1703)する
が、この時ある一定時間を経過しても応答が無い場合、
JSがダウン中と見なしマスタJSが回復するまで問い
合わせを繰り返す(1704)。If there is no response from all the patrols, it is not known which of the master JS, sub JS and BES has a failure. When the master JS has a failure, the commit journal may not be recorded. Whether to commit or roll back a transaction depends on whether the commit journal or abort journal of this transaction is recorded in the journal file of the master JS. Therefore, the FES inquires of the master JS whether the journal of this transaction is recorded in order to determine whether or not this transaction is definitely committed (1702).
I do. When the processing result from JS is received (1703), but there is no response after a certain period of time,
It is considered that the JS is down, and the inquiry is repeated until the master JS recovers (1704).
【0125】マスタJSからの処理結果は、ジャーナル
ファイルに記録されている当トランザクションに関する
全てのジャーナル情報が送信される。FESのトランザ
クション処理部は処理結果中にコミットジャーナル(C
J)が記録されているか判定(1706)後、記録され
ていれば各BESに対するコミット再送処理を行う。記
録されていない場合、当トランザクションをロールバッ
クさせるためマスタJSのアボートジャーナル出力処理
を行う。As the processing result from the master JS, all the journal information related to this transaction recorded in the journal file is transmitted. The transaction processing unit of the FES will add a commit journal (C
After determining (1706) whether J) is recorded, if it is recorded, the commit resend process is performed for each BES. If it is not recorded, the abort journal output process of the master JS is performed to roll back this transaction.
【0126】ステップ1701の判定処理において一部
の巡回から応答がない場合、少なくともマスタJSに対
してコミットジャーナルの記録は完了している。その場
合、コミット再送処理を行なう。If there is no response from some patrols in the judgment processing of step 1701, recording of the commit journal is completed for at least the master JS. In that case, a commit resend process is performed.
【0127】次に図18によりコミット再送処理につい
て述べる。Next, the commit resend process will be described with reference to FIG.
【0128】コミット再送はコミット待ちで待機してい
るBESに対しコミットの確定を指示する。コミット再
送はジャーナル管理表の電文状態情報で再送要になって
いる巡回先上に存在する全てのBESに対してコミット
指示を行う。図18にコミット再送処理を示す。The commit re-send instructs the BES, which is waiting for a commit, to commit. In commit re-transmission, a commit instruction is given to all BESs existing on the patrol destination for which re-transmission is required in the message status information of the journal management table. FIG. 18 shows the commit resend process.
【0129】コミット再送段階では、再送指示を行う為
にJSカウント数(i)と再送JS巡回数(j)とコミ
ット完了フラグを初期化(1801)する。巡回電文状
態情報から該当巡回先に再送が必要か否か判定(180
2)する。再送要の場合、コミット要求を巡回させずに
再送対象の全BESへ送信(1803)する。再送巡回
先カウンタに1を加え(1804)、JS数をカウント
(1805)する。上記処理をJS数分行う(180
6)。In the commit resending stage, the JS count number (i), the resending JS round number (j) and the commit completion flag are initialized (1801) in order to give a resending instruction. It is determined from the patrol message status information whether or not it is necessary to retransmit to the corresponding patrol destination (180
2) Do. If the retransmission is required, the commit request is transmitted to all BESs to be retransmitted without circulating (1803). 1 is added to the retransmission circulation destination counter (1804), and the number of JS is counted (1805). The above processing is performed for the number of JS (180
6).
【0130】上記コミット要求に対する処理結果を受信
(1808)する。受信時に相手BESがダウン等の理
由により異常の場合を検知(1809)した場合、コミ
ット完了フラグをオフ(コミット再送の失敗)(181
1)とする。正常完了した場合、該当巡回の巡回電文状
態情報をack受信(1810)とする。コミット時に
異常の起きた巡回経路上のBESに対する全コミット再
送が完了したか否かコミット完了フラグを判定(181
4)する。判定結果全ての巡回上のBESがコミットす
ると本トランザクションはフリーに移行する(16
a)。The processing result for the commit request is received (1808). When the partner BES is detected to be abnormal due to a reason such as a failure at the time of reception (1809), the commit completion flag is turned off (commit retransmission failure) (181
1). In the case of normal completion, the patrol message status information of the patrol is set as ack reception (1810). The commit completion flag is determined whether or not all the commit retransmissions for the BES on the patrol route in which an error has occurred at the time of commit have been completed (181
4) Do. Judgment result When all the BESs on the tour commit, this transaction shifts to free (16
a).
【0131】次に、図19を用いてFESのロールバッ
ク処理について説明する。FESのロールバック処理
は、(1)APからのロールバック要求による場合、ま
たは(2)コミット準備中の巡回処理失敗の場合に呼び
出される。Next, the FES rollback process will be described with reference to FIG. The FES rollback process is called (1) in the case of a rollback request from the AP, or (2) in the case of failure of the cyclic process during preparation for commit.
【0132】図中の19は上記(2)から呼び出される
場合である。Reference numeral 19 in the figure shows a case where the call is made from the above (2).
【0133】ロールバック処理が開始されると、当トラ
ンザクションのトランザクション状態をロールバック仮
決定(1900)に遷移する。ロールバック仮決定は、
トランザクションとしてロールバックを決定したが、実
際にマスタJSにアボートジャーナル(AJ)が未記録
な状態である。FESは、アボートジャーナルを記録す
るためにマスタJSへロールバック要求を送信(190
1)する。ロールバック要求によりアボートジャーナル
が正常に記録されるまで上記処理を繰り返す(190
2)。次に、このトランザクションに参加した巡回経路
となるJSとBESに対し、ロールバック要求とジャー
ナルサーバ管理表中のあるJSに関する全てのBESの
うち最初の巡回先BES以外のBES名とJS名を電文
編集(1905)する。編集した電文を最初の巡回先B
ESに送信(1906)する。When the rollback process is started, the transaction state of this transaction is transited to rollback provisional decision (1900). The rollback provisional decision is
Although rollback is decided as a transaction, the abort journal (AJ) is actually unrecorded in the master JS. The FES sends a rollback request to the master JS to record the abort journal (190
1) Do. The above process is repeated until the abort journal is normally recorded by the rollback request (190
2). Next, for the JS and BES that are the patrol routes participating in this transaction, the rollback request and the BES name and JS name other than the first patrol destination BES among all BESs related to a certain JS in the journal server management table are electronically transmitted. Edit (1905). Edit the message to the first destination B
It is sent to the ES (1906).
【0134】上記送信を各巡回先数即ちJS数分繰り返
す(1907,1908)。以上によりロールバック対
象となる全てのBESに対してロールバック指示が行わ
れる。The above transmission is repeated by the number of destinations, that is, the number of JSs (1907, 1908). As described above, the rollback instruction is issued to all BESs to be rolled back.
【0135】各巡回先からの結果を受信する。次に図2
0に進み、巡回先JS数を1とし、ロールバック成功フ
ラグを成功側に設定(2001)する。あるJSからの
処理結果を受信(2002)する。巡回処理のBESで
ロールバック処理失敗またはタイムオーバ等を検知(2
003)し、失敗の場合ロールバック成功フラグをオフ
(失敗側)に設定(2004)する。各巡回数(JS
数)分上記処理を繰り返し(2006)、全ての巡回に
対しロールバック処理の成功/失敗を判定する。Receive the results from each patrol destination. Next in FIG.
The process proceeds to 0, sets the number of JS to be visited to 1, and sets the rollback success flag to the success side (2001). A processing result from a certain JS is received (2002). Detects rollback processing failure or time-out etc. in BES of patrol processing (2
003), and in the case of failure, the rollback success flag is set to off (failure side) (2004). Number of rounds (JS
The above process is repeated for a number of times (2006), and the success / failure of the rollback process is determined for all patrols.
【0136】トランザクションのロールバック処理が全
て成功したか否かを判定(2007)し、全ての巡回が
正常完了した場合(ロールバック成功フラグがオン(成
功))、そのトランザクション状態はフリー(200
8)となりトランザクションは完了する。トランザクシ
ョン処理に必要なJS管理表とサブトランザクション管
理表を開放(2010)し、当該トランザクションに関
する全ての処理が完了する。It is judged whether all rollback processing of the transaction has succeeded (2007), and if all the patrols have been completed normally (the rollback success flag is ON (success)), the transaction state is free (200
8) and the transaction is completed. The JS management table and sub-transaction management table required for transaction processing are released (2010), and all processing related to the transaction is completed.
【0137】ロールバック成功判定(2007)におい
てロールバック成功フラグがオフ(失敗)の場合、ロー
ルバック再送処理を行なう。ロールバック再送処理はロ
ールバックの確定を指示する。ロールバック再送はJS
管理表の電文状態情報で再送要になっている巡回先上に
存在する全てのBESに対してロールバック指示を行な
う。In the rollback success judgment (2007), if the rollback success flag is off (failure), rollback retransmission processing is performed. The rollback retransmission process gives an instruction to confirm rollback. Rollback resend is JS
A rollback instruction is issued to all the BESs existing on the patrol destination for which retransmission is required in the message status information of the management table.
【0138】図13にロールバック再送処理を示す。FIG. 13 shows the rollback retransmission process.
【0139】ロールバック再送段階では、再送指示を行
なうためにJSカウント数(i)と再送JS巡回数
(j)とロールバック完了フラグを初期化(1301)
する。巡回電文状態情報から該当巡回先に再送が必要か
否か判定(1302)する。再送要の場合、ロールバッ
ク要求を巡回させずに再送対象の全BESへ送信(13
03)する。再巡回先カウンタに1を加え(130
4)、JS数をカウント(1805)する。上記処理を
JS数分行なう(1306)。At the rollback retransmission stage, the JS count number (i), the number of retransmission JS cycles (j), and the rollback completion flag are initialized to give a retransmission instruction (1301).
To do. Based on the patrol message status information, it is determined (1302) whether or not it is necessary to retransmit to the corresponding patrol destination. If retransmission is required, the rollback request is sent to all BESs to be retransmitted without patrol (13
03) Add 1 to the re-tour destination counter (130
4), the number of JS is counted (1805). The above processing is performed for the number of JS (1306).
【0140】上記ロールバック要求に対する処理結果を
受信(1308)する。受信に相手BESがダウン等の
理由により異常の場合を検知(1309)した場合、ロ
ールバック完了フラグをオフ(ロールバック再送の失
敗)(1311)とする。正常完了した場合、当該巡回
の巡回電文状態情報をack受信(1310)とする。
ロールバック時に異常の起きた巡回経路上のBESに対
する全ロールバック再送が完了したか否かロールバック
完了フラグを判定し(1314)する。判定結果、全て
の巡回上のBESがロールバックすると本トランザクシ
ョンはフリー(20a)に移行する。The processing result for the rollback request is received (1308). When an abnormality is detected (1309) in the reception due to the other party BES being down or the like, the rollback completion flag is turned off (rollback retransmission failure) (1311). In the case of normal completion, the patrol message status information of the patrol is set as ack reception (1310).
The rollback completion flag is determined (1314) as to whether or not all rollback retransmissions have been completed for the BES on the patrol route in which an abnormality has occurred during rollback. As a result of the determination, when all circulating BESs roll back, this transaction shifts to free (20a).
【0141】図20の左下に示すように、BESダウン
時にはトランザクション状態回復を行なうために、サブ
JSから記録されたトランザクションを回復(201
2)して、トランザクション状態情報をマスタJSアボ
ートジャーナル判定段階に遷移(2009)する。As shown in the lower left of FIG. 20, in order to recover the transaction state when the BES is down, the transaction recorded from the sub JS is recovered (201
2) Then, the transaction status information is transited to the master JS abort journal judgment stage (2009).
【0142】続いて図21に進み、FESのジャーナル
記録サーバ即ちマスタJSに対し当該トランザクション
に関する全てのジャーナル情報の問い合わせ送信要求を
送信(2102)する。FESはマスタJSからのジャ
ーナル情報送信を受信(2103)する。受信時マスタ
JSが障害または通信障害等の理由でジャーナル送信に
失敗した場合(2105のno)再度ジャーナル情報の
送信要求を送信する。本処理は、マスタJSダウンでマ
スタJSが回復するまたはジャーナルファイル満杯等の
為FESからの要求を処理できない状態であり、基本的
にはマスタJSの回復まで待ち合わせればよい。マスタ
JSからのジャーナル送信が行われるとその送信ジャー
ナル中にアボートジャーナルがあるか否か判定(210
4)する。アボートジャーナルが存在しない場合には、
マスタJSがロールバック要求処理のためのアボートジ
ャーナル記録中または記録前に障害が発生し、アボート
ジャーナルを完全に記録できずにダウンしたこと示す。
この場合、トランザクション状態を確実にアボート状態
させる為にはマスタJS上にアボートジャーナルが記録
されなければならないため、図22に進み、マスタJS
にアボートジャーナル記録(図22の2201)を行
う。マスタJSからアボートジャーナル記録の正常完了
が受信されるまで上記処理を繰り返す(2202)。上
記処理が終了すると図13の処理に遷移し、ロールバッ
ク再送処理を行う。Next, proceeding to FIG. 21, an inquiry transmission request for all journal information relating to the transaction is transmitted to the FES journal recording server, that is, the master JS (2102). The FES receives (2103) the journal information transmission from the master JS. When the receiving master JS fails in journal transmission due to a failure or communication failure (no in 2105), the journal information transmission request is transmitted again. This process is a state in which the request from the FES cannot be processed because the master JS is down and the master JS is recovered or the journal file is full, and basically, it is sufficient to wait until the master JS is recovered. When the journal transmission from the master JS is performed, it is determined whether or not there is an abort journal in the transmission journal (210).
4) Do. If no abort journal exists,
Indicates that the master JS failed during or before recording the abort journal for processing the rollback request, and could not record the abort journal completely and went down.
In this case, the abort journal must be recorded on the master JS in order to surely bring the transaction state into the abort state.
Abort journal recording (2201 in FIG. 22) is performed. The above process is repeated until the normal completion of the abort journal recording is received from the master JS (2202). When the above process ends, the process transitions to the process in FIG. 13 and the rollback retransmission process is performed.
【0143】図21のアボートジャーナル有無判定(2
104)で問い合わせ結果にアボートジャーナルが存在
した場合、図20のトランザクションフリー処理(20
a)へ遷移する。Abort journal presence / absence judgment (2
If an abort journal exists in the inquiry result in (104), the transaction-free processing (20
Transition to a).
【0144】以上でFESにおけるトランザクション処
理を説明した。The transaction processing in FES has been described above.
【0145】次にBESにおけるトランザクション処理
について図23から図27を用いて説明する。Next, transaction processing in BES will be described with reference to FIGS. 23 to 27.
【0146】まず、図23において、BESトランザク
ション処理部2301は最初のデータベース操作文の到
着を電文受信(2302)で待つ。この段階ではトラン
ザクションは発生していない。電文受信結果データベー
ス操作文処理要求判定(2303)を行う。本フローで
は詳細を省略したがトランザクションが発生していない
段階では、処理要求がデータベース処理要求以外のコミ
ット/ロールバック要求処理の場合、正常終了電文送信
(2302)を行う。トランザクションが発生している
場合に限り、ステップ2304と2305以降の処理が
行われる。First, in FIG. 23, the BES transaction processing section 2301 waits for the arrival of the first database operation statement by message reception (2302). No transaction has occurred at this stage. A message reception result database operation statement processing request determination (2303) is performed. Although details are omitted in this flow, at the stage where no transaction has occurred, when the processing request is a commit / rollback request processing other than the database processing request, a normal termination message is transmitted (2302). Only when a transaction has occurred, the processes of steps 2304 and 2305 and subsequent steps are performed.
【0147】電文受信(2302)の処理要求がデータ
ベース操作文処理の場合、BESデータベース操作文処
理(2304)を呼び出す。When the processing request for message reception (2302) is the database operation statement processing, the BES database operation statement processing (2304) is called.
【0148】図24を用いてBESデータベース操作文
処理を説明する。The BES database operation statement processing will be described with reference to FIG.
【0149】バックエンドサーバデータベース操作文処
理(2304)は最初に受信した電文中のトランザクシ
ョン識別子がトランザクション管理表中に登録されてい
るか判定(2401)する。もしトランザクション管理
表中に該当するトランザクションが登録されていない場
合、トランザクション管理表に当該トランザクションを
登録(2402)する。この段階でトランザクションが
開始し、トランザクション即ちBESにおいてはサブト
ランザクション状態が処理中になる。The backend server database operation statement process (2304) determines whether the transaction identifier in the first received message is registered in the transaction management table (2401). If the corresponding transaction is not registered in the transaction management table, the transaction is registered in the transaction management table (2402). At this stage, the transaction starts, and in the transaction, that is, BES, the subtransaction state becomes in process.
【0150】受信したデータベース操作文に基づきデー
タベース操作を処理(2403)する。処理終了後、本
処理が当該トランザクションの最初の処理要求か否か判
断(2404)し、最初の要求の場合、処理結果にBE
Sがジャーナルを記録するJS名を処理結果に併合(2
405)する。本処理によりFESのJS名受信(11
06)が可能となる。A database operation is processed (2403) based on the received database operation statement. After the processing is finished, it is judged whether or not this processing is the first processing request of the transaction (2404).
S merges the JS name recording the journal into the processing result (2
405). By this processing, the FES JS name is received (11
06) is possible.
【0151】処理結果をFESに送信(2406)し、
BESのデータベース処理が完了する。The processing result is sent to the FES (2406),
The database processing of BES is completed.
【0152】次にデータベース操作文を処理した後に電
文受信(2302)において、コミットまたはロールバ
ック要求を受信した場合の処理について述べる。Next, the processing when a commit or rollback request is received in the electronic message reception (2302) after processing the database operation statement will be described.
【0153】受信した処理要求がコミット準備要求であ
った場合(2305)、コミット準備処理を行う。本処
理はFESコミット処理におけるコミット巡回電文送信
(1406)に対応する受信処理である。When the received processing request is a commit preparation request (2305), commit preparation processing is performed. This process is a reception process corresponding to the commit cyclic message transmission (1406) in the FES commit process.
【0154】コミット保留の処理について図25を用い
て説明する。The commit suspension process will be described with reference to FIG.
【0155】まず当トランザクション(サブトランザク
ション)状態をコミット保留に遷移(2501)させ
る。コミット準備処理(2502)を行う。コミット準
備処理結果、正常に完了した場合、次の巡回先へコミッ
ト準備を送信(2504)する。失敗した場合、トラン
ザクション状態をロールバック保留(2601)とし、
FESに失敗送信し(2505)、ステップ2508へ
進む。First, the state of this transaction (sub-transaction) is changed to commit pending (2501). A commit preparation process (2502) is performed. As a result of the commit preparation processing, if the commit preparation is completed normally, the commit preparation is transmitted to the next patrol destination (2504). If it fails, the transaction status is set to rollback pending (2601),
The FES is unsuccessfully transmitted (2505) and the process proceeds to step 2508.
【0156】正常完了時は次にコミット準備ジャーナル
を巡回電文に併合(2506)する。この時電文は、 (1)併合前 (a)電文ヘッダ+コミット準備要求(巡回先リスト)
または(b)電文ヘッダ+コミット準備要求(巡回先リ
スト)+このBES前に巡回したBESのコミット準備
ジャーナル (2)併合後 (a)電文ヘッダ+コミット準備要求(巡回先リスト)
+本BESのコミット準備ジャーナルまたは(b)電文
ヘッダ+コミット準備要求(巡回先リスト)+このBE
S前に巡回したBESのコミット準備ジャーナル+本B
ESのコミット準備ジャーナル となる。At the time of normal completion, the commit preparation journal is then merged (2506) into a circuit message. At this time, the message is (1) before merging (a) message header + commit preparation request (tour destination list)
Or (b) message header + commit preparation request (tour destination list) + commit preparation journal of BES that has traveled before this BES (2) after merge (a) message header + commit preparation request (tour destination list)
+ Commit preparation journal of this BES or (b) message header + commit preparation request (tour destination list) + this BE
BES commit preparation journal that went around before S + book B
It becomes the commit preparation journal of ES.
【0157】受信した電文中には巡回電文編集1405
で組み立てられた巡回先リストが付加されている。巡回
リストの次の巡回先に送信(2507)する。次の巡回
先はBESまたはサブJS(またはマスタJS)であ
る。次にBESはFESからの巡回電文受信でFESか
らの指示を待つ(2508)。この時、FESは各巡回
の処理結果を判定しコミット/ロールバックを決定後、
その指示要求をマスタJS,サブJS,BES順に巡回
指示する。その結果、コミット/ロールバック要求電文
が到着するのをBESは待つ。電文受信後、その要求が
コミット要求かロールバック要求か判定(2509)す
る。コミット要求の場合、コミット処理を行う(251
0)。[0157] In the received message, edit circuit message 1405
The to-be-listed list assembled in is added. The data is transmitted (2507) to the next tour destination in the tour list. The next destination is the BES or sub JS (or master JS). Next, the BES waits for an instruction from the FES by receiving the cyclic telegram from the FES (2508). At this time, the FES determines the commit / rollback after determining the processing result of each round,
The instruction request is cyclically instructed in the order of master JS, sub JS, and BES. As a result, the BES waits for the commit / rollback request message to arrive. After receiving the message, it is determined whether the request is a commit request or a rollback request (2509). In the case of a commit request, commit processing is performed (251
0).
【0158】電文受信待ち(2508)においてコミッ
ト要求以外の場合、ロールバック要求か否か判定(25
13)する。ロールバック要求であればロールバック処
理(2314)を行う。If a message other than the commit request is awaited in the message reception wait (2508), it is determined whether the request is a rollback request (25
13) Do. If it is a rollback request, rollback processing (2314) is performed.
【0159】上記処理後、巡回リストから自BES名を
除き、次の巡回先に送信(2511)する。正常完了し
た場合、23aに遷移しトランザクション(サブトラン
ザクション)状態はフリー(2309)となる。正常に
送信が完了しない場合、トランザクションの部分回復処
理(27)へ遷移する。After the above processing, the own BES name is removed from the tour list and the data is sent to the next tour destination (2511). When completed normally, the state transits to 23a and the transaction (sub-transaction) state becomes free (2309). If the transmission is not completed normally, the process proceeds to the transaction partial recovery process (27).
【0160】電文受信待ち(2508)において、ロー
ルバック要求以外の場合、いずれかの経路において障害
が発生している可能性がある。この場合、トランザクシ
ョン状態をFES判定に遷移(2701)して、FES
に対して状態判定要求を送信(2702)する。当処理
でFESが当トランザクションの状態即ちコミット/ロ
ールバックのどちらに決定したかをBESが知る。FE
Sはこの要求に対してトランザクション表を調べ、トラ
ンザクションがコミット/ロールバック/フリーのいず
れになっているか調べた後に、決定情報をBESに送信
する。BESはFESのコミット/ロールバック再送要
求またはフリー通知(2703)を受信する。FESダ
ウン中(2704)ならば再度再送要求を送信する。When a message other than the rollback request is awaited in the message reception waiting (2508), there is a possibility that a failure has occurred in any of the routes. In this case, the transaction status transits to the FES judgment (2701), and the FES
A state determination request is transmitted to (2702). In this processing, the BES knows whether the FES decides the state of this transaction, that is, commit / rollback. FE
S looks up the transaction table for this request, checks whether the transaction is commit / rollback / free, and then sends decision information to BES. The BES receives the FES commit / rollback resend request or free notification (2703). If the FES is down (2704), the retransmission request is transmitted again.
【0161】再送結果によりBESはコミット再送の時
はコミット処理、ロールバック再送またはフリー通知の
時はロールバック処理を行う(2710)。次にトラン
ザクション状態をサブJS記録に遷移(2712)させ
る。コミット/アボートジャーナルがサブJSに記録さ
れていない場合があるのでコミット/ロールバック決定
内容に従ったサブJSジャーナル記録要求を送信(27
05)する。JS側ではその要求に従いジャーナル記録
状態を調べもし記録されていない場合、ジャーナル記録
を行う。サブJSがダウン中の場合再度記録要求を送信
(2706)する。According to the resend result, the BES performs the commit process at the time of commit resend, and the rollback process at the time of rollback resend or free notification (2710). Next, the transaction status is changed to sub-JS record (2712). Since the commit / abort journal may not be recorded in the sub JS in some cases, a sub JS journal recording request is sent according to the commit / rollback decision contents (27
05) Yes. On the JS side, the journal recording state is checked according to the request, and if it is not recorded, journal recording is performed. When the sub JS is down, the recording request is transmitted again (2706).
【0162】ジャーナルが記録された段階でトランザク
ション(サブトランザクション)状態はフリーとなる
(23a)。When the journal is recorded, the transaction (sub-transaction) state becomes free (23a).
【0163】BESダウンから回復してきた場合は27
b(図27)から処理が再開される。再開後のトランザ
クション状態はサブJS判定(2713)となる。次い
で、サブJSに対してダウン以前に処理していたトラン
ザクションのジャーナル転送(2707)を要求する。27 if recovered from BES down
The process is restarted from b (FIG. 27). The transaction status after the restart is the sub-JS judgment (2713). Then, the sub-JS is requested to transfer the journal of the transaction being processed before the down (2707).
【0164】あるトランザクションについてサブJSの
ジャーナル上にコミット準備ジャーナル有りでかつコミ
ットジャーナル有りの場合(2709)該当トランザク
ションはフリーとなる。コミット準備ジャーナルのみの
場合(2711)、27からBES,FES,JSダウ
ンの場合の回復処理を行う。コミット準備ジャーナルが
ない場合、当トランザクションはフリー状態(23a)
になる。When there is a commit preparation journal and a commit journal in the sub-JS journal for a certain transaction (2709), the corresponding transaction becomes free. In the case of only the commit preparation journal (2711), recovery processing from 27 to BES, FES, and JS down is performed. If there is no commit preparation journal, this transaction is in free state (23a)
become.
【0165】2303でトランザクション発生中に処理
要求としてロールバックが送られる(2307)とロー
ルバック処理(2514)を行う。At 2303, when a rollback is sent as a processing request during transaction generation (2307), rollback processing (2514) is performed.
【0166】以上でBESのトランザクション処理部に
ついて説明した。The transaction processing unit of BES has been described above.
【0167】次にJSの処理を図28、図29を用いて
説明する。Next, the JS processing will be described with reference to FIGS. 28 and 29.
【0168】受信した電文(2802)中のトランザク
ションがトランザクション管理表中にあるか判定(28
03)し、無ければトランザクションをトランザクショ
ン管理表に登録(2804)する。It is judged whether the transaction in the received electronic message (2802) is in the transaction management table (28
03), and if not, the transaction is registered in the transaction management table (2804).
【0169】電文を受信(2805)し、コミット準備
指示を受信すると(2806yes)、巡回併合された
BESのコミット準備ジャーナルをジャーナルファイル
に記録(2807)する。トランザクション状態をコミ
ット保留に遷移(2808)する。When the electronic message is received (2805) and the commit preparation instruction is received (2806yes), the commit preparation journal of the BES cyclically merged is recorded in the journal file (2807). The transaction state is transited to commit pending (2808).
【0170】図29に進み、次の巡回先即ちマスタJS
またはFESにジャーナル記録完了を送信(2900)
する。次の電文を受信(2901)して、当トランザク
ションが最終的にコミット/ロールバックのどちらに遷
移するかFES側での決定が行われ、その指示が受信さ
れる。コミット要求の場合(2902no)、マスタJ
SならFESのコミットジャーナルを記録後、自JSの
各BESのコミットジャーナルをジャーナルファイルに
記録(2903)し、ロールバック指示であればアボー
トジャーナルを記録(2904)する。巡回経路が次に
ある場合、巡回リストより自JS名を除き、次の巡回指
示に従い次の巡回先に送信(2905)する。次にトラ
ンザクション状態をフリー(2908)する。Proceeding to FIG. 29, the next tour destination, that is, the master JS
Or send journal recording completion to FES (2900)
To do. Upon receiving (2901) the next message, the FES side determines whether the transaction finally transitions to commit / rollback, and the instruction is received. In the case of a commit request (2902no), master J
If it is S, the commit journal of FES is recorded, then the commit journal of each BES of its own JS is recorded in the journal file (2903), and if the rollback instruction is given, the abort journal is recorded (2904). If there is a patrol route next, the own JS name is removed from the patrol list, and the data is transmitted to the next patrol destination according to the next patrol instruction (2905). Next, the transaction status is released (2908).
【0171】図28の電文の受信(2805)でロール
バック指示の場合(2811yes)、マスタJSなら
FESのアボートジャーナル(AJ)を記録後、自JS
の各BESのアボートジャーナルをジャーナルファイル
に記録(2809)する。トランザクション状態をフリ
ーに遷移する(29b)。When the rollback is instructed by receiving the message (2805) in FIG. 28 (2811 yes), the master JS records the abort journal (AJ) of FES, and then the own JS.
The abort journal of each BES is recorded in the journal file (2809). The transaction status is changed to free (29b).
【0172】最後に、上記具体例において、コミット準
備ジャーナルの併合を行わずに巡回先BES、JS情報
に基づいてJSにおいてジャーナル生成を行う本発明の
変形例について説明する。Finally, a modification of the present invention in which a journal is generated in JS based on the circulating BES and JS information without merging commit preparation journals in the above specific example will be described.
【0173】図14のFES側のコミット処理は上記と
同様である。巡回先BES、JSの電文編集(140
5)の情報を用いて、以下のようなJSでのジャーナル
生成が行われる。なお、この場合、巡回BESの情報の
1つのBES情報はBES名とサブトランザクション識
別子であり、巡回先BES名群にはそのJSにジャーナ
ル記録するすべてのBES名が含まれる。The commit processing on the FES side in FIG. 14 is the same as above. Editing BES and JS telegrams at the destination (140
Using the information of 5), the following JS journal generation is performed. In this case, one piece of BES information of the circulating BES information is the BES name and the sub-transaction identifier, and the circulating destination BES name group includes all the BES names recorded in the journal in the JS.
【0174】図23のBESトランザクション処理にお
いて処理要求がコミット準備であり、かつコミット準備
(2502)が正常に完了し、次巡回処理要求設定(2
504)した後、コミット準備ジャーナルの電文併合処
理(2506)を行わずに直接次の巡回相手に送信(2
507)する。このとき、巡回先BES、JS情報はF
ESが送信した状態のまま送信する。In the BES transaction processing of FIG. 23, the processing request is the commit preparation, and the commit preparation (2502) is normally completed, and the next round processing request setting (2
504), the message is not merged (2506) of the commit preparation journal and is directly transmitted to the next traveling partner (2).
507) At this time, the destination BES and JS information is F
It is sent as it is sent by the ES.
【0175】このような処理により、ジャーナルの併合
は不要となる。先の実施例では、JSに送信される電文
は、図31に示したようにBES数分のジャーナル(3
204〜3206)が併合されたものを含んでいる。し
かし、この変形例の場合、図32に示すように、巡回B
ES、JSがパラメタとして付与された電文形式でJS
が受信する。By such processing, the merging of journals becomes unnecessary. In the above embodiment, the message sent to the JS is as many as the journals (3
204-3206) have been merged. However, in the case of this modification, as shown in FIG.
JS in message format with ES and JS added as parameters
To receive.
【0176】JS処理の巡回併合さたBESのコミット
準備ジャーナル記録(2807)は、ジャーナル併合が
行われない場合、パラメタとして受信した巡回先BE
S、JS情報のBESに関する情報に基づいて各BES
のコミット準備ジャーナルをJS側で生成し、これをジ
ャーナルファイルに記録する。これにより、コミット準
備におけるジャーナル併合によるデータ転送量の削減が
可能となる。[0176] The commit preparation journal record (2807) of the BES that has been cyclically merged by the JS processing is the destination BE that has been received as a parameter when journal merge is not performed.
Each BES based on the information about BES of S and JS information
The commit preparation journal of is generated on the JS side and is recorded in the journal file. This makes it possible to reduce the amount of data transfer by merging journals in the commit preparation.
【0177】[0177]
【発明の効果】本発明によれば、分散トランザクション
処理においてジャーナルサーバが独立した構成での2フ
ェーズコミット処理を効率的に行うことができる。特
に、ジャーナルサーバへの通信回数とジャーナルファイ
ルへの入出力回数を削減できる。As described above, according to the present invention, it is possible to efficiently perform the two-phase commit process in the distributed transaction process in which the journal server is independent. In particular, it is possible to reduce the number of communications to the journal server and the number of input / output to / from the journal file.
【図1】本発明が適用される分散トランザクション処理
構成のブロック図FIG. 1 is a block diagram of a distributed transaction processing configuration to which the present invention is applied.
【図2】従来技術の分散トランザクション処理構成のブ
ロック図FIG. 2 is a block diagram of a conventional distributed transaction processing configuration.
【図3】従来技術の2フェーズコミット制御方法の説明
図FIG. 3 is an explanatory diagram of a conventional two-phase commit control method.
【図4】ジャーナルサーバ化時の2フェーズコミット制
御方法の説明図FIG. 4 is an explanatory diagram of a two-phase commit control method when using a journal server.
【図5】本発明による2フェーズコミット制御方法の説
明図FIG. 5 is an explanatory diagram of a two-phase commit control method according to the present invention.
【図6】2フェーズコミット制御方法のシステム構成の
説明図FIG. 6 is an explanatory diagram of a system configuration of a two-phase commit control method.
【図7】トランザクション管理表の説明図FIG. 7 is an explanatory diagram of a transaction management table.
【図8】フロントエンドサーバトランザクションの状態
遷移図FIG. 8: State transition diagram of front-end server transaction
【図9】バックエンドサーバとジャーナルサーバの状態
遷移図FIG. 9: State transition diagram of backend server and journal server
【図10】アプリケーションプログラムの処理のフロー
チャートFIG. 10 is a flowchart of processing of an application program.
【図11】データベース操作文の実行要求の処理のフロ
ーチャートFIG. 11 is a flowchart of processing of a database operation statement execution request.
【図12】サブトランザクションの登録の処理のフロー
チャートFIG. 12 is a flowchart of a subtransaction registration process.
【図13】ロールバック処理その5の図FIG. 13 is a diagram of rollback processing 5
【図14】コミット処理その1の図FIG. 14 Diagram of commit process 1
【図15】コミット処理その2の図FIG. 15: Diagram of commit processing # 2
【図16】コミット処理その3の図FIG. 16 is a diagram of commit processing No. 3.
【図17】コミット処理その4の図FIG. 17 Diagram of commit processing # 4
【図18】コミット処理その5の図FIG. 18 is a diagram of commit processing 5
【図19】ロールバック処理その1のフローチャートFIG. 19 is a flowchart of rollback processing 1
【図20】ロールバック処理その2のフローチャートFIG. 20 is a flowchart of rollback process 2
【図21】ロールバック処理その3のフローチャートFIG. 21 is a flowchart of rollback process 3
【図22】ロールバック処理その4のフローチャートFIG. 22 is a flowchart of a rollback process 4
【図23】バックエンドサーバトランザクション処理そ
の1のフローチャートFIG. 23 is a flowchart of back-end server transaction processing No. 1.
【図24】バックエンドサーバデータベース操作文処理
のフローチャートFIG. 24 is a flowchart of backend server database operation statement processing.
【図25】バックエンドサーバトランザクション処理そ
の2のフローチャートFIG. 25 is a flowchart of back-end server transaction processing No. 2.
【図26】バックエンドサーバトランザクション処理そ
の3のフローチャートFIG. 26 is a flowchart of back-end server transaction processing No. 3.
【図27】バックエンドサーバトランザクション処理そ
の4のフローチャートFIG. 27 is a flowchart of backend server transaction processing No. 4.
【図28】ジャーナルサーバ処理その1のフローチャー
トFIG. 28 is a flowchart of journal server processing No. 1.
【図29】ジャーナルサーバ処理その2のフローチャー
トFIG. 29 is a flowchart of the journal server process No. 2.
【図30】ジャーナルの形式および内容の説明図FIG. 30 is an explanatory diagram of the format and contents of a journal
【図31】本発明の変形例の説明図FIG. 31 is an explanatory diagram of a modified example of the present invention.
【図32】本発明の変形例の説明図FIG. 32 is an explanatory diagram of a modified example of the present invention.
130…アプリケーションプログラム 10…フロントエンドサーバ 11,12,13…バックエンドサーバ 21,22…ジャーナルサーバ 130 ... Application program 10 ... Front-end server 11, 12, 13 ... Back-end server 21, 22 ... Journal server
Claims (6)
コミットの調整者となる計算機と、サブトランザクショ
ンを処理し参加者となる計算機と、トランザクション状
態履歴情報としてのトランザクションジャーナルを不揮
発性記録媒体に記録するジャーナル記録者となる計算機
とを通信ネットワークで相互に接続した分散トランザク
ション処理システムにおける2フェーズコミット制御方
法であって、 2フェーズコミットの第1段階として、 前記調整者は、前記ジャーナル記録者に対してコミット
準備ジャーナルを記録させるとともに、すべての前記参
加者名および前記ジャーナル記録者を含む巡回先情報を
付加したコミット準備要求を行い、 該コミット準備要求を受けた各参加者は、自己のコミッ
ト準備ジャーナルを当該コミット準備要求に付加した
後、該コミット準備要求を次順の巡回先へ送信し、最後
の参加者は、自己のコミット準備ジャーナルを前記コミ
ット準備ジャーナルに併合した後、当該コミット準備要
求を前記ジャーナル記録者へ送信し、 前記ジャーナル記録者は、各参加者のコミット準備ジャ
ーナルが付加された前記コミット準備要求を受けて、全
参加者のコミット準備ジャーナルを記録した後、その旨
を前記調整者へ報告し、 2フェーズコミットの第2段階として、 前記調整者は、すべての参加者名を含む巡回先情報を付
加したコミット要求を前記ジャーナル記録者へ送信し、 前記ジャーナル記録者は、前記コミット要求を受けてす
べての参加者のコミットジャーナルを記録した後、次順
の巡回先へコミット要求を送信し、 該コミット要求を受けた各参加者は、順次前記コミット
要求を次順の巡回先へ送信し、最後の参加者は前記コミ
ット要求を受けた旨を前記調整者へ報告することを特徴
とする2フェーズコミット制御方法。1. A computer that is a coordinator of two-phase commit in a transaction, a computer that processes subtransactions and is a participant, and a journal recorder that records a transaction journal as transaction status history information on a non-volatile recording medium. A two-phase commit control method in a distributed transaction processing system in which a computer that becomes the above is interconnected via a communication network, wherein the coordinator prepares a commit preparation journal for the journal recorder as a first step of the two-phase commit. Is recorded, and a commit preparation request is added to which the visit destination information including all the participant names and the journal recorders is added, and each participant who receives the commit preparation request commits its own commit preparation journal to the commit Preparation Then, the commit preparation request is transmitted to the next round destination, and the last participant merges his or her own commit preparation journal with the commit preparation journal and then sends the commit preparation request to the journal recorder. The journal recorder, after receiving the commit preparation request to which the commit preparation journal of each participant is added, records the commit preparation journals of all the participants, and then reports the fact to the coordinator. As a second stage of the two-phase commit, the coordinator sends a commit request to which the visitor information including all participant names is added to the journal recorder, and the journal recorder receives the commit request. After recording the commit journals of all participants, the commit request is sent to the next destination, and each participant who received the commit request The two-phase commit control method, wherein the participant sequentially transmits the commit request to the next round destination, and the last participant reports to the coordinator that the commit request has been received.
順の巡回先へ前記コミット準備要求を送信する際、自己
の参加者名を前記巡回先情報から削除して送信すること
を特徴とする請求項1記載の2フェーズコミット制御方
法。2. In the first stage, when the participant transmits the commit preparation request to the next round destination, the participant name of the participant is deleted from the round destination information and is transmitted. The two-phase commit control method according to claim 1.
て、前記参加者は、次順の巡回先へ前記コミット要求を
送信する際、自己の参加者名を削除して送信することを
特徴とする請求項1または2記載の2フェーズコミット
制御方法。3. In the second stage of the two-phase commit, the participant deletes its own participant name and sends it when sending the commit request to the next round destination. The two-phase commit control method according to claim 1.
て、 前記調整者は、すべての参加者名を含む巡回先情報を付
加したロールバック要求を前記ジャーナル記録者へ送信
し、 前記ジャーナル記録者は、前記ロールバック要求を受け
てすべての参加者のロールバックジャーナルを記録した
後、次順の巡回先へロールバック要求を送信し、 該ロールバック要求を受けた各参加者は、順次前記ロー
ルバック要求を次順の巡回先へ送信し、最後の参加者は
前記ロールバック要求を受けた旨を前記調整者へ報告す
ることを特徴とする請求項1記載の2フェーズコミット
制御方法。4. As the second stage of the two-phase commit, the coordinator sends a rollback request to the journal recording person, to which the circulation destination information including all participant names is added, and the journal recording person After receiving the rollback request, recording the rollback journals of all participants, and then transmitting the rollback request to the next round destination, and each participant receiving the rollback request sequentially rolls back the rollback request. 2. The two-phase commit control method according to claim 1, wherein the request is transmitted to the next round destination, and the last participant reports to the coordinator that the rollback request has been received.
て、 前記コミット準備要求を受けた各参加者は、自己のコミ
ット準備ジャーナルを当該コミット準備要求に付加する
ことなく、該コミット準備要求を次順の巡回先へ送信
し、 前記ジャーナル記録者は、前記コミット準備要求を受け
て、全参加者のコミット準備ジャーナルを生成し、記録
した後、その旨を前記調整者へ報告することを特徴とす
る請求項1記載の2フェーズコミット制御方法。5. As the first stage of the two-phase commit, each participant receiving the commit preparation request sends the commit preparation request to the next order without adding its own commit preparation journal to the commit preparation request. The journal recorder receives the commit preparation request, generates and records commit preparation journals for all participants, and then reports the fact to the coordinator. The two-phase commit control method according to claim 1.
び第1の参加者グループのジャーナルの記録を行うメイ
ンジャーナル記録者と、第2の参加者グループのジャー
ナルの記録を行うサブジャーナル記録者を備え、 前記第1の段階では、前記メインジャーナル記録者およ
び第1の参加者グループの間でコミット準備要求の巡回
を行うとともに、前記サブジャーナル記録者および第2
の参加者グループの間で別のコミット準備要求の巡回を
行い、 前記第2の段階では、前記調整者は前記コミット要求を
前記第1の参加者グループおよび前記メインジャーナル
記録者へ送信し、 該コミット要求を受けたメインジャーナル記録者が前記
サブジャーナル記録者を介して前記第2の参加者グルー
プへ前記コミット要求を送信することを特徴とする請求
項1記載の2フェーズコミット制御方法。6. The journal recording person comprises a coordinator and a main journal recording person who records a journal of a first participant group, and a sub-journal recording person who records a journal of a second participant group. In the first step, a commit preparation request is patrolled between the main journal recorder and the first participant group, and the sub-journal recorder and second journal
Another commit preparation request is patrolled between the participant groups of, and in the second stage, the coordinator sends the commit request to the first participant group and the main journal recorder, 2. The two-phase commit control method according to claim 1, wherein the main journal recorder receiving the commit request transmits the commit request to the second participant group via the sub-journal recorder.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5009430A JPH06223007A (en) | 1993-01-22 | 1993-01-22 | Two-phase commit control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5009430A JPH06223007A (en) | 1993-01-22 | 1993-01-22 | Two-phase commit control method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH06223007A true JPH06223007A (en) | 1994-08-12 |
Family
ID=11720123
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP5009430A Pending JPH06223007A (en) | 1993-01-22 | 1993-01-22 | Two-phase commit control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH06223007A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009259009A (en) * | 2008-04-17 | 2009-11-05 | Internatl Business Mach Corp <Ibm> | Device and method for controlling execution of transaction |
| JP2022515949A (en) * | 2019-12-03 | 2022-02-24 | テンセント・テクノロジー・(シェンジェン)・カンパニー・リミテッド | Transaction processing methods, appliances, equipment and computer programs |
| US11544245B2 (en) | 2019-12-03 | 2023-01-03 | Tencent Technology (Shenzhen) Company Limited | Transaction processing method, apparatus, and device and computer storage medium |
-
1993
- 1993-01-22 JP JP5009430A patent/JPH06223007A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009259009A (en) * | 2008-04-17 | 2009-11-05 | Internatl Business Mach Corp <Ibm> | Device and method for controlling execution of transaction |
| JP2022515949A (en) * | 2019-12-03 | 2022-02-24 | テンセント・テクノロジー・(シェンジェン)・カンパニー・リミテッド | Transaction processing methods, appliances, equipment and computer programs |
| US11544245B2 (en) | 2019-12-03 | 2023-01-03 | Tencent Technology (Shenzhen) Company Limited | Transaction processing method, apparatus, and device and computer storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5802062A (en) | Preventing conflicts in distributed systems | |
| US5805786A (en) | Recovery of a name server managing membership of a domain of processors in a distributed computing environment | |
| US6425016B1 (en) | System and method for providing collaborative replicated objects for synchronous distributed groupware applications | |
| US7512682B2 (en) | Database cluster systems and methods for maintaining client connections | |
| JP3504763B2 (en) | Client, server, and storage device used in distributed system and method for restoring resource management server in distributed system | |
| US5896503A (en) | Managing membership of a domain of processors in a distributed computing environment | |
| US20060095438A1 (en) | Non-blocking commit protocol systems and methods | |
| JP2012018449A (en) | Snapshot acquisition processing program, snapshot acquisition processing method, snapshot participant computer, and snap shot coordinator computer | |
| US7636868B2 (en) | Data replication in a distributed system | |
| JP2002500791A (en) | A method for doing transactions in a distributed database | |
| JPH11327982A (en) | Disaster recovery method for distributed database system | |
| JPH08212095A (en) | Client server control system | |
| JPH06326713A (en) | Data transmission control method | |
| JPH06223007A (en) | Two-phase commit control method | |
| CN118971954B (en) | Data collaboration method based on QUIC protocol under multi-star weak network scene | |
| JPH10336272A (en) | Data communication system and data communication method | |
| JP2001244977A (en) | Data transfer device, data transfer system, data transfer method, and storage medium | |
| JPH034339A (en) | System for updating data base in distributed processing system | |
| JP3718273B2 (en) | Maintenance data management method | |
| JPH01194040A (en) | Fault recovery system for distributed data base system | |
| JP2938860B1 (en) | Distributed data management system | |
| JP2008129628A (en) | Communication method and message relay program in a system for processing a predetermined job by exchanging messages between a plurality of computer systems | |
| JP3006469B2 (en) | Message double feed check system | |
| JPH10336242A (en) | Data communication system | |
| JP2023151992A (en) | Data collection systems, methods and programs |