JPH06161862A - Transaction controller - Google Patents

Transaction controller

Info

Publication number
JPH06161862A
JPH06161862A JP4332478A JP33247892A JPH06161862A JP H06161862 A JPH06161862 A JP H06161862A JP 4332478 A JP4332478 A JP 4332478A JP 33247892 A JP33247892 A JP 33247892A JP H06161862 A JPH06161862 A JP H06161862A
Authority
JP
Japan
Prior art keywords
transaction
application program
monitor
database
management system
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
Application number
JP4332478A
Other languages
Japanese (ja)
Inventor
Suguru Kawakami
英 川上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP4332478A priority Critical patent/JPH06161862A/en
Publication of JPH06161862A publication Critical patent/JPH06161862A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To simplify the interface of an application program. CONSTITUTION:When an application program A2 utilizes a transaction monitor A4 while executing a transaction at a computer A1, it is stored in a storage means A41 by the relevant transaction monitor A4. When ending the transaction by the application program A2, the end request of the transaction is outputted to a data base management system A3. Then, it is inquired from a state managing part A30 to the transaction monitor A4 whether the transaction monitor is utilized by the application program A2 or not. The update processing of a data base A5 of the computer A1 is performed by a retrieval/update control part A32. Then, the update processing is performed while synchronizing respective data bases A5 and B5 of plural computers A1 and B1 through the transaction monitor A4 with the transaction control part A31.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、複数の計算機に備えら
れたデータベースの更新を伴なうトランザクションを、
1つの計算機に備えられたデータベースを更新する場合
と同様にコミット又はロールバックできるようにしたト
ランザクション制御装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention provides a transaction for updating a database provided in a plurality of computers.
The present invention relates to a transaction control device capable of committing or rolling back as in the case of updating a database provided in one computer.

【0002】[0002]

【従来の技術】図2は、従来のトランザクション制御シ
ステムの構成を示すブロック図である。図示のシステム
は、通信制御装置により通信回線を介して接続された2
つの計算機A1、B1から成る。計算機A1、B1は、
それぞれデータベースA5、B5を備えている。これら
のデータベースA5、B5は、それぞれ磁気ディスク装
置等から成り、データベース管理システムA3、B3に
よって管理される。各計算機A1、B1では、それぞれ
応用プログラムA2、B2を実行する。これらの応用プ
ログラムA2、B2は、データベースA5、B5の利用
者である。まず、応用プログラムA2が自計算機A1の
データベースA5のみを利用する場合の操作について説
明する。
2. Description of the Related Art FIG. 2 is a block diagram showing the configuration of a conventional transaction control system. The system shown in the figure is connected by a communication control device via a communication line.
It consists of two computers A1 and B1. Computers A1 and B1
It has databases A5 and B5, respectively. Each of these databases A5 and B5 is composed of a magnetic disk device or the like, and is managed by database management systems A3 and B3. The respective computers A1 and B1 execute the application programs A2 and B2, respectively. These application programs A2 and B2 are users of the databases A5 and B5. First, the operation when the application program A2 uses only the database A5 of its own computer A1 will be described.

【0003】応用プログラムA2は、例えば、銀行業務
の出金処理のように、1つのまとまった意味のある一連
の操作を行なう。この場合、データベース管理システム
A3が応用プログラムA2からのデータベースA5への
アクセス要求に基づいてデータベースA5をアクセスす
る。そして、データの一連の更新処理後、応用プログラ
ムA2からの開放要求に基づいてデータベースA5のア
クセスを完了する。このように、データベースA5のア
クセス要求から一連のアクセスを完了するまでの処理操
作をトランザクションという。このようなトランザクシ
ョンは、途中の状態、つまりデータベースA5の一部の
データが更新され、他の一部のデータが更新されていな
い状態では、論理的に意味をなさない。従って、あるト
ランザクションは、他のトランザクションに対して途中
の状態を見せないようにし、データベースの内容の整合
をとるようにしている。即ち、システムの動作中に電源
断等の障害が発生した場合でも、システムの運用が再開
された時にはトランザクションが途中の状態から始まる
ようなことがないようにしている。このように、トラン
ザクション相互間でトランザクションの途中の状態が見
えない性質をトランザクションの原子性という。
The application program A2 carries out a series of operations having a single meaningful meaning, such as withdrawal processing in banking business. In this case, the database management system A3 accesses the database A5 based on the access request from the application program A2 to the database A5. After a series of data update processing, the access to the database A5 is completed based on the release request from the application program A2. In this way, the processing operation from the access request of the database A5 to the completion of a series of accesses is called a transaction. Such a transaction is logically meaningless in the middle of the process, that is, in a state where some data in the database A5 is updated and some other data is not updated. Therefore, one transaction does not show an intermediate state with respect to another transaction, and the contents of the database are matched. That is, even if a failure such as power failure occurs during the operation of the system, the transaction does not start from an intermediate state when the operation of the system is resumed. In this way, the property that the states in the middle of a transaction cannot be seen between transactions is called transaction atomicity.

