JP3253321B2 - Synchronization confirmation processing method for database access - Google Patents

Synchronization confirmation processing method for database access

Info

Publication number
JP3253321B2
JP3253321B2 JP17292891A JP17292891A JP3253321B2 JP 3253321 B2 JP3253321 B2 JP 3253321B2 JP 17292891 A JP17292891 A JP 17292891A JP 17292891 A JP17292891 A JP 17292891A JP 3253321 B2 JP3253321 B2 JP 3253321B2
Authority
JP
Japan
Prior art keywords
transaction
application program
dbms
identifier
request
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.)
Expired - Fee Related
Application number
JP17292891A
Other languages
Japanese (ja)
Other versions
JPH0520150A (en
Inventor
秀実 森畠
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP17292891A priority Critical patent/JP3253321B2/en
Publication of JPH0520150A publication Critical patent/JPH0520150A/en
Application granted granted Critical
Publication of JP3253321B2 publication Critical patent/JP3253321B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、データベースに対する
アクセスの一時的な中断後、アクセス再開時におけるデ
ータベース管理システム(DBMS)とアプリケーショ
ン・プログラムとの同期確認を行うデータベースアクセ
スのための同期確認処理方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a synchronization confirmation processing method for a database access for confirming the synchronization between a database management system (DBMS) and an application program when the access to a database is temporarily suspended after the access is temporarily suspended. About.

【0002】[0002]

【従来の技術】従来のDBMSでは、データ更新を行う
場合、アプリケーションプログラムから送られてくる更
新要求を順次受け取り、データの仮更新を実行する。そ
の後、アプリケーション・プログラムからのコミット命
令を受け取った時点で先に受け取った更新要求の実更新
を実行するという方式をとっている。この方式により、
データ更新処理中に障害がおこった場合、仮更新を取り
消す(ロールバックする)ことにより、DBMSとアプ
リケーション・プログラムとの同期をとるようにしてい
る。参考文献:ORACLEデータベース管理者ガイドVer.6
(1990),およびINGRESデータベース・マニュアルVer.2(1
989) 。
2. Description of the Related Art In a conventional DBMS, when data is updated, an update request sent from an application program is sequentially received and data is temporarily updated. Thereafter, when a commit command is received from the application program, the actual update of the update request received earlier is executed. With this method,
If a failure occurs during the data update processing, the provisional update is canceled (rolled back) to synchronize the DBMS with the application program. References: ORACLE Database Administrator's Guide Ver.6
(1990), and INGRES Database Manual Ver. 2 (1
989).

【0003】しかしこのような方式では、アプリケーシ
ョン・プログラムがコミット要求を送出後、コミット完
了通知を受け取る以前に障害が発生した場合、実更新が
実行されたことをアプリケーション・プログラム側が確
認することができない。そこで、障害復旧後にデータ更
新の確認を行い、DBMS側とアプリケーション・プロ
グラム側との同期をとる必要が生じる。
However, in such a system, if a failure occurs before the application program receives the commit completion notice after sending the commit request, the application program cannot confirm that the actual update has been executed. . Therefore, it is necessary to confirm the data update after the recovery from the failure and synchronize the DBMS and the application program.

【0004】しかし、現状のDBMSでは、トランザク
ションの完了確認をアプリケーション・プログラムから
確認することができるDBMSと、トランザクションの
完了確認についてアプリケーション・プログラムから何
らかの手段をとらないと当該トランザクションの完了確
認をすることができないDBMSとが混在している。図
3に市販DBMSにおけるトランザクション完了確認方
法をしめす。トランザクション完了確認を行う機能を持
たないDBMSにおいてはトランザクションの保障を十
分に行うことができないため、信頼性のあるシステムを
構築することができないという問題点がある。また、様
々な種類のDBMSを利用したネットワーク環境を構築
しようと試みたとき、共通の方法でアプリケーション・
プログラムとDBMSの同期をとることができず、デー
タベースアクセスのためのアプリケーション・プログラ
ムのポータビリティ向上の妨げとなっている。
[0004] However, in the current DBMS, a DBMS in which the completion of a transaction can be confirmed from an application program and a transaction in which the transaction is completed can be confirmed .
What from the application program about completion confirmation
If no other measures are taken, the completion of the transaction
There are DBMSs that cannot be recognized . FIG. 3 shows a transaction completion confirmation method in a commercially available DBMS. In a DBMS that does not have a function of confirming the completion of a transaction, there is a problem that a reliable system cannot be constructed because a transaction cannot be sufficiently guaranteed. Also, when trying to build a network environment using various types of DBMS, application /
The program and the DBMS cannot be synchronized, which hinders the improvement of the portability of the application program for accessing the database.

【0005】[0005]

【発明が解決しようとする課題】上記のように従来のD
BMSでは障害復旧後の同期確認方式が共通化できない
ため、アプリケーション・プログラムのポータビリティ
を確保するためにはデータベースアクセス時における耐
障害性を損ねる結果となり、また耐障害性を確保しよう
とすると、アプリケーション・プログラムのポータビリ
ティが損なわれるという問題がある。
As described above, the conventional D
In BMS, the synchronization confirmation method after failure recovery cannot be shared, so that the portability of the application program is impaired in the fault tolerance during database access. There is a problem that the portability of the program is impaired.

【0006】本発明は、DBMSにおいて、共通化され
た方法で障害回復後の同期確認を行い得るようにするこ
とを目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to enable a DBMS to perform synchronization confirmation after recovery from a failure by a common method.

【0007】[0007]

【課題を解決するための手段】本発明においては、アプ
リケーション・プログラムから異種DBMSに対して共
通化された方法で同期確認を行うようにする。
According to the present invention, synchronization is confirmed from an application program to a heterogeneous DBMS by a common method.

【0008】図2は本発明の場合の同期確認のためのフ
ローチャートを示す。同期確認はトランザクションを単
位として行われる。アプリケーション・プログラムから
の要求を受け付け(S1)、受け付けた要求がトランザ
クションの開始要求であった(S2)場合,各々のトラ
ンザクションに識別子を付与し(S3)、メモリにトラ
ンザクション識別子を保存する(S4)。
FIG. 2 shows a flowchart for confirming synchronization in the case of the present invention. Synchronization confirmation is performed for each transaction. A request from the application program is received (S1). If the received request is a transaction start request (S2), an identifier is assigned to each transaction (S3), and the transaction identifier is stored in a memory (S4). .

【0009】アプリケーション・プログラムからコミッ
トの要求が出される(S5)と,各アプリケーション・
プログラム毎にデータベース内に用意されたトランザク
ション・ログ・テーブルにトランザクション識別子を書
き込み(S6)。コミット要求でなければデータ参照・
データ操作実行が行われる(S7)。トランザクション
・ログ・テーブルへの書き込み処理が終了した後,改め
てDBMSに対してコミット要求を行う(S8)。そし
て、処理終了か否かが調べられる(S9)。
When a commit request is issued from the application program (S5), each application program
The transaction identifier is written in a transaction log table prepared in the database for each program (S6). If not a commit request, refer to data
Data operation execution is performed (S7). After the write processing to the transaction log table is completed, a commit request is made again to the DBMS (S8). Then, it is checked whether or not the processing is completed (S9).

【0010】[0010]

【作用】このようなフローでメモリとトランザクション
・ログ・テーブルとにトランザクション識別子を書き込
むことにより,トランザクションが完了後(コミット完
了後)に障害が生じた場合にはトランザクション・ログ
・テーブルの内容はDBMSによって保証されているた
め,テーブル内にはトランザクション識別子等の情報が
残っている。したがって、メモリの内容とトランザクシ
ョン・ログ・テーブルとの内容は一致している。
By writing the transaction identifier in the memory and the transaction log table in such a flow, if a failure occurs after the transaction is completed (after the completion of the commit), the contents of the transaction log table are stored in the DBMS. Therefore, information such as a transaction identifier remains in the table. Therefore, the contents of the memory and the contents of the transaction log table match.

【0011】これに対して、トランザクション完了前に
障害が生じた場合にはそれらの情報はロールバック処理
よって失われる。したがって、メモリの内容とトランザ
クション・ログ・テーブルとの内容に不一致が生じる。
On the other hand, if a failure occurs before the transaction is completed, such information is lost by the rollback processing. Therefore, a mismatch occurs between the contents of the memory and the contents of the transaction log table.

【0012】そこで、障害からの再立ち上げ後にアプリ
ケーション・プログラムが,メモリの内容とトランザク
ション・ログ・テーブルの内容を参照し、トランザクシ
ョン実行の確認を行うことを可能とする。
Therefore, it is possible for the application program to confirm the transaction execution by referring to the contents of the memory and the contents of the transaction log table after restarting from the failure.

【0013】本発明の場合には、DBMSが持つ基本的
な機能である、データベース内へのテーブルの生成、書
き込み機能だけを使って実現されているため、種々のD
BMSに対して適用可能である。
In the case of the present invention, since various functions are realized using only the functions of generating and writing tables in the database, which are the basic functions of the DBMS,
Applicable to BMS.

【0014】[0014]

【実施例】図1は本発明の一実施例構成図を示す。アプ
リケーション・プログラム1は線12を通して制御装置
3にデータ更新のためのSQL文を送出する。制御装置
3は送られてきたSQL文が、前回のコミット後の最初
のSQL文であるか、2番目以降のSQL文であるか、
コミット要求文であるかを判定する。
FIG. 1 is a block diagram showing an embodiment of the present invention. The application program 1 sends an SQL statement for updating data to the control device 3 via the line 12. The control device 3 determines whether the sent SQL statement is the first SQL statement after the last commit, the second or subsequent SQL statement,
Determine whether the statement is a commit request statement.

【0015】最初のSQL文の場合,制御装置3は線1
4を通してトランザクション識別子生成装置4にトラン
ザクション開始通知を行うとともに、線16を通してD
BMS7へとSQL文を送出する。
In the case of the first SQL statement, the control unit 3
4 and notifies the transaction identifier generation device 4 of the transaction start.
Sends an SQL statement to BMS7.

【0016】トランザクション識別子生成装置4は線1
3を通してメモリ2に格納されているトランザクション
識別子の履歴を参照し,開始トランザクションに識別子
を付与し、線13を通してトランザクション識別子をメ
モリ2に書き込み。
The transaction identifier generating device 4 has a line 1
Reference is made to the history of the transaction identifier stored in the memory 2 through 3, the identifier is assigned to the start transaction, and the transaction identifier is written into the memory 2 through the line 13.

【0017】2番目以降のSQL文の場合,制御装置3
は線16を通してDBMS7へとSQL文を送出する。
SQL文を受け取ったDBMS7は、線21を通してユ
ーザ・テーブル9の操作を行う。
In the case of the second and subsequent SQL statements, the control unit 3
Sends an SQL statement to the DBMS 7 via the line 16.
The DBMS 7 that has received the SQL statement operates the user table 9 through the line 21.

【0018】コミット要求文の場合、制御装置3は線1
5を通してトランザクションコミットメント制御装置5
にコミット要求通知を行う。要求を受け取ったトランザ
クションコミットメント制御装置5は線18を通してト
ランザクション識別子を参照し,線19を通してDBM
S7にSQL文を送出する。SQL文を受け取ったDB
MS7は線22を通してトランザクション・ログ・テー
ブル10にトランザクション識別子の書き込みを行う。
DBMS7は書き込み終了の信号を線19を通してトラ
ンザクションコミットメント制御装置5に送出する。書
き込み終了信号を受け取ったトランザクションコミット
メント制御装置5は線19を通してDBMS7に対して
コミット要求を送出する。コミット要求を受け取ったD
BMS7はデータベース8に対して線21及び線22を
通じてコミットを実行する。
In the case of a commit request statement, the control unit 3
Transaction commitment controller 5 through 5
To notify the commit request. Upon receiving the request, the transaction commitment control device 5 refers to the transaction identifier via the line 18 and
An SQL statement is sent to S7. DB that received the SQL statement
The MS 7 writes the transaction identifier to the transaction log table 10 via the line 22.
The DBMS 7 sends a write end signal to the transaction commitment control device 5 via the line 19. The transaction commitment control device 5 that has received the write end signal sends a commit request to the DBMS 7 via the line 19. D that received the commit request
The BMS 7 performs a commit on the database 8 through the lines 21 and 22.

【0019】異常発生等の原因によりデータベース操作
処理が中断した場合、DBMSが障害を検出し、コミッ
ト完了していないトランザクションについては線21及
び線22を通してロールバックを実行する。ロールバッ
クが実行されると、最も新しいコミットの直後の状態ま
でユーザ・テーブル9およびトランザクション・ログ・
テーブル10が復元される。
When the database operation processing is interrupted due to an abnormality or the like, the DBMS detects a failure, and rolls back transactions that have not been committed through lines 21 and 22. When a rollback is performed, the user table 9 and the transaction log are kept up to the state immediately after the most recent commit.
Table 10 is restored.

【0020】データベースアクセス処理中断後,処理再
開時にアプリケーション・プログラム1は線11を通し
てメモリ2を参照し,アプリケーション・プログラム1
が送出したトランザクションのトランザクション識別子
の情報を得る。
After the database access processing is interrupted, when the processing is resumed, the application program 1 refers to the memory 2 through the line 11, and the application program 1
Obtains the information of the transaction identifier of the transaction sent by.

【0021】さらに、アプリケーション・プログラム1
は線12を通して制御装置3に完了しているトランザク
ションの確認要求を送出する。制御装置3は完了トラン
ザクションの確認要求を受け取ると、線17を通して確
認装置6にトランザクション・ログ・テーブル10の検
索要求を送出する。確認装置6は完了トランザクション
の確認要求を受け取ると、線20を通してDBMS7に
トランザクション・ログ・テーブル10の検索要求を送
出する。DBMS7はトランザクション・ログ・テーブ
ル10検索の要求を受け取ると、線22を通してトラン
ザクション・ログ・テーブル10を検察し、線20を通
して確認装置6に検索結果を通知する。確認装置6は検
索結果より、既完了トランザクションのトランザクショ
ン識別子を制御装置3に線17を通して送出する。制御
装置3は確認装置6より送られてきた結果を線12を通
してアプリケーション・プログラム1に送出する。
Further, the application program 1
Sends a request for confirmation of the completed transaction to the controller 3 via the line 12. When receiving the confirmation request for the completed transaction, the control device 3 sends a request for searching the transaction log table 10 to the confirmation device 6 via the line 17. When the confirmation device 6 receives the confirmation request for the completed transaction, the confirmation device 6 sends a request for searching the transaction log table 10 to the DBMS 7 via the line 20. When receiving the transaction log table 10 search request, the DBMS 7 detects the transaction log table 10 via a line 22 and notifies the checking device 6 of the search result via a line 20. The confirmation device 6 sends the transaction identifier of the completed transaction to the control device 3 via the line 17 based on the search result. The control device 3 sends the result sent from the confirmation device 6 to the application program 1 via the line 12.

【0022】このとき、メモリ2に格納されているトラ
ンザクション識別子とトランザクション・ログ・テーブ
ル10に格納されているトランザクション識別子とは、
トランザクション識別子生成装置4がトランザクション
識別子をメモリ2に書き込み後、DBMS7がトランザ
クション・ログ・テーブル10にトランザクション識別
子を書き込む前に障害が発生した場合、メモリ2に格納
されているトランザクション識別子と、トランザクショ
ン・ログ・テーブル10に格納されているトランザクシ
ョン識別子とが異なり、その他の状態で障害が発生した
場合には一致するという結果となる。
At this time, the transaction identifier stored in the memory 2 and the transaction identifier stored in the transaction log table 10 are:
If a failure occurs before the DBMS 7 writes the transaction identifier to the transaction log table 10 after the transaction identifier generation device 4 writes the transaction identifier to the memory 2, the transaction identifier stored in the memory 2 and the transaction log If the transaction identifier is different from the transaction identifier stored in the table 10 and a failure occurs in another state, the result is that they match.

【0023】[0023]

【発明の効果】以上説明したように本発明によれば、従
来の技術のような複数種類のDBMSへアクセスしよう
とした場合のアクセス中断後のアプリケーション・プロ
グラム−DBMS間の同期確認機能をもたないDBMS
であっても同期確認を行うことが可能となるため,アプ
リケーション・プログラムのポータビリティと耐障害性
の確保の両立が可能となる。
As described above, according to the present invention, there is provided a function for confirming synchronization between an application program and a DBMS after access is interrupted when trying to access a plurality of types of DBMSs as in the prior art. No DBMS
Even in this case, the synchronization can be confirmed, so that both portability of the application program and securing of fault tolerance can be achieved.

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

【図1】アプリケーション・プログラムとDBMSの同
期確認方式の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a synchronization confirmation system between an application program and a DBMS.

【図2】アプリケーション・プログラムとDBMS間の
同期確認方式のフローチャートである。
FIG. 2 is a flowchart of a synchronization confirmation method between an application program and a DBMS.

【図3】市販DBMSにおけるトランザクション完了確
認方法を示す図である。
FIG. 3 is a diagram showing a transaction completion confirmation method in a commercially available DBMS.

【符号の説明】[Explanation of symbols]

1 アプリケーション・プログラム 2 メモリ 3 制御装置 4 トランザクション識別子生成装置 5 トランザクションコミットメント制御装置 6 確認装置 7 DBMS 8 データベース 9 ユーザ・テーブル 10 トランザクション・ログ・テーブル DESCRIPTION OF SYMBOLS 1 Application program 2 Memory 3 Control device 4 Transaction identifier generation device 5 Transaction commitment control device 6 Confirmation device 7 DBMS 8 Database 9 User table 10 Transaction log table

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数の種類のデータベースに対して,ア
プリケーション・プログラムとデータベース管理システ
ム(DBMS)との同期確認を行う方式であって、 アプリケーション・プログラムからの要求がトランザク
ション開始要求であることを認識し、トランザクション
の識別子を付与し、保持する機能と、 アプリケーション・プログラムからの要求がトランザク
ション終了要求であることを識別し、保持していたトラ
ンザクション識別子をDBMS配下に存在するトランザ
クション・ログ・テーブルに記録する機能と、 保持されているトランザクション識別子とトランザクシ
ョン・ログ・テーブルとをアプリケーション・プログラ
ムから参照可能とする機能とを持ち、 トランザクション開始時にトランザクション識別子をメ
モリ内に保持し、 トランザクション終了時にメモリ内のトランザクション
識別子をトランザクション・ログ・テーブルに記録し、 トランザクション処理中に処理を中断した場合に、アプ
リケーション・プログラムから、保持されているトラン
ザクション識別子とトランザクション・ログ・テーブル
に格納されている識別子とを参照することを特徴とする
データベース・アクセスのための同期確認処理方式。
A method for confirming synchronization between an application program and a database management system (DBMS) for a plurality of types of databases, and recognizes that a request from the application program is a transaction start request. And a function for assigning and retaining a transaction identifier, and identifying that the request from the application program is a transaction end request, and recording the retained transaction identifier in a transaction log table existing under the DBMS. And a function that allows the application program to refer to the stored transaction identifier and transaction log table. When the transaction starts, the transaction identifier is stored in the memory. When the transaction ends, the transaction identifier in memory is recorded in the transaction log table. If the processing is interrupted during the transaction processing, the application program stores the transaction identifier and transaction log table synchronization confirmation processing method for the identifier stored database access, wherein ginseng stealth Rukoto.
JP17292891A 1991-07-15 1991-07-15 Synchronization confirmation processing method for database access Expired - Fee Related JP3253321B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17292891A JP3253321B2 (en) 1991-07-15 1991-07-15 Synchronization confirmation processing method for database access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17292891A JP3253321B2 (en) 1991-07-15 1991-07-15 Synchronization confirmation processing method for database access

Publications (2)

Publication Number Publication Date
JPH0520150A JPH0520150A (en) 1993-01-29
JP3253321B2 true JP3253321B2 (en) 2002-02-04

Family

ID=15950954

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17292891A Expired - Fee Related JP3253321B2 (en) 1991-07-15 1991-07-15 Synchronization confirmation processing method for database access

Country Status (1)

Country Link
JP (1) JP3253321B2 (en)

Also Published As

Publication number Publication date
JPH0520150A (en) 1993-01-29

Similar Documents

Publication Publication Date Title
CA3121919C (en) System and method for augmenting database applications with blockchain technology
US7565572B2 (en) Method for rolling back from snapshot with log
US5724581A (en) Data base management system for recovering from an abnormal condition
US5884328A (en) System and method for sychronizing a large database and its replica
US6662196B2 (en) Collision avoidance in bidirectional database replication
CN101567805B (en) Method for recovering failed parallel file system
US7490113B2 (en) Database log capture that publishes transactions to multiple targets to handle unavailable targets by separating the publishing of subscriptions and subsequently recombining the publishing
US7107294B2 (en) Method and apparatus for interrupting updates to a database to provide read-only access
US6941327B2 (en) Apparatus and method for database synchronization in a duplex system
US5832517A (en) System logging using embedded database
JP4282030B2 (en) Data duplex control method and duplex storage subsystem
DE602005002532T2 (en) CLUSTER DATABASE WITH REMOTE DATA MIRROR
US20060253499A1 (en) System and method for automatically transferring data from one database to another
US6330686B1 (en) Handling protected conversation messages across IMS restart in shared queues environment
JP3042600B2 (en) Distributed file synchronization method
US7194675B2 (en) Backup method, backup system, disk controller and backup program
JP3253321B2 (en) Synchronization confirmation processing method for database access
JPH0561748A (en) System for automating synchronous confirmation in database access
JPH06119227A (en) Distributed data base control system
US6539434B1 (en) UOWE's retry process in shared queues environment
JP3290182B2 (en) Data set backup method and apparatus in shared environment
JPH1185594A (en) Information processing system for remote copy
WO2023193495A1 (en) Method for processing read request, distributed database and server
JPH0290341A (en) Saving system for data base file
KR100526221B1 (en) Method and System for Restoring Database Synchronization in Independent Mated Pair System

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees