JPH0520150A - Synchronization confirmation processing system for data base access - Google Patents

Synchronization confirmation processing system for data base access

Info

Publication number
JPH0520150A
JPH0520150A JP3172928A JP17292891A JPH0520150A JP H0520150 A JPH0520150 A JP H0520150A JP 3172928 A JP3172928 A JP 3172928A JP 17292891 A JP17292891 A JP 17292891A JP H0520150 A JPH0520150 A JP H0520150A
Authority
JP
Japan
Prior art keywords
transaction
application program
identifier
request
dbms
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.)
Granted
Application number
JP3172928A
Other languages
Japanese (ja)
Other versions
JP3253321B2 (en
Inventor
Hidemi Morihata
秀実 森畠
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)

Abstract

PURPOSE:To execute the synchronization confirmation after recovery of a fault by a comma method by constituting the system so that a transaction identifier can be referred to. CONSTITUTION:In the case a request from an application program l is received, and the received request is a start request of a transaction, a transaction identifier generating device 4 gives an identifier to each transaction, and holds a transaction identifier in a memory 2. When a request of a commitment is outputted from the application program 1, the transaction identifier is written in a transaction log table 10 prepared in a data base at every application program, and unless it is the commitment request, a data reference and a data operation are executed. After a write processing to the transaction log table 10 is finished, the commitment request is executed again to a data base management system(DBMS) 7. Subsequently, whether the processing is finished or not is checked.

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 system for database access for confirming the synchronization between a database management system (DBMS) and an application program when access is resumed after temporary interruption of access to the database. Regarding

【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, update requests sent from an application program are sequentially received and data is temporarily updated. After that, when the commit command is received from the application program, the actual update of the previously received update request is executed. By this method,
When a failure occurs during the data update process, the temporary update is canceled (rolled back) to synchronize the DBMS and the application program. Reference: 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 after the application program sends the commit request and before the commit completion notification is received, the application program cannot confirm that the actual update has been executed. .. Therefore, it is necessary to confirm the data update after the failure recovery and synchronize the DBMS side and the application program side.

【0004】しかし、現状のDBMSでは、トランザク
ションの完了確認をアプリケーション・プログラムから
確認することができるDBMSと、できないDBMSと
が混在している。図3に市販DBMSにおけるトランザ
クション完了確認方法をしめす。トランザクション完了
確認を行う機能を持たないDBMSにおいてはトランザ
クションの保障を十分に行うことができないため、信頼
性のあるシステムを構築することができないという問題
点がある。また、様々な種類のDBMSを利用したネッ
トワーク環境を構築しようと試みたとき、共通の方法で
アプリケーション・プログラムとDBMSの同期をとる
ことができず、データベースアクセスのためのアプリケ
ーション・プログラムのポータビリティ向上の妨げとな
っている。
However, in the current DBMS, some DBMS are capable of confirming the transaction completion confirmation from the application program and some are not. FIG. 3 shows a transaction completion confirmation method in a commercial DBMS. In a DBMS that does not have the function of confirming the transaction completion, the transaction cannot be sufficiently guaranteed, so that there is a problem that a reliable system cannot be constructed. Also, when attempting to build a network environment using various types of DBMS, it is not possible to synchronize the application program and the DBMS by a common method, which improves the portability of the application program for database access. It is an obstacle.

【0005】[0005]

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

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

【0007】[0007]

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

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

【0009】アプリケーション・プログラムからコミッ
トの要求が出される(S5)と,各アプリケーション・
プログラム毎にデータベース内に用意されたトランザク
ション・ログ・テーブルにトランザクション識別子を書
き込み(S6)。コミット要求でなければデータ参照・
データ操作実行が行われる(S7)。トランザクション
・ログ・テーブルへの書き込み処理が終了した後,改め
てDBMSに対してコミット要求を行う(S8)。そし
て、処理終了か否かが調べられる(S9)。
When a commit request is issued from the application program (S5), each application
The transaction identifier is written in the transaction log table prepared in the database for each program (S6). Data reference if not a commit request
Data operation is executed (S7). After the writing process to the transaction log table is completed, a commit request is again made 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 completion of the transaction (after the completion of the commit), the contents of the transaction log table are stored in the DBMS. Information such as transaction identifiers remains in the table because it is guaranteed by. Therefore, the contents of the memory and the contents of the transaction log table match.