【0004】このようなトランザクションの原子性は、
データベース管理システムによるコミットメント制御に
より保障される。即ち、応用プログラムA2がトランザ
クションを実行する途中においては、順次実行される複
数の更新処理に関し、データベース管理システムA3が
一時保存領域にのみその更新結果を保存し、データベー
スA5は更新しない。そして、トランザクションの終了
時点で応用プログラムA2がデータベース管理システム
A3に対しコミットを出し、これにより、初めてデータ
ベース管理システムA3がデータベースA5の一連の更
新を一度に行なう。一方、トランザクションが途中で中
断した場合は、応用プログラムA2からデータベース管
理システムA3に対しロールバックを出し、これによ
り、データベース管理システムA3の一時保存領域に保
存された更新結果を取り消す。このようにして、データ
ベースA5には、他のトランザクションから見て常に論
理的に意味のある更新が行なわれる。
The atomicity of such a transaction is
Guaranteed by commitment control by the database management system. That is, while the application program A2 is executing a transaction, the database management system A3 saves the update result only in the temporary storage area and does not update the database A5 regarding a plurality of update processes that are sequentially executed. Then, at the end of the transaction, the application program A2 issues a commit to the database management system A3, whereby the database management system A3 makes a series of updates of the database A5 at a time for the first time. On the other hand, if the transaction is interrupted midway, the application program A2 issues a rollback to the database management system A3, thereby canceling the update result stored in the temporary storage area of the database management system A3. In this way, the database A5 is always updated in a logically meaningful manner from the viewpoint of other transactions.

【0005】応用プログラムA2におけるコミット文及
びロールバック文の具体的な書き方は、「JIS X
3005」第7頁に示されている。一方、複数の計算機
A1、B1上の応用プログラムA2、B2によって1つ
の業務を処理する場合がある。例えば、銀行業務におい
てある店舗から他の店舗へ振込業務を行なうときは、図
2において、計算機A1の応用プログラムA2によりデ
ータベースA5について出金処理による更新処理を行な
い、計算機B1の応用プログラムB2によりデータベー
スB5について入金処理による更新処理を行なう。この
場合、応用プログラムA2、B2が行なったデータベー
スA5、B5の更新処理はともに1つの振込業務に関連
しており、これらの処理は1つのトランザクションに含
まれる。このようなトランザクションについて前述した
原子性を持たせるためには、データベースA5、B5の
更新処理を同期して行なわなければならない。
[0005] The concrete method of writing the commit statement and the rollback statement in the application program A2 is "JIS X
3005 ", page 7. On the other hand, there are cases where one application is processed by the application programs A2 and B2 on a plurality of computers A1 and B1. For example, when performing a transfer business from one store to another in banking business, in FIG. 2, the application program A2 of the computer A1 updates the database A5 by a withdrawal process, and the application program B2 of the computer B1 executes the database. For B5, the update process by the deposit process is performed. In this case, the updating processes of the databases A5 and B5 performed by the application programs A2 and B2 are both related to one transfer operation, and these processes are included in one transaction. In order to impart the above-mentioned atomicity to such a transaction, the update processing of the databases A5 and B5 must be performed in synchronization.

【0006】従って、トランザクションの開始から終了
までの一連の処理を行なう応用プログラムA2は、以下
のような操作を行なう。まず、トランザクションの開始
要求をトランザクションモニタA4に対して行なう。そ
して、データベースA5、B5の検索・更新要求をデー
タベース管理システムA3に対して出す。一連の処理が
終了した後、トランザクションモニタA4に対してトラ
ンザクションの終了要求を出す。トランザクションモニ
タA4は、トランザクションの終了要求を受けると、ト
ランザクションモニタB4とともに2相コミットプロト
コルによって、データベース管理システムA3、B3が
管理するデータベースA5、B5の更新処理の同期をと
る。
Therefore, the application program A2 which performs a series of processing from the start to the end of the transaction performs the following operations. First, a transaction start request is issued to the transaction monitor A4. Then, it issues a search / update request for the databases A5 and B5 to the database management system A3. After the series of processing is completed, a transaction termination request is issued to the transaction monitor A4. When the transaction monitor A4 receives the transaction end request, the transaction monitor A4 and the transaction monitor B4 synchronize the update processing of the databases A5 and B5 managed by the database management systems A3 and B3.

【0007】図3は、従来の2相コミット制御の処理手
順の説明図である。まず、トランザクションモニタA4
は、応用プログラムA2から終了要求を受けた後(時点
T1)、トランザクション終了準備をデータベース管理
システムA3とトランザクションモニタB4とに通知す
る(時点T2、T3)。トランザクションモニタB4
は、このトランザクション終了準備をデータベース管理
システムB3に通知する(時点T4)。データベース管
理システムB3は、これによりトランザクション終了の
準備を開始し、準備が完了したら、その旨をトランザク
ションモニタB4に応答する(時点T5)。トランザク
ションモニタB4は、これをトランザクションモニタA
4に応答する(時点T6)。一方、データベース管理シ
ステムA3もトランザクション終了準備が完了したら、
その旨をトランザクションモニタA4に通知する(時点
T7)。以上のようにして、データベース管理システム
A3、B3の準備の完了がトランザクションモニタA4
によって確認される。
FIG. 3 is an explanatory diagram of a processing procedure of conventional two-phase commit control. First, transaction monitor A4
After receiving the termination request from the application program A2 (time point T1), notifies the database management system A3 and the transaction monitor B4 of the transaction termination preparation (time points T2 and T3). Transaction monitor B4
Notifies the database management system B3 of this transaction end preparation (time point T4). Thus, the database management system B3 starts preparation for the transaction end, and when the preparation is completed, it responds to the transaction monitor B4 (time T5). The transaction monitor B4 sends this to the transaction monitor A.
4 (time point T6). On the other hand, when the database management system A3 also completes the preparations for transaction end,
This is notified to the transaction monitor A4 (time point T7). As described above, the transaction monitor A4 indicates that the preparation of the database management systems A3 and B3 is completed.
Confirmed by.

【0008】その後、トランザクションモニタA4は、
トランザクション終了をデータベース管理システムA3
とトランザクションモニタB4とに通知する(時点T
8、T9)。トランザクションモニタB4は、これをデ
ータベース管理システムB3に通知する(時点T1
0)。データベース管理システムB3は、更新処理を行
ないトランザクション終了が完了したら、その旨をトラ
ンザクションモニタB4に応答する(時点T11)。ト
ランザクションモニタB4は、これをトランザクション
モニタA4に応答する(時点T12)。一方、トランザ
クションモニタA3も更新処理を行ないトランザクショ
ン終了が完了したら、その旨をトランザクションモニタ
A4に通知する(時点T13)。このようにして、デー
タベースA5、B5の更新が確実に完了する。最後に、
更新完了が応用プログラムA2に通知される(時点T1
4)。以上のような2相コミット制御によりトランザク
ションの原子性が保証される。
Thereafter, the transaction monitor A4
Transaction management is completed by database management system A3
And transaction monitor B4 (at time T
8, T9). The transaction monitor B4 notifies the database management system B3 of this (time point T1).
0). When the database management system B3 performs the update process and the transaction end is completed, the database management system B3 sends a response to that effect to the transaction monitor B4 (time T11). The transaction monitor B4 responds to the transaction monitor A4 (time point T12). On the other hand, when the transaction monitor A3 also performs the update process and the transaction end is completed, the transaction monitor A4 is notified of this (time T13). In this way, the updating of the databases A5 and B5 is surely completed. Finally,
The update completion is notified to the application program A2 (time point T1.
4). The atomicity of the transaction is guaranteed by the two-phase commit control as described above.

【0009】[0009]

【発明が解決しようとする課題】しかしながら、上述し
た従来の技術には、次のような問題があった。即ち、図
2において、応用プログラムA2によるトランザクショ
ンの処理におけるコミット又はロールバックは、計算機
A1のみで行なえるトランザクションの場合は、データ
ベース管理システムに出す。その一方、計算機A1、B
1の両方で行なうトランザクションの場合は、トランザ
クションモニタA4に出す。つまり、トランザクション
の内容によってトランザクションの終了のインタフェー
スが行なっていた。この結果、応用プログラムA2中に
コミット文又はロールバック文を書くとき、トランザク
ションの内容に応じて異なったプログラミングをしなけ
ればならなかった。従って、プログラマが混乱しやす
く、プログラムの誤りが発生し易いという問題があっ
た。本発明は、以上の点に着目してなされたもので、1
つの業務を1つのデータベース管理システムで処理する
場合も複数のデータベース管理システムで処理する場合
も応用プログラムにおいて区別しなくて済むようにした
トランザクション制御装置を提供することを目的とする
ものである。
However, the above-mentioned conventional technique has the following problems. That is, in FIG. 2, the commit or rollback in the transaction processing by the application program A2 is issued to the database management system in the case of a transaction that can be performed only by the computer A1. On the other hand, computers A1 and B
In the case of a transaction performed by both 1), it is sent to the transaction monitor A4. In other words, the transaction termination interface is performed depending on the content of the transaction. As a result, when writing a commit statement or a rollback statement in the application program A2, different programming had to be performed depending on the contents of the transaction. Therefore, there is a problem in that the programmer is confused and a program error is likely to occur. The present invention has been made by paying attention to the above points.
It is an object of the present invention to provide a transaction control device that does not need to be distinguished in an application program regardless of whether one job is processed by one database management system or a plurality of database management systems.

【0010】[0010]