【0011】これに対して、トランザクション完了前に
障害が生じた場合にはそれらの情報はロールバック処理
よって失われる。したがって、メモリの内容とトランザ
クション・ログ・テーブルとの内容に不一致が生じる。
On the other hand, when a failure occurs before the completion of the transaction, the information is lost by the rollback process. Therefore, there is a discrepancy 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 it is realized by using only the basic function of the DBMS, that is, the function of generating and writing the table in the database, various D
Applicable to BMS.

【0014】[0014]

【実施例】図1は本発明の一実施例構成図を示す。アプ
リケーション・プログラム1は線12を通して制御装置
3にデータ更新のためのSQL文を送出する。制御装置
3は送られてきたSQL文が、前回のコミット後の最初
のSQL文であるか、2番目以降のSQL文であるか、
コミット要求文であるかを判定する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows a block diagram of an embodiment of the present invention. The application program 1 sends a SQL statement for updating data to the control device 3 through the line 12. The control device 3 determines whether the sent SQL statement is the first SQL statement after the previous commit or the second and subsequent SQL statements.
Determine if it 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 uses the line 1
A transaction start notification is sent to the transaction identifier generation device 4 through D4 and D is sent through line 16.
The SQL sentence is sent to the BMS 7.

【0016】トランザクション識別子生成装置4は線1
3を通してメモリ2に格納されているトランザクション
識別子の履歴を参照し,開始トランザクションに識別子
を付与し、線13を通してトランザクション識別子をメ
モリ2に書き込み。
The transaction identifier generator 4 is line 1
The transaction identifier history stored in the memory 2 is referenced 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 the SQL statement to DBMS 7 via line 16.
The DBMS 7 receiving 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 the commit request statement, the control device 3 uses the line 1
Transaction commitment controller 5 through 5
Commit request notification to. Upon receiving the request, the transaction commitment control device 5 refers to the transaction identifier through the line 18 and the DBM through the line 19.
The SQL sentence is sent to S7. DB that received the SQL statement
The MS 7 writes the transaction identifier to the transaction log table 10 via 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, which has received the write end signal, sends a commit request to the DBMS 7 through the line 19. D that received the commit request
The BMS 7 executes the commit to the database 8 through the lines 21 and 22.

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

【0020】データベースアクセス処理中断後,処理再
開時にアプリケーション・プログラム1は線11を通し
てメモリ2を参照し,アプリケーション・プログラム1
が送出したトランザクションのトランザクション識別子
の情報を得る。
After the database access process is interrupted, the application program 1 refers to the memory 2 through the line 11 when the process is restarted, and the application program 1
Gets the transaction identifier information 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 confirmation request of the completed transaction to the control device 3 through the line 12. When the control device 3 receives the confirmation request for the completed transaction, it sends a request for searching the transaction log table 10 to the confirmation device 6 through 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 through the line 20. When the DBMS 7 receives the request for searching the transaction log table 10, the DBMS 7 inspects the transaction log table 10 through the line 22 and notifies the confirmation device 6 of the search result through the line 20. The confirmation device 6 sends the transaction identifier of the completed transaction from the search result to the control device 3 through the line 17. 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
When a failure occurs after the transaction identifier generation device 4 writes the transaction identifier in the memory 2 and before the DBMS 7 writes the transaction identifier in the transaction log table 10, the transaction identifier stored in the memory 2 and the transaction log -If the transaction identifier is different from that stored in the table 10 and a failure occurs in any other state, the result is that they match.

【0023】[0023]

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

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

【図1】アプリケーション・プログラムとDBMSの同
期確認方式の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a synchronization confirmation system of 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 commercial DBMS.

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

1 アプリケーション・プログラム 2 メモリ 3 制御装置 4 トランザクション識別子生成装置 5 トランザクションコミットメント制御装置 6 確認装置 7 DBMS 8 データベース 9 ユーザ・テーブル 10 トランザクション・ログ・テーブル 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)