【課題を解決するための手段】本発明のトランザクショ
ン制御装置は、複数の計算機のそれぞれに備えられた各
データベースの更新処理を伴うトランザクションの開始
から終了までの一連の処理を制御するトランザクション
制御装置において、前記各更新処理の同期をとるトラン
ザクションモニタに設けられ、前記トランザクションを
実行する応用プログラムが当該トランザクションモニタ
の利用を行なった場合にその旨を記憶する記憶手段と、
前記応用プログラムが前記トランザクションを終了する
ときに、当該応用プログラムから当該トランザクション
の終了要求を受け付けるデータベース管理システムと、
当該データベース管理システム内に設けられ、前記応用
プログラムからのトランザクション終了要求の受付時
に、前記トランザクションモニタに対し、前記応用プロ
グラムによる利用があったか否かを問合せる状態管理部
と、当該状態管理部の問合せの結果、前記応用プログラ
ムによる前記トランザクションの利用がなかったとき
は、前記自計算機内のデータベースの更新処理を行なう
検索/更新制御部と、当該状態管理部の問合せの結果、
前記応用プログラムによる前記トランザクションの利用
があったときは、前記トランザクションモニタにより前
記複数の計算機の各データベースの同期をとりつつ当該
各データベースの更新処理を行なうトランザクション制
御部とから成ることを特徴とするものである。
A transaction control device of the present invention is a transaction control device for controlling a series of processes from the start to the end of a transaction involving an update process of each database provided in each of a plurality of computers. A storage unit provided in the transaction monitor for synchronizing the update processes, and storing the effect when the application program executing the transaction uses the transaction monitor,
A database management system that receives a transaction end request from the application program when the application program ends the transaction;
A status management unit that is provided in the database management system and inquires of the transaction monitor whether or not the application program has been used when a transaction end request is received from the application program, and an inquiry of the status management unit. As a result, when the transaction is not used by the application program, a search / update control unit for updating the database in the own computer and a result of an inquiry from the state management unit,
When the transaction is used by the application program, the transaction monitor comprises a transaction control unit for updating the databases of the plurality of computers while synchronizing the databases of the computers. Is.

【0011】[0011]

【作用】本発明のトランザクション制御装置において
は、複数の計算機のそれぞれに備えられた各データベー
スの更新処理から成るトランザクションを終了する場合
において、当該各更新処理の同期をとるトランザクショ
ンモニタに対し、前記トランザクションを実行する応用
プログラムが当該トランザクションモニタの利用を行な
った場合はその旨を記憶する。そして、前記応用プログ
ラムが前記トランザクションを終了するときは、当該応
用プログラムが実行される自計算機内のデータベース管
理システムに対し、トランザクションの終了要求を出
す。次に、当該データベース管理システムが前記トラン
ザクションモニタに対し、前記応用プログラムによる利
用があったか否かを問合せ、前記応用プログラムの利用
がなかったときは、前記自計算機内のデータベースの更
新処理を行なう。一方、前記応用プログラムの利用があ
ったときは、前記トランザクションモニタにより前記複
数の計算機の各データベースの同期をとりつつ当該デー
タベースの更新処理を行なう。
In the transaction control device of the present invention, when the transaction consisting of the update processing of each database provided in each of the plurality of computers is terminated, the transaction monitor is synchronized with the transaction monitor to synchronize the update processing with the transaction. If the application program that executes the transaction uses the transaction monitor, the fact is stored. Then, when the application program ends the transaction, it issues a transaction end request to the database management system in the local computer in which the application program is executed. Then, the database management system inquires of the transaction monitor whether or not the application program has been used, and when the application program is not used, the database in the local computer is updated. On the other hand, when the application program is used, the transaction monitor updates the database while synchronizing the databases of the plurality of computers.

【0012】[0012]

【実施例】以下、本発明の実施例を図面を参照して詳細
に説明する。図1は、本発明のトランザクション制御装
置の一実施例のブロック図である。また、図4は、本発
明のトランザクション制御装置のハードウェア構成例を
示すブロック図である。図4の例では、計算機A1及び
B1がそれぞれ本発明のトランザクション制御装置とな
っている。計算機A1及びB1は、それぞれプロセッサ
11、21と、主記憶装置12、22と、磁気ディスク
装置13、23と、通信制御装置14、24とから成
る。プロセッサ11、21は、主記憶装置12、22に
格納された各種のプログラムを逐次読み出して実行し、
データ処理を行なう。主記憶装置12、22は、トラン
ザクションモニタA4、B4、応用プログラムA2、B
2、データベース管理システムA3、B3等のプログラ
ムを格納している。磁気ディスク装置13、23は、各
種のデータベースA5、B5を格納する。通信制御装置
14、24は、プロセッサ11、21からの命令に基づ
き、他の計算機B1、A1と通信するための制御を行な
う。図4及び図1の例では、計算機A1及びB1が通信
回線により接続され、各データベースA5及びB5を備
えた分散データベース処理システムが構成されている。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a block diagram of an embodiment of the transaction control device of the present invention. FIG. 4 is a block diagram showing a hardware configuration example of the transaction control device of the present invention. In the example of FIG. 4, the computers A1 and B1 are the transaction control devices of the present invention. The computers A1 and B1 are composed of processors 11 and 21, main storage devices 12 and 22, magnetic disk devices 13 and 23, and communication control devices 14 and 24, respectively. The processors 11 and 21 sequentially read out and execute various programs stored in the main storage devices 12 and 22,
Perform data processing. The main storage devices 12 and 22 are transaction monitors A4 and B4, application programs A2 and B, respectively.
2. Stores programs for the database management systems A3 and B3. The magnetic disk devices 13 and 23 store various databases A5 and B5. The communication control devices 14 and 24 perform control for communicating with other computers B1 and A1 based on the instructions from the processors 11 and 21. In the examples of FIGS. 4 and 1, computers A1 and B1 are connected by a communication line, and a distributed database processing system including the databases A5 and B5 is configured.

【0013】図1において、各計算機A1及びB1は、
相互に他のデータベースB5及びA5の更新処理を伴う
トランザクションの開始から終了までの一連の処理を制
御する。以下、計算機A1のみに注目した説明を行な
う。応用プログラムA2は、各種の業務処理を実行す
る。各業務処理は、前述したように、トランザクション
として実行される。データベース管理システムA3は、
自計算機A1のデータベースA5の検索及び更新の制御
を行なうとともに、トランザクションモニタA4を通じ
て他方の計算機B1のデータベースB5における更新処
理との同期をとる。トランザクションモニタA4は、応
用プログラムA2がトランザクションの実行に際し、当
該トランザクションモニタA4の利用を行なった場合に
その旨を記憶する記憶手段A41を備えている。
In FIG. 1, each of the computers A1 and B1 is
It controls a series of processes from the start to the end of a transaction involving the update process of the other databases B5 and A5. Hereinafter, description will be made focusing only on the computer A1. The application program A2 executes various business processes. Each business process is executed as a transaction as described above. The database management system A3 is
The search and update of the database A5 of the own computer A1 are controlled, and the transaction monitor A4 synchronizes with the update process of the database B5 of the other computer B1. The transaction monitor A4 is provided with a storage unit A41 for storing the fact that the application program A2 uses the transaction monitor A4 when executing the transaction.

【0014】また、データベース管理システムA3は、
応用プログラムA2がトランザクションを終了するとき
に、当該応用プログラムA2から当該トランザクション
の終了要求を受け付ける。このため、当該データベース
管理システムA3内には、状態管理部A30が設けられ
ている。状態管理部A30は、応用プログラムA2から
のトランザクション終了要求の受付時に、トランザクシ
ョンモニタA4に対し、応用プログラムA2による利用
があったか否かを問合せる。この状態管理部A30から
の問合せにより、トランザクションモニタA4は、記憶
手段A41内の記憶内容を検索する。当該状態管理部A
30の問合せの結果、応用プログラムA2によるトラン
ザクションの利用がなかったときは、応用プログラムA
2が実行中のトランザクションは他の計算機B1との通
信を伴わず、自計算機A1のデータベースA5のみの更
新処理を行なうものであるということが分かる。従っ
て、このときは、検索/更新制御部A32のみが起動さ
れる。
Further, the database management system A3 is
When the application program A2 ends the transaction, it receives a request for ending the transaction from the application program A2. Therefore, a state management unit A30 is provided in the database management system A3. When receiving the transaction end request from the application program A2, the state management unit A30 inquires of the transaction monitor A4 whether or not the application program A2 has been used. In response to the inquiry from the state management unit A30, the transaction monitor A4 searches the storage content in the storage unit A41. The state management unit A
As a result of the inquiry of 30, when the transaction by the application program A2 is not used, the application program A
It can be seen that the transaction No. 2 being executed is an update process for only the database A5 of the own computer A1 without communication with another computer B1. Therefore, at this time, only the search / update control unit A32 is activated.

【0015】検索/更新制御部A32は、自計算機A1
内のデータベースA5の検索及び更新処理を行なう。一
方、状態管理部A30の問合せの結果、応用プログラム
A2によるトランザクションA4の利用があったとき
は、応用プログラムA2が実行中のトランザクションは
他の計算機B1との通信を伴い、データベースB5の更
新処理をも行なうものであるということが分かる。従っ
て、このときは、検索/更新制御部A32の他に、トラ
ンザクション制御部A31も起動される。トランザクシ
ョン制御部A31は、トランザクションモニタA4と検
索/更新制御部A32とにより複数の計算機A1、B1
の各データベースA5、B5の同期をとりつつ当該各デ
ータベースA5、B5の更新処理を行なう。即ち、前述
した2相コミット制御を行なう。
The search / update control unit A32 uses the own computer A1.
The database A5 is searched and updated. On the other hand, as a result of the inquiry from the state management unit A30, when the transaction A4 is used by the application program A2, the transaction being executed by the application program A2 involves communication with another computer B1, and the update processing of the database B5 is performed. It turns out that this is also something to do. Therefore, at this time, the transaction control unit A31 is also activated in addition to the search / update control unit A32. The transaction control unit A31 includes a plurality of computers A1 and B1 by the transaction monitor A4 and the search / update control unit A32.
The databases A5 and B5 are updated in synchronization with each other. That is, the two-phase commit control described above is performed.

【0016】次に、上述した装置のトランザクション終
了時の動作を説明する。応用プログラムA2が1つのト
ランザクションを終了するときは、データベース管理シ
ステムA3にコミット又はロールバック要求を出す。こ
れにより、データベース管理システムA3内の状態管理
部A30が起動される。
Next, the operation of the above-mentioned apparatus at the end of the transaction will be described. When the application program A2 finishes one transaction, it issues a commit or rollback request to the database management system A3. As a result, the state management unit A30 in the database management system A3 is activated.