【特許請求の範囲】 【請求項1】 複数の種類のデータベースに対して,ア
プリケーション・プログラムとデータベース管理システ
ム(DBMS)との同期確認を行う方式であって、 アプリケーション・プログラムからの要求がトランザク
ション開始要求であることを認識し、トランザクション
の識別子を付与し、保持する機能と、 アプリケーション・プログラムからの要求がトランザク
ション終了要求であることを識別し、保持していたトラ
ンザクション識別子をDBMS配下に存在するトランザ
クション・ログ・テーブルに記録する機能と、 保持されているトランザクション識別子とトランザクシ
ョン・ログ・テーブルとをアプリケーション・プログラ
ムから参照可能とする機能とを持ち、 トランザクション開始時にトランザクション識別子をメ
モリ内に保持し、 トランザクション終了時にメモリ内のトランザクション
識別子をトランザクション・ログ・テーブルに記録し、 トランザクション処理中に処理を中断した場合に、アプ
リケーション・プログラムから、保持されているトラン
ザクション識別子とトランザクション・ログ・テーブル
に格納されている識別子とを参照し、 参照された識別子が異なる場合には処理を中断した時点
で行っていたトランザクションを再実行し、 参照された識別子が同じ場合には処理を中断した時点で
行っていたトランザクションの次のトランザクションか
ら処理を再開することにより、 アプリケーション・プログラムの再開時における開始ト
ランザクションを確認することを特徴とするデータベー
ス・アクセスのための同期確認処理方式。
What is claimed is: 1. A method for confirming synchronization between an application program and a database management system (DBMS) for a plurality of types of databases, wherein a request from the application program starts a transaction. A function that recognizes a request, assigns a transaction identifier, and retains it, and identifies that the request from the application program is a transaction end request, and retains the transaction identifier under the DBMS. -A function that records in the log table and a function that allows the application program to refer to the held transaction identifier and transaction log table. If the identifier is retained in memory, the transaction identifier in memory is recorded in the transaction log table at the end of the transaction, and if the transaction is interrupted during transaction processing, the transaction identifier retained by the application program Refer to the identifier stored in the transaction log table. If the referenced identifier is different, re-execute the transaction that was being performed when the processing was interrupted. If the referenced identifier is the same, process it. Confirmation processing method for database access characterized by confirming the starting transaction when the application program is restarted by restarting the processing from the transaction next to the transaction that was being performed at the time when the transaction was suspended .
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 true JPH0520150A (en) 1993-01-29
JP3253321B2 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
JP3253321B2 (en) 2002-02-04

Similar Documents

Publication Publication Date Title
US7565572B2 (en) Method for rolling back from snapshot with log
JP3822381B2 (en) Distributed database system failure recovery method
US5884328A (en) System and method for sychronizing a large database and its replica
JP3779263B2 (en) Conflict resolution for collaborative work systems
EP2790112A1 (en) Method and system for data synchronization and data access apparatus
CA3121919A1 (en) System and method for augmenting database applications with blockchain technology
JP4291060B2 (en) Transaction processing method, transaction control device, and transaction control program
US5734896A (en) Recovery of a remotely initiated distributed prepared transaction by status report from a second database to an external coordinator
JPH06348628A (en) Intelligent network system
JP2000099359A (en) Restoration in multicomputer system
US7194675B2 (en) Backup method, backup system, disk controller and backup program
JPH0561748A (en) System for automating synchronous confirmation in database access
JPH0520150A (en) Synchronization confirmation processing system for data base access
CN109522098A (en) Transaction methods, device, system and storage medium in distributed data base
JPH06119227A (en) Distributed data base control system
JPH0430220A (en) Maintenance system for software
JPH04105159A (en) Work substitute system
JP4604666B2 (en) I / O target change control method
CN115700489A (en) Emergency switching method and device, electronic equipment and storage medium
JPS6167153A (en) Partial trouble recovery processing system of direct access storage device
CN117807161A (en) Compensation transaction realization method for distributed database
JPH06139208A (en) Shared data control system
JPH1091478A (en) Agent managing method
CN118093251A (en) Fault processing method and device, electronic equipment and storage medium
JPH01196646A (en) Memory back-up system

Legal Events

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