【0017】図5は、状態管理部における処理手順を説
明するフローチャートである。まず、応用プログラムA
2から、トランザクションのコミット又はロールバック
処理要求を受け付けると(ステップS1)、応用プログ
ラムA2がトランザクションモニタA4を利用している
か否かをトランザクションモニタA4に問合せる(ステ
ップS2)。トランザクションモニタA4を利用してい
ない場合は(ステップS3)、トランザクションのコミ
ット又はロールバック処理をトランザクション制御部A
31に要求する(ステップS4)。一方、トランザクシ
ョンモニタA4を利用している場合(ステップS3)、
トランザクションモニタA4に対し、コミット又はロー
ルバック処理をするように要求する(ステップS5)。
データベース管理システムA3からトランザクションの
コミット又はロールバックを要求されたトランザクショ
ンモニタA4は、この要求を応用プログラムA2から受
け取ったとみなす。従って、トランザクションモニタA
4は、トランザクションの終了要求を受けると、トラン
ザクションモニタB4とともに2相コミットプロトコル
によって、データベース管理システムA3、B3が管理
するデータベースA5、B5の更新処理の同期をとる。
FIG. 5 is a flow chart for explaining the processing procedure in the status management unit. First, application program A
When a transaction commit or rollback processing request is received from step 2 (step S1), the transaction monitor A4 is inquired whether the application program A2 uses the transaction monitor A4 (step S2). If the transaction monitor A4 is not used (step S3), the transaction control unit A performs transaction commit or rollback processing.
31 is requested (step S4). On the other hand, when the transaction monitor A4 is used (step S3),
It requests the transaction monitor A4 to perform commit or rollback processing (step S5).
The transaction monitor A4 requested to commit or roll back the transaction by the database management system A3 considers that the request is received from the application program A2. Therefore, transaction monitor A
Upon receipt of the transaction end request, the database 4 synchronizes with the transaction monitor B4 the update processing of the databases A5 and B5 managed by the database management systems A3 and B3.

【0018】図6は、本発明に係る2相コミット制御の
処理手順の説明図である。まず、データベース管理シス
テムA3は、応用プログラムA2から終了要求を受けた
後(時点T21)、図5のフローチャートに従ってトラ
ンザクションモニタA4への問合せを行なう(時点T2
2、T23)。データベース管理システムA3は、この
問合せの結果、他の計算機B1のデータベースの更新処
理を伴うと判別される場合のみ、トランザクションモニ
タA4に終了要求を送る(時点T24)。データベース
管理システムA3からの終了要求により、トランザクシ
ョンモニタA4は、トランザクション終了準備をデータ
ベース管理システムA3とトランザクションモニタB4
とに通知する(時点T25、T26)。トランザクショ
ンモニタB4は、このトランザクション終了準備をデー
タベース管理システムB3に通知する(時点T27)。
データベース管理システムB3は、これによりトランザ
クション終了の準備を開始し、準備が完了したら、その
旨をトランザクションモニタB4に応答する(時点T2
8)。トランザクションモニタB4は、これをトランザ
クションモニタA4に応答する(時点T29)。一方、
データベース管理システムA3もトランザクション終了
準備が完了したら、その旨をトランザクションモニタA
4に通知する(時点T30)。以上のようにして、デー
タベース管理システムA3、B3の準備の完了がトラン
ザクションモニタA4によって確認される。
FIG. 6 is an explanatory diagram of a processing procedure of two-phase commit control according to the present invention. First, the database management system A3, after receiving an end request from the application program A2 (time point T21), makes an inquiry to the transaction monitor A4 according to the flowchart of FIG. 5 (time point T2).
2, T23). The database management system A3 sends an end request to the transaction monitor A4 only when it is determined as a result of this inquiry that the database of the other computer B1 is updated (time T24). In response to the termination request from the database management system A3, the transaction monitor A4 prepares for the transaction termination, and the database management system A3 and the transaction monitor B4.
And (at time points T25 and T26). The transaction monitor B4 notifies the database management system B3 of this transaction end preparation (time point T27).
Thus, the database management system B3 starts preparation for the transaction end, and when the preparation is completed, it responds to the transaction monitor B4 (time point T2).
8). The transaction monitor B4 responds to this with the transaction monitor A4 (time T29). on the other hand,
When the database management system A3 is also ready to complete the transaction, the transaction monitor A
4 is notified (time point T30). As described above, the transaction monitor A4 confirms the completion of preparations of the database management systems A3 and B3.

【0019】その後、トランザクションモニタA4は、
トランザクション終了をデータベース管理システムA3
とトランザクションモニタB4とに通知する(時点T3
1、T32)。トランザクションモニタB4は、これを
データベース管理システムB3に通知する(時点T3
3)。データベース管理システムB3は、更新処理を行
ないトランザクション終了が完了したら、その旨をトラ
ンザクションモニタB4に応答する(時点T34)。ト
ランザクションモニタB4は、これをトランザクション
モニタA4に応答する(時点T35)。一方、トランザ
クションモニタA3も更新処理を行ないトランザクショ
ン終了が完了したら、その旨をトランザクションモニタ
A4に通知する(時点T36)。このようにして、デー
タベースA5、B5の更新が確実に完了する。最後に、
トランザクションモニタA4が更新完了をデータベース
管理システムA3に通知し(時点T37)、更に、デー
タベース管理システムA3が応用プログラムA2に更新
完了を通知する(時点T38)。
Thereafter, the transaction monitor A4
Transaction management is completed by database management system A3
And transaction monitor B4 (time point T3
1, T32). The transaction monitor B4 notifies the database management system B3 of this (time point T3).
3). When the database management system B3 performs the update process and the transaction end is completed, the database management system B3 sends a response to that effect to the transaction monitor B4 (time T34). The transaction monitor B4 responds to this by the transaction monitor A4 (time point T35). On the other hand, when the transaction monitor A3 also performs the updating process and the transaction end is completed, the transaction monitor A4 is notified of that fact (time point T36). In this way, the updating of the databases A5 and B5 is surely completed. Finally,
The transaction monitor A4 notifies the update completion to the database management system A3 (time T37), and the database management system A3 further notifies the application program A2 of update completion (time T38).

【0020】図7は、既存の応用プログラムの転用例の
説明図である。計算機A1で実行される既存の応用プロ
グラム71がデータベースA5のみを更新対象としたト
ランザクションのみ実行する場合、コミット文やロール
バック文は、データベース管理システムA3に出される
ようになっている。この計算機A1に計算機B1を通信
回線で接続して分散データベース処理システムを構成す
る際、既存の応用プログラム71を転用するとする。こ
の場合、従来のトランザクション制御装置では、応用プ
ログラム71に表われるコミット文及びロールバック文
をすべて捜し出し、コミット及びロールバックがトラン
ザクションモニタA4に出されるように書き換えなけれ
ばならない。一方、本発明のトランザクション制御装置
では、既存の応用プログラム71の部分は手を加える必
要がなく、新たに追加する部分72のみのプログラミン
グを行なうだけでよい。
FIG. 7 is an explanatory diagram of a diversion example of an existing application program. When the existing application program 71 executed on the computer A1 executes only the transaction that updates only the database A5, the commit statement and the rollback statement are issued to the database management system A3. It is assumed that the existing application program 71 is diverted when the computer B1 is connected to the computer A1 via a communication line to form a distributed database processing system. In this case, in the conventional transaction control device, all commit statements and rollback statements appearing in the application program 71 have to be searched and rewritten so that the commit and rollback are issued to the transaction monitor A4. On the other hand, in the transaction control device of the present invention, it is not necessary to modify the part of the existing application program 71, and only the newly added part 72 needs to be programmed.

【0021】[0021]

【発明の効果】以上説明したように、本発明のトランザ
クション制御装置によれば、応用プログラムはトランザ
クションモニタを使用する場合も使用しない場合も自計
算機内のデータベース管理システムにトランザクション
終了要求を出せばよいようにしたので、いずれの場合も
同じインタフェースでトランザクションを制御すること
ができる。従って、応用プログラム中のコミット文やロ
ールバック文を使い分ける必要がなく、プログラミング
作業が容易となり、プログラムミスを防止することがで
きる。また、既存の集中型データベース処理システムを
対象とした応用プログラムを分散データベース処理シス
テムに転用する際に、プログラム中のコミット文やロー
ルバック文を捜し出してその部分を書き換える必要がな
くなるようにできる。
As described above, according to the transaction control apparatus of the present invention, the application program may issue a transaction end request to the database management system in the own computer regardless of whether the transaction monitor is used or not. As a result, transactions can be controlled by the same interface in either case. Therefore, it is not necessary to properly use the commit statement and the rollback statement in the application program, the programming work is facilitated, and the program mistake can be prevented. Also, when an application program intended for an existing centralized database processing system is diverted to a distributed database processing system, it is not necessary to search for a commit statement or rollback statement in the program and rewrite that part.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明のトランザクション制御装置の一実施例
のブロック図である。
FIG. 1 is a block diagram of an embodiment of a transaction control device of the present invention.

【図2】従来のトランザクション制御システムの構成を
示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a conventional transaction control system.

【図3】従来の2相コミット制御の処理手順の説明図で
ある。
FIG. 3 is an explanatory diagram of a processing procedure of conventional two-phase commit control.

【図4】本発明のトランザクション制御装置のハードウ
ェア構成例を示すブロック図である。
FIG. 4 is a block diagram showing a hardware configuration example of a transaction control device of the present invention.

【図5】状態管理部における処理手順を説明するフロー
チャートである。
FIG. 5 is a flowchart illustrating a processing procedure in a state management unit.

【図6】本発明に係る2相コミット制御の処理手順の説
明図である。
FIG. 6 is an explanatory diagram of a processing procedure of two-phase commit control according to the present invention.

【図7】既存の応用プログラムの転用例の説明図であ
る。
FIG. 7 is an explanatory diagram of a diversion example of an existing application program.

【符号の説明】 11、21 プロセッサ 12、22 主記憶装置 13、23 磁気ディスク装置 14、15 通信制御装置 A1、B1 計算機 A2、B2 応用プログラム A3、B3 データベース管理システム A4、B4 トランザクションモニタ A5、B5 データベース A30、B30 状態管理部 A31、B31 トランザクション制御部 A32、B32 検索/更新制御部 A41、B41 記憶手段[Explanation of Codes] 11, 21 Processor 12, 22 Main Storage Device 13, 23 Magnetic Disk Device 14, 15 Communication Control Device A1, B1 Computer A2, B2 Application Program A3, B3 Database Management System A4, B4 Transaction Monitor A5, B5 Database A30, B30 State management unit A31, B31 Transaction control unit A32, B32 Search / update control unit A41, B41 Storage means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 複数の計算機のそれぞれに備えられた各
データベースの更新処理を伴うトランザクションの開始
から終了までの一連の処理を制御するトランザクション
制御装置において、 前記各更新処理の同期をとるトランザクションモニタに
設けられ、前記トランザクションを実行する応用プログ
ラムが当該トランザクションモニタの利用を行なった場
合にその旨を記憶する記憶手段と、 前記応用プログラムが前記トランザクションを終了する
ときに、当該応用プログラムから当該トランザクション
の終了要求を受け付けるデータベース管理システムと、 当該データベース管理システム内に設けられ、前記応用
プログラムからのトランザクション終了要求の受付時
に、前記トランザクションモニタに対し、前記応用プロ
グラムによる利用があったか否かを問合せる状態管理部
と、 当該状態管理部の問合せの結果、前記応用プログラムに
よる前記トランザクションの利用がなかったときは、前
記自計算機内のデータベースの更新処理を行なう検索/
更新制御部と、 当該状態管理部の問合せの結果、前記応用プログラムに
よる前記トランザクションの利用があったときは、前記
トランザクションモニタにより前記複数の計算機の各デ
ータベースの同期をとりつつ当該各データベースの更新
処理を行なうトランザクション制御部とから成ることを
特徴とするトランザクション制御装置。
1. A transaction control device for controlling a series of processes from the start to the end of a transaction involving the update process of each database provided in each of a plurality of computers, and a transaction monitor for synchronizing the update processes. A storage unit that is provided and stores the fact that an application program that executes the transaction uses the transaction monitor, and when the application program ends the transaction, the application program ends the transaction. A database management system that receives a request, and a database management system that is provided in the database management system and is used by the application program to the transaction monitor when a transaction end request is received from the application program. A state management unit that inquires whether or not there is, and as a result of the inquiry of the state management unit, if the transaction by the application program is not used, update processing of the database in the local computer is performed.
As a result of the inquiry of the update control unit and the state management unit, when the application program uses the transaction, the transaction monitor synchronizes the databases of the plurality of computers and updates the databases. And a transaction control unit for performing the transaction.
JP4332478A 1992-11-18 1992-11-18 Transaction controller Pending JPH06161862A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4332478A JPH06161862A (en) 1992-11-18 1992-11-18 Transaction controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4332478A JPH06161862A (en) 1992-11-18 1992-11-18 Transaction controller

Publications (1)

Publication Number Publication Date
JPH06161862A true JPH06161862A (en) 1994-06-10

Family

ID=18255411

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4332478A Pending JPH06161862A (en) 1992-11-18 1992-11-18 Transaction controller

Country Status (1)

Country Link
JP (1) JPH06161862A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0806731A3 (en) * 1996-01-18 1998-12-09 Sun Microsystems, Inc. Database network
JP2012064251A (en) * 2012-01-04 2012-03-29 Bank Of Tokyo-Mitsubishi Ufj Ltd Data processor
JP2013145606A (en) * 2013-04-30 2013-07-25 Bank Of Tokyo-Mitsubishi Ufj Ltd Data processing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0806731A3 (en) * 1996-01-18 1998-12-09 Sun Microsystems, Inc. Database network
JP2012064251A (en) * 2012-01-04 2012-03-29 Bank Of Tokyo-Mitsubishi Ufj Ltd Data processor
JP2013145606A (en) * 2013-04-30 2013-07-25 Bank Of Tokyo-Mitsubishi Ufj Ltd Data processing device

Similar Documents

Publication Publication Date Title
US10706009B2 (en) Techniques to parallelize CPU and IO work of log writes
EP0236743B1 (en) Method for restarting a long-running, fault-tolerant operation in a transaction-oriented data base system
US7716249B2 (en) Transaction and task scheduler
JP2505112B2 (en) Transaction management method
US5778388A (en) Method of processing a synchronization point in a database management system to assure a database version using update logs from accumulated transactions
US7707186B2 (en) Method and apparatus for data set migration
US6061769A (en) Data set backup in a shared environment
AU2007215295B2 (en) Anticipatory changes to resources managed by locks
US5832521A (en) Method and apparatus for performing consistent reads in multiple-server environments
US8166094B2 (en) Coordinated quiesce of a distributed file system
EP2825958B1 (en) Systems and methods for supporting transaction recovery based on a strict ordering of two-phase commit calls
US7620661B2 (en) Method for improving the performance of database loggers using agent coordination
US5715447A (en) Method of and an apparatus for shortening a lock period of a shared buffer
CN112965951A (en) System and method for redistribution of data in a database
US6330686B1 (en) Handling protected conversation messages across IMS restart in shared queues environment
JPH06161862A (en) Transaction controller
US10740320B2 (en) Systems and methods of operation lock management and system catalog overrides in database systems
JP2000137620A (en) Method and system for changing program of transaction processing system and storage medium
JP4311059B2 (en) Transaction control method
US10459810B2 (en) Technique for higher availability in a multi-node system using replicated lock information to determine a set of data blocks for recovery
JPH05307478A (en) Constituting method for data base management system
EP0551528B1 (en) Method and apparatus for reducing lock period of shared buffer
JPH06119227A (en) Distributed data base control system
JPH04199339A (en) Distributed transaction file control method for distributed processing system
Gruenwald et al. A performance study of concurrency control in a real-time main memory database system