JP2623968B2 - Commit synchronization control method for journalless files - Google Patents

Commit synchronization control method for journalless files

Info

Publication number
JP2623968B2
JP2623968B2 JP2327948A JP32794890A JP2623968B2 JP 2623968 B2 JP2623968 B2 JP 2623968B2 JP 2327948 A JP2327948 A JP 2327948A JP 32794890 A JP32794890 A JP 32794890A JP 2623968 B2 JP2623968 B2 JP 2623968B2
Authority
JP
Japan
Prior art keywords
file
journalless
commit
database
rollback
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 - Lifetime
Application number
JP2327948A
Other languages
Japanese (ja)
Other versions
JPH04195558A (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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2327948A priority Critical patent/JP2623968B2/en
Publication of JPH04195558A publication Critical patent/JPH04195558A/en
Application granted granted Critical
Publication of JP2623968B2 publication Critical patent/JP2623968B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はジャーナルレスファイルのコミット同期制御
方式に関し、特にデータベースファイルを処理するプロ
グラムで、ジャーナルを持たない更新用トランザクショ
ンファイルや編集用一時ファイル等を使用している場合
のコミット同期制御方式に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a journal-less file commit synchronization control method, and more particularly to a program for processing a database file, such as an update transaction file or a temporary editing file without a journal. Commit synchronization control method when using

〔従来の技術〕[Conventional technology]

従来より、データベースファイル上のレコードを更新
したり、データベースファイルにレコードを追加したり
する場合には、1つのトランザクションで処理されるレ
コードの入出力が全て完了した後で、データベースファ
イルに更新または追加されたレコードの実出力を行わな
ければ、データ更新に矛盾を生じることがある。
Conventionally, when updating a record in a database file or adding a record to a database file, the update or addition to the database file is performed after all input / output of records processed in one transaction is completed. If the actual record is not output, inconsistency may occur in data update.

このため、一般に、データベースシステムにおいてレ
コードの更新または追加を行う場合には、データベース
ファイルから読み出されて更新されたレコードや追加さ
れたレコードをジャーナルファイルに一旦書き出してお
き、トランザクションで処理されるレコードの入出力が
全て完了した時点でデータベースファイルのレコードを
一括して実更新する方式がとられている。
For this reason, in general, when updating or adding records in a database system, records that have been read from a database file and that have been updated or added are temporarily written to a journal file, and records that are processed in a transaction. A method is adopted in which the records of the database file are collectively updated at the time when all of the input / output operations are completed.

また、このようなデータベースシステムでは、更新さ
れるレコードが複数の利用者により同時利用されるとデ
ータの一貫性が保てなくなる恐れがあるので、データベ
ースファイルのレコードのロック管理を行うコミットメ
ント制御方式が採用されている。
In such a database system, if a record to be updated is used by a plurality of users at the same time, data consistency may not be maintained. Therefore, a commitment control method for managing locks of records in a database file is used. Has been adopted.

このため、従来のデータベースシステムの処理プログ
ラムには、データベースファイルを一括更新するため
に、データベースファイルの実更新を行い全てのレコー
ドロックを解放するとともに、データベースファイルの
静止点を確立するコミット命令や、直前の静止点以降に
実行されたデータベースファイルへの更新要求を無効に
するとともに、データベースファイルの状態を直前の静
止点に戻すロールバック命令が用意されている。
For this reason, in the processing program of the conventional database system, in order to update the database file in a batch, a commit command to update the database file and release all record locks and to establish a quiesce point of the database file, A rollback command is provided that invalidates the update request to the database file executed after the immediately preceding still point and returns the state of the database file to the immediately preceding still point.

このようなデータベースシステムにおける処理プログ
ラムは、その入力ファイルや出力ファイルとしてジャー
ナルを持たないファイル(ジャーナルレスファイル)を
使用する場合がある。
A processing program in such a database system may use a file having no journal (journalless file) as its input file or output file.

しかし、従来のデータベースシステムでは、ジャーナ
ルレスファイルを入力ファイルとして使用する場合、デ
ータベースファイルに対するコミット命令時にジャーナ
ルレスファイルの現在指示子を退避する手段や、ロール
バック命令時にコミット命令時に退避した現在指示子を
使って、ジャーナルレスファイルの現在指示子を復元す
る手段がなかった。
However, in a conventional database system, when a journalless file is used as an input file, a means for saving the current indicator of the journalless file at the time of a commit command for the database file, or a current indicator saved at the time of the commit command at the time of a rollback command There was no way to restore the current indicator of a journalless file using.

さらに、ジャーナルレスファイルを出力ファイルとし
て使用する場合、コミット命令時に出力レコードを一括
実出力する手段や、ロールバック命令時に一旦出力され
たレコードを無効にする手段が設けられていなかった。
Further, when a journalless file is used as an output file, there is no means for outputting the output records in a batch at the time of a commit command, and no means for invalidating the records once output at the time of a rollback command.

従って、データベースファイルへの更新要求を無効に
するロールバック命令が実行されてデータベースファイ
ルが直前の静止点に戻っても、ジャーナルレスファイル
にはファイル現在指示子が戻されない為、入力モードの
ジャーナルレスファイルの場合には、データベースを直
前の静止点から再実行するとき、レコードの処理抜けが
発生することとなっていた。
Therefore, even if a rollback command that invalidates the update request to the database file is executed and the database file returns to the previous quiesce point, the file current indicator is not returned to the journalless file. In the case of a file, when the database is re-executed from the immediately preceding still point, record processing omission would occur.

一方、出力モードのジャーナルレスファイルにおいて
も、データベースファイルの内容がロールバック命令に
より直前の静止点の状態に戻されるのに対し、ジャーナ
ルレスファイルの内容は直前の静止点の状態に戻されな
いので、データベースファイルの内容との間に矛盾が発
生することとなっていた。
On the other hand, in the journalless file in the output mode, the contents of the database file are returned to the state of the previous quiesce point by the rollback instruction, whereas the contents of the journalless file are not returned to the state of the previous quiesce point. There was a conflict with the contents of the database file.

このため、入力モードのジャーナルレスファイルに関
しては、処理プログラムによりコミット命令時にジャー
ナルレスファイルの現在指示子をユーザが自分で退避
し、ロールバック命令時には先に退避したファイルの現
在指示子を使ってジャーナルレスファイルを位置付けし
直す方法等が試みられていた。
For this reason, for a journalless file in the input mode, the user saves the current indicator of the journalless file by the processing program by himself / herself at the time of the commit instruction, and uses the current indicator of the file saved earlier at the time of the rollback instruction. A method of repositioning the address file has been attempted.

また、出力モードのジャーナルレスファイルに関して
も、処理プログラムによりコミット命令からコミット命
令までの間に出力要求されたレコードを一旦保存し、コ
ミット命令成功後、保存したレコードを一括実出力する
方法等が試みられていた。
Regarding the journalless file in the output mode, a method of temporarily storing records requested to be output between commit commands by a processing program and then outputting the stored records collectively after a successful commit command has been attempted. Had been.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

上述した従来のデータベースシステムでは、コミット
命令やロールバック命令は、ジャーナルを有するデータ
ベースファイルに対しては同期更新を保証しているが、
ジャーナルを持たないファイルや持てないファイル(フ
ロッピィディスク、磁気テープファイル等)に対して
は、ファイル現在指示子の退避/復元や、出力レコード
を無効とすることができなかった。
In the conventional database system described above, the commit command and the rollback command guarantee synchronous update for a database file having a journal.
For files that do not have a journal or for files that do not have a journal (floppy disk, magnetic tape file, etc.), it was not possible to save / restore the file current indicator or invalidate the output record.

このため、入力モードのジャーナルレスファイルでは
レコードの処理抜けが発生し、出力モードのジャーナル
レスファイルでは、データベースファイルとジャーナル
レスファイルとの内容に矛盾が生じるという欠点があっ
た。
For this reason, in the journalless file in the input mode, record processing is lost, and in the journalless file in the output mode, the contents of the database file and the journalless file are inconsistent.

さらに、これらの欠点を未然に回避するように処理プ
ログラムを作成するためには、プログラマは、コミット
命令の間にジャーナルレスファイルの入出力を含めない
ようにプログラミング上で配慮しなければならず、プロ
グラムの生産性を低下させる原因の1つとなっていると
いう欠点もある。
Furthermore, in order to create a processing program to avoid these disadvantages, the programmer must take care in programming not to include journalless file I / O between commit instructions. There is also a drawback that it is one of the causes for reducing the productivity of the program.

また、処理プログラムである程度対応しても、ジャー
ナルレスファイルの現在指示子の退避等は、ユーザが手
操作で行わなければならず、操作者に負担を掛けるとい
う欠点もある。
Further, even if the processing program can cope with it to some extent, there is a drawback that the user must manually save the current indicator of the journalless file, which places a burden on the operator.

本発明の目的は、上述の点に鑑み、データベースファ
イルの更新時にジャーナルレスファイルの同期更新を行
うことができ、データの信頼性の向上および操作やプロ
グラム作成の省力化を図ることができるジャーナルレス
ファイルのコミット同期制御方式を提供することにあ
る。
SUMMARY OF THE INVENTION In view of the above, it is an object of the present invention to be able to perform synchronous update of a journalless file when updating a database file, to improve data reliability and to save labor in operations and program creation. An object of the present invention is to provide a file synchronization control method.

〔課題を解決するための手段〕[Means for solving the problem]

本発明のジャーナルレスファイルのコミット同期制御
方式は、所定の処理プログラムで処理されるデータベー
スファイルと、当該データベースファイルの実更新およ
びレコードロックの解放を行い前記データベースファイ
ルの静止点を確立するコミット命令と、前記データベー
スファイルの直前の静止点以降のデータ更新を無効とし
前記データベースファイルの静止点を確立するロックバ
ック命令とを含みレコードのロック管理を行うコミット
メント制御方式に対応するジャーナルレスファイルのコ
ミット同期制御方式であって、前記コミット命令の実行
時に、ジャーナルレスファイルのレコードの位置を示す
ファイル現在指示子を退避するとともに、前記ジャーナ
ルレスファイルが出力モードの場合にはレコードの実出
力を行い、前記ジャーナルレスファイルの静止点を確立
するジャーナルレスファイルコミット制御手段と、前記
ロールバック命令の実行時に、前記ジャーナルレスファ
イルの現在指示子を直前のコミット命令実行時点に戻す
とともに、前記ジャーナルレスファイルが出力モードの
場合には直前のコミット命令実行以降に出力したレコー
ドを無効とし、前記ジャーナルレスファイルの静止点を
確立するジャーナルレスファイルロールバック手段と、
前記処理プログラムから前記ジャーナルレスファイルコ
ミット制御手段を呼び出すジャーナルレスファイルコミ
ット制御呼出手段と、前記処理プログラムから前記ジャ
ーナルレスファイルロールバック制御手段を呼び出すジ
ャーナルレスファイルロールバック制御呼出手段とを有
している。
A journalless file commit synchronization control method according to the present invention includes a database file processed by a predetermined processing program, a commit command for performing an actual update of the database file and releasing a record lock to establish a quiesce point of the database file. A lock-back instruction for invalidating data update after the quiesce point immediately before the database file and establishing a quiesce point of the database file, and a commit synchronization control of a journalless file corresponding to a commitment control method for managing a record lock. When the commit command is executed, a file current indicator indicating the position of a record in the journalless file is saved, and when the journalless file is in the output mode, the record is actually output, and the journal is output. A journalless file commit control means for establishing a quiesce point of the nullless file, and when the rollback instruction is executed, the current indicator of the journalless file is returned to the immediately preceding commit instruction execution time, and the journalless file is output. In the case of the mode, journalless file rollback means for invalidating records output since the immediately preceding commit instruction execution and establishing a quiesce point of the journalless file,
A journalless file commit control calling unit that calls the journalless file commit control unit from the processing program; and a journalless file rollback control calling unit that calls the journalless file rollback control unit from the processing program. .

〔作用〕[Action]

このような本発明においては、データベースファイル
のコミット命令実行時に、ジャーナルレスファイルコミ
ット制御呼出手段によりジャーナルレスファイルコミッ
ト制御手段が起動され、このジャーナルレスファイルコ
ミット制御手段により、ジャーナルレスファイルに対し
それが入力モードであればファイル現在指示子を退避
し、出力モードであれば更に直前のコミット命令以降に
ジャーナルレスファイルから出力されたレコードを有効
とすることにより、ジャーナルレスファイルのコミット
制御が行われ、データベースファイルと同期してジャー
ナルレスファイルの静止点が確立される。
In the present invention, when the commit command for the database file is executed, the journalless file commit control means is activated by the journalless file commit control calling means, and the journalless file commit control means applies the command to the journalless file. In the input mode, the file current indicator is saved, and in the output mode, commit control of the journalless file is performed by validating records output from the journalless file after the immediately preceding commit instruction, A quiesce point for a journalless file is established in synchronization with the database file.

また、データベースファイルのロールバック命令実行
時には、ジャーナルレスファイルロールバック制御呼出
手段によりジャーナルレスファイルロールバック制御手
段が起動され、このジャーナルレスファイルロールバッ
ク制御手段により、ジャーナルレスファイルに対しそれ
が入力モードであればファイル現在指示子を直前のコミ
ット命令時に退避したファイル現在指示子で復元し、出
力モードであれば更に直前のコミット命令以降に出力し
たレコードを無効とすることにより、ジャーナルレスフ
ァイルのロールバック制御が行われ、データベースファ
イルと同期して直前のコミット命令時点にジャーナルレ
スファイルの静止点が復元される。
When a database file rollback instruction is executed, the journalless file rollback control calling means activates the journalless file rollback control means, and the journalless file rollback control means causes the journalless file to enter its input mode. If this is the case, the file current indicator is restored using the file current indicator saved at the time of the immediately preceding commit command, and in the output mode, the records output after the immediately preceding commit command are invalidated, thereby rolling the journalless file. Back control is performed, and the quiesce point of the journalless file is restored at the time of the immediately preceding commit instruction in synchronization with the database file.

このため、ジャーナルレスファイルの静止点およびレ
コードは常にデータベースファイルと一致され、データ
ベースファイルのコミット命令、ロールバック命令時の
レコードの処理抜けや内容の矛盾が回避されるので、デ
ータの信頼性の向上が図られるとともに、プログラム上
の制約や操作時の煩雑さも解消されて前述の目的が達成
される。
For this reason, the quiesce point and record of the journalless file are always matched with the database file, avoiding record processing omission and content inconsistency at the time of commit command and rollback command of the database file, thereby improving data reliability. As a result, the above-mentioned object is achieved by eliminating restrictions on programs and complexity at the time of operation.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be described with reference to the drawings.

第1図は、本発明のジャーナルレスファイルのコミッ
ト同期制御方式の一実施例の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing the configuration of an embodiment of a journalless file commit synchronization control method according to the present invention.

利用者プログラム1は、データベースファイル14を処
理するものであり、コミット命令およびロールバック命
令を行うためのコミット命令モジュール2およびロール
バック命令モジュール5を備えている。
The user program 1 processes the database file 14, and includes a commit command module 2 and a rollback command module 5 for executing a commit command and a rollback command.

コミット命令モジュール2は、データベースコミット
制御呼出手段3を備え、このデータベースコミット制御
呼出手段3により起動されるデータベースコミット制御
手段8によりデータベースファイル14のコミット制御が
行われる。
The commit command module 2 includes a database commit control calling unit 3, and the database file control unit 8 started by the database commit control calling unit 3 controls the commit of the database file 14.

ロールバック命令モジュール5は、データベースロー
ルバック制御呼出手段6を備え、このデータベースロー
ルバック制御呼出手段6により起動されるデータベース
ロールバック制御手段9によりデータベースファイル14
のロールバック制御が行われる。
The rollback command module 5 includes a database rollback control calling unit 6. The database file 14 is controlled by the database rollback control unit 9 started by the database rollback control calling unit 6.
Rollback control is performed.

ここで、データベースファイル14のコミット制御およ
びロールバック制御は、実行記録等が記憶されるジャー
ナルファイル14Aを用いて行われる。また、利用者プロ
グラム1によるデータベースファイル14の処理には、従
来ファイル15(ジャーナルを持たないファイル)が用い
られ、この従来ファイル15は、従来ファイル15の現在指
示子CPTR等のデータを備えるファイル管理テーブル12
と、利用者プログラム1とのレコードの入出力に使用さ
れる入出力バッファ13を備えている。
Here, the commit control and the rollback control of the database file 14 are performed using the journal file 14A in which execution records and the like are stored. Further, the conventional file 15 (a file having no journal) is used for processing the database file 14 by the user program 1, and the conventional file 15 is a file management system including data such as the current indicator CPTR of the conventional file 15. Table 12
And an input / output buffer 13 used for inputting and outputting records to and from the user program 1.

一方、本実施例の利用者プログラム1は、本発明のジ
ャーナルレスファイルのコミット同期制御方式を採用し
たものであり、コミット命令モジュール2は、データベ
ースコミット制御呼出手段3の他に従来ファイルコミッ
ト制御呼出手段4を備え、ロールバック命令モジュール
5は、データベースロールバック制御呼出手段6の他に
従来ファイルロールバック制御呼出手段7を備えてい
る。
On the other hand, the user program 1 of this embodiment adopts the journal-less file commit synchronization control method of the present invention. The rollback instruction module 5 includes a conventional file rollback control calling unit 7 in addition to the database rollback control calling unit 6.

従来ファイルコミット制御呼出手段4は、従来ファイ
ルコミット制御手段10を起動して、従来ファイル15のコ
ミット制御をデータベースファイル14のコミット制御に
同期して行わせ、従来ファイルロールバック制御呼出手
段7は、従来ファイルロールバック制御手段11を起動し
て、従来ファイル15のロールバック制御をデータベース
ファイル14のロールバック制御に同期して行わせるもの
である。
The conventional file commit control calling means 4 activates the conventional file commit control means 10 to cause the conventional file 15 to perform commit control in synchronization with the commit control of the database file 14, and the conventional file rollback control calling means 7 The conventional file rollback control means 11 is started, and the rollback control of the conventional file 15 is performed in synchronization with the rollback control of the database file 14.

また、データベースファイル14は、ボリューム(Vo
l)#1に配置され、従来ファイル15はボリューム(Vo
l)#2に配置されており、ボリューム#2にはボリュ
ーム目録17が設けられ、さらにファイル管理テーブル12
や入出力バッファ13のデータ等が退避されるセーブエリ
ア16が設けられている。
Further, the database file 14 stores the volume (Vo
l) It is located in # 1 and the conventional file 15 is the volume (Vo
l) Volume # 2 has a volume list 17 provided in volume # 2, and further has a file management table 12
And a save area 16 for saving data of the input / output buffer 13 and the like.

次に、このように構成された本実施例の動作につい
て、従来ファイル15が入力モードである場合と出力モー
ドである場合に分けて説明する。
Next, the operation of the present embodiment thus configured will be described separately for the case where the conventional file 15 is in the input mode and the case where the conventional file 15 is in the output mode.

まず、従来ファイル15が利用者プログラム1から読み
出される入力モードで使用される場合について説明す
る。
First, the case where the conventional file 15 is used in the input mode read from the user program 1 will be described.

利用者プログラム1でコミット命令が実行されると、
データベースコミット制御呼出手段3によりデータベー
スコミット制御手段8が呼び出される。
When the commit command is executed in the user program 1,
The database commit control calling means 3 calls the database commit control means 8.

データベースコミット制御手段8は、データベースフ
ァイル14の実更新および全てのレコードロックの解放を
行い、ジャーナルファイル14AにジャーナルJNLを出力す
ることによりデータベースファイル14の静止点を確立す
る。
The database commit control unit 8 updates the database file 14 and releases all record locks, and outputs a journal JNL to the journal file 14A to establish a quiesce point of the database file 14.

同時に、コミット命令モジュール2の従来ファイルコ
ミット制御呼出手段4により、従来ファイルコミット制
御手段10が呼び出されて制御を渡される。
At the same time, the conventional file commit control calling means 4 of the commit command module 2 calls the conventional file commit control means 10 and passes control.

従来ファイルコミット制御手段10は、入出力バッファ
13の内容CBUFと、ファイル管理テーブル12の内容CTBLを
セーブエリア16に退避する。これによりファイル管理テ
ーブル12の中に記録されている従来ファイル15の現在指
示子CPTRも退避される。
Conventional file commit control means 10
The content CBUF 13 and the content CTBL of the file management table 12 are saved in the save area 16. As a result, the current indicator CPTR of the conventional file 15 recorded in the file management table 12 is also saved.

ここで、利用者プログラム1でロールバック命令が実
行されると、データベースロールバック制御呼出手段6
によりデータベースロールバック制御手段9が呼び出さ
れる。
Here, when the user program 1 executes the rollback command, the database rollback control calling means 6
Causes the database rollback control means 9 to be called.

データベースロールバック制御手段9は、データベー
スファイル14の直前の静止点以降のデータ更新を無効と
し、ジャーナルファイル14AのジャーナルJNLに基づいて
データベースファイル14を復元することによりデータベ
ースファイル14の静止点を確立する。
The database rollback control means 9 establishes the quiesce point of the database file 14 by invalidating the data update after the quiesce point immediately before the database file 14 and restoring the database file 14 based on the journal JNL of the journal file 14A. .

同時に、ロールバック命令モジュール5の従来ファイ
ルロールバック制御呼出手段7により、従来ファイルロ
ールバック制御手段11が呼び出されて制御が渡される。
At the same time, the conventional file rollback control calling unit 7 of the rollback instruction module 5 calls the conventional file rollback control unit 11 and passes control.

従来ファイルロールバック制御手段11は、セーブエリ
ア16に退避されたファイル管理テーブル12の内容CTBLと
入出力バッファ13の内容CBUFとを、ファイル管理テーブ
ル12と入出力バッファ13とにそれぞれ復元する。
The conventional file rollback control unit 11 restores the content CTBL of the file management table 12 saved in the save area 16 and the content CBUF of the input / output buffer 13 to the file management table 12 and the input / output buffer 13, respectively.

従って、ファイル管理テーブル12および入出力バッフ
ァ13は直前のコミット命令実行時の状態に復元される。
Therefore, the file management table 12 and the input / output buffer 13 are restored to the state at the time of executing the immediately preceding commit instruction.

ロールバック命令の次に、従来ファイル15に対して入
力要求を行うと、直前のコミット命令で退避された従来
ファイル15の現在指示子CPTRが指すレコードの次のレコ
ードが入力される。すなわち、直前のコミット命令を実
行した後で、利用者プログラム1から従来ファイル15に
対して実行された入力命令により変更された従来ファイ
ル15の現在指示子CPTRは、常にコミット命令実行時の状
態に戻される。
When an input request is made to the conventional file 15 after the rollback instruction, the record next to the record indicated by the current indicator CPTR of the conventional file 15 saved by the immediately preceding commit instruction is input. That is, after executing the immediately preceding commit command, the current indicator CPTR of the conventional file 15 changed by the input command executed from the user program 1 to the conventional file 15 is always in the state at the time of execution of the commit command. Will be returned.

このような従来ファイル15が入力モードの場合の、従
来ファイルコミット制御手段10および従来ファイルロー
ルバック制御手段11における処理をより具体的に説明す
る。
The processing in the conventional file commit control means 10 and the conventional file rollback control means 11 when such a conventional file 15 is in the input mode will be described more specifically.

第2図に示すように、入出力バッファ13は、4つのレ
コード領域13A,13B,13C,13Dを有して4つのレコードを
各々格納できるようになっており、従来ファイル15から
レコードを読み出す際は、1ブロックつまり4個のレコ
ードが1度に取り出されるようになっている。一方、利
用者プログラム1からの1回の入力命令では、レコード
領域13A,13B,13C,13Dに格納された各レコードがこの順
序で1つずつ取り出されるようになっている。
As shown in FIG. 2, the input / output buffer 13 has four record areas 13A, 13B, 13C, and 13D and can store four records, respectively. Is designed so that one block, that is, four records, is fetched at a time. On the other hand, with one input command from the user program 1, each record stored in the record areas 13A, 13B, 13C, and 13D is fetched one by one in this order.

今、入力レコード#3の処理が完了した時点で、利用
者プログラム1のコミット命令が実行されたとする。こ
の際、入出力バッファ13のレコード領域13A〜13Dには、
入力レコード#1〜#4が各々格納されている。
Now, it is assumed that the commit command of the user program 1 is executed at the time when the processing of the input record # 3 is completed. At this time, in the record areas 13A to 13D of the input / output buffer 13,
Input records # 1 to # 4 are stored respectively.

ここで、コミット命令に応じて起動される従来ファイ
ルコミット制御手段10は、入出力バッファ13の内容CBUF
とファイル管理テーブル12の内容CTBL(ファイル現在指
示子CPTRはレコード#3を示している)をセーブエリア
16に退避する。
Here, the conventional file commit control means 10 started in response to the commit command is the content CBUF of the input / output buffer 13.
And the contents CTBL of the file management table 12 (the file current indicator CPTR indicates record # 3) in the save area
Evacuate to 16.

この状態で利用者プログラム1が従来ファイル15に入
力要求を行うと、入出力バッファ13内のレコード領域13
Dに読み込まれているレコード#4の内容が利用者プロ
グラム1に渡される。更に入力要求を行うと、従来ファ
イル15のブロックB2すなわち入力レコード#5〜#8が
入出力バッファ13の各レコード領域13A〜13Dに各々格納
され、入力要求に対応するものとしてレコード領域13A
のレコード#5が利用者プログラム1に渡される。
When the user program 1 makes an input request to the conventional file 15 in this state, the record area 13 in the input / output buffer 13
The content of the record # 4 read into D is passed to the user program 1. Further, when an input request is made, the block B2 of the conventional file 15, that is, the input records # 5 to # 8 are stored in the record areas 13A to 13D of the input / output buffer 13, respectively.
Record # 5 is passed to the user program 1.

今、入力レコード#7を処理中にデータベースファイ
ル14にデッドロック等が発生し、利用者プログラム1か
らロールバック命令が出されたとすると、データベース
ロールバック制御手段9が呼び出されてデータベースフ
ァイル14のロールバック制御が行われる。
If a deadlock or the like occurs in the database file 14 while processing the input record # 7 and a rollback command is issued from the user program 1, the database rollback control means 9 is called to roll the database file 14. Back control is performed.

同時に、従来ファイルロールバック制御手段11が呼び
出され、セーブエリア16に保存された直前のコミット命
令時の入出力バッファ13の内容CBUF(レコード#1〜#
4が格納されている)と、従来ファイル15のファイル管
理テーブル12の内容CTBL(現在指示子CPTRはレコード#
3を指している)とで入出力バッファ13およびファイル
管理テーブル12が復元される。
At the same time, the conventional file rollback control means 11 is called, and the contents CBUF of the input / output buffer 13 at the time of the immediately preceding commit instruction stored in the save area 16 (records # 1 to #
4 is stored), and the content CTBL of the file management table 12 of the conventional file 15 (current indicator CPTR is record #
3), the input / output buffer 13 and the file management table 12 are restored.

この後、従来ファイル15に対して入力要求が行われる
と、レコード領域13Dに格納されているレコード#4が
入力されて、直前のコミット命令時の状態に復元され
る。
Thereafter, when an input request is made to the conventional file 15, the record # 4 stored in the record area 13D is input and restored to the state at the time of the immediately preceding commit instruction.

次に、従来ファイル15が利用者プログラム1からの出
力等を書き込むために使用される出力モードである場合
について説明する。
Next, the case where the conventional file 15 is in the output mode used for writing the output from the user program 1 and the like will be described.

第3図にも示すように、出力レコード#3の処理が終
了した時点で、利用者プログラム1内のコミット命令が
実行されると、データベースコミット制御手段8により
データベースファイル14のコミット制御が行われる。
As shown in FIG. 3, when the commit instruction in the user program 1 is executed at the time when the processing of the output record # 3 is completed, the commit control of the database file 14 is performed by the database commit control means 8. .

同時に、従来ファイルコミット制御手段10により、フ
ァイル管理テーブル12の内容CTBLと入出力バッファ13の
内容CBUFとがセーブエリア16に退避されるとともに、入
出力バッファ13の内容CBUFが従来ファイル15に書き出さ
れる。またファイル管理テーブル12に記録されている従
来ファイル15の現在指示子CPTRのブロックアドレスCBLK
も、従来ファイル15が割り付けられたボリューム#2の
ボリューム目録17に保存される。
At the same time, the content CTBL of the file management table 12 and the content CBUF of the input / output buffer 13 are saved in the save area 16 by the conventional file commit control means 10, and the content CBUF of the input / output buffer 13 is written to the conventional file 15. . Also, the block address CBLK of the current indicator CPTR of the conventional file 15 recorded in the file management table 12
Is also stored in the volume list 17 of volume # 2 to which the conventional file 15 is allocated.

この状態で利用者プログラム1から従来ファイル15に
出力があると、そのレコード#4が入出力バッファ13の
レコード領域13Dに格納される。さらに出力要求がある
と、入出力バッファ13が一杯になっているため、入出力
バッファ13の内容CBUFが従来ファイル15に1ブロック分
として書き込まれる。書き込みにあたっては、直前の従
来ファイルコミット制御手段10によってボリューム目録
17に保存されたブロックアドレスCBLKに基づいて、ブロ
ックB1と同じ位置に書き出される。
When the user program 1 outputs to the conventional file 15 in this state, the record # 4 is stored in the record area 13D of the input / output buffer 13. When there is a further output request, since the input / output buffer 13 is full, the contents CBUF of the input / output buffer 13 are written to the conventional file 15 as one block. When writing, the volume list is taken by the immediately previous conventional file commit control means 10.
Based on the block address CBLK stored in 17, the data is written to the same position as the block B1.

ただし、ボリューム目録17のブロックアドレスCBLKは
変更されていない為、この時点で利用者プログラム1の
異常またはシステムダウン等があっても出力レコード#
3の内容は直前のコミット命令時の書き出しにより保証
されるが、出力レコード#4の内容は出力されていない
ように扱われる。
However, since the block address CBLK of the volume list 17 has not been changed, even if there is an error in the user program 1 or the system goes down at this point, the output record # is output.
3 is guaranteed by writing at the time of the immediately preceding commit instruction, but the content of output record # 4 is treated as not being output.

次に出力レコード#7を出力した時点で、データベー
スファイル14にデッドロック等が発生し、従来ファイル
ロールバック制御手段11が呼び出されたとする。まず最
初にセーブエリア16に保存されたファイル管理テーブル
12の内容CTBLと入出力バッファ13の内容CBUFとで、ファ
イル管理テーブル12および入出力バッファ13がコミット
命令直後の状態に復元される。
Next, it is assumed that when the output record # 7 is output, a deadlock or the like occurs in the database file 14, and the conventional file rollback control unit 11 is called. First, the file management table saved in save area 16
With the contents CTBL of 12 and the contents CBUF of the input / output buffer 13, the file management table 12 and the input / output buffer 13 are restored to the state immediately after the commit instruction.

この後、利用者プログラム1から出力レコード#8が
出力されると、この出力レコード#8は復元された入出
力バッファ13のレコード領域13Dの位置に格納され、次
のレコードの出力時に、入出力バッファ13の内容(出力
レコード#1,#2,#3,#8が入っている)が、従来ファ
イル15のブロックB1に1ブロック分として再度書き込ま
れる。
Thereafter, when the output record # 8 is output from the user program 1, this output record # 8 is stored at the position of the record area 13D of the restored input / output buffer 13, and when the next record is output, the input / output The contents of the buffer 13 (containing the output records # 1, # 2, # 3, and # 8) are written again into the block B1 of the conventional file 15 as one block.

従って直前のコミット命令以後に出力された出力レコ
ード#4,#5,#6,#7はロールバック命令によって無効
にされる。
Therefore, the output records # 4, # 5, # 6, and # 7 output after the immediately preceding commit instruction are invalidated by the rollback instruction.

このような本実施例によれば、従来ファイルコミット
制御手段10、従来ファイルロールバック制御手段11、セ
ーブエリア16およびボリューム目録17等を設けたことに
より、データベースファイル14の静止点の確立に同期し
て、ジャーナルを備えない従来ファイル15の静止点もフ
ァイル管理テーブル12の内容CTBLおよび入出力バッファ
13の内容CBUFがセーブエリア16に退避されることで確立
できる。
According to the present embodiment, by providing the conventional file commit control unit 10, the conventional file rollback control unit 11, the save area 16, the volume list 17, and the like, synchronization with the establishment of the quiesce point of the database file 14 is achieved. The quiesce point of the conventional file 15 without a journal is also the content CTBL and the input / output buffer of the file management table 12.
The contents of 13 can be established by saving the CBUF to the save area 16.

従って、ロールバック命令によってデータベースファ
イル14が直前の静止点の状態に戻る時に、従来ファイル
15もセーブエリア16に退避したファイル管理テーブル12
の内容CTBLや入出力バッファ13の内容CBUFを復元するこ
とで直前の静止点の状態に戻すことができる。
Therefore, when the database file 14 returns to the state of the previous stationary point by the rollback command, the conventional file
15 also saves file management table 12 saved in save area 16
By restoring the content CTBL of the I / O buffer 13 and the content CBUF of the input / output buffer 13, it is possible to return to the state of the previous stationary point.

よって、従来ファイル15が入力モードの場合には、レ
コードの処理抜けを防ぐことができ、出力モードの場合
は、コミット命令以降の出力レコードがデータベースフ
ァイル14と同様に無効になるので、データベースファイ
ル14および従来ファイル15の内容に矛盾が生じることが
ない。
Therefore, when the conventional file 15 is in the input mode, it is possible to prevent omission of record processing. In the output mode, since the output records after the commit instruction become invalid as in the database file 14, the database file 14 is invalidated. There is no inconsistency in the contents of the conventional file 15.

従来ファイル15に対するこれらの動作は、従来ファイ
ルコミット制御手段10および従来ファイルロールバック
制御手段11等を設けることにより自動的に行われるの
で、利用者プログラム1等を作成するプログラマが、コ
ミット命令間に従来ファイル15の入出力を含めないよう
に配慮する必要もなく、プログラムの生産性を向上でき
る。
These operations on the conventional file 15 are automatically performed by providing the conventional file commit control means 10 and the conventional file rollback control means 11, etc., so that the programmer who creates the user program 1 etc. There is no need to consider not including the input and output of the conventional file 15, and the productivity of the program can be improved.

コミット命令時に、セーブエリア16に退避するデータ
等は、ファイル管理テーブル12の内容CTBLおよび4つの
レコード領域13A〜13Dを有する入出力バッファ13の内容
CBUFだけでよいので、ジャーナルファイル14Aに比べて
も小さな記憶領域を設けるだけでよく、特にジャーナル
ファイルを持てないフロッピィディスク等のファイルで
あっても利用できるという利点がある。
At the time of a commit command, data saved in the save area 16 includes the contents CTBL of the file management table 12 and the contents of the input / output buffer 13 having four record areas 13A to 13D.
Since only the CBUF is required, only a small storage area is required compared to the journal file 14A, and there is an advantage that a file such as a floppy disk having no journal file can be used.

なお、本発明は前記実施例の構成等に限らず、本発明
の目的を達成できる範囲の変形は、本発明に含まれるも
のである。
It should be noted that the present invention is not limited to the configuration and the like of the above-described embodiment, and modifications within a range that can achieve the object of the present invention are included in the present invention.

例えば、セーブエリア16に退避するデータ等として
は、ファイル現在指示子CPTRを含むファイル管理テーブ
ル12の内容CTBLおよび入出力バッファ13の内容CBUFだけ
でなく、従来ファイル15の静止点を確立でき、従来ファ
イル15を静止点の状態に復元できるデータ等であれば他
のデータ等でもよい。
For example, as data to be saved in the save area 16, not only the content CTBL of the file management table 12 including the file present indicator CPTR and the content CBUF of the input / output buffer 13 but also a stationary point of the conventional file 15 can be established. Other data may be used as long as the data can restore the file 15 to the stationary point state.

本発明におけるジャーナルレスファイル(従来ファイ
ル15)は、レコード更新用やレコード編集用などに利用
されるファイル等その用途は限定されず、要するに本発
明は、ジャーナルファイルを持てないファイル等に広範
に利用できる。
The journalless file (conventional file 15) in the present invention is not limited in its use, such as a file used for record update or record editing, etc. In short, the present invention is widely used for a file having no journal file. it can.

〔発明の効果〕〔The invention's effect〕

以上説明したように本発明は、コミット命令の実行時
にジャーナルレスファイルの静止点を確立するジャーナ
ルレスファイルコミット制御手段と、ロールバック命令
の実行時に直前の静止点以降の入出力要求を無効として
新たな静止点を確立するジャーナルレスファイルロール
バック制御手段と、ジャーナルレスファイルコミット制
御手段やジャーナルレスファイルロールバック制御手段
を、データベースに対するコミット制御やロールバック
制御に同期して起動させるジャーナルレスファイルコミ
ット制御呼出手段とジャーナルレスファイルロールバッ
ク制御呼出手段とを設けたことにより、データベースフ
ァイルの更新に同期してジャーナルレスファイルの更新
を自動的に行うことができて操作の省力化が図られ、ジ
ャーナルレスファイルの内容がデータベースファイルの
内容と矛盾することがないのでデータの信頼性を向上で
き、さらにジャーナルレスファイルの入出力を考慮して
プログラミングする必要がないためプログラムの生産性
を大きく向上できる効果がある。
As described above, the present invention provides a journalless file commit control means for establishing a quiesce point of a journalless file when a commit command is executed, and a new input / output request after a quiesce point immediately before when a rollback command is executed. Journalless file rollback control means to establish a stable quiesce point, and journalless file commit control to start journalless file commit control means and journalless file rollback control means in synchronization with commit control and rollback control for the database By providing the calling means and the journalless file rollback control calling means, the journalless file can be automatically updated in synchronization with the update of the database file, and the operation can be saved. Phi Since the contents of the file do not conflict with the contents of the database file, the reliability of the data can be improved. In addition, since there is no need to perform programming in consideration of the input / output of the journalless file, the productivity of the program can be greatly improved. .

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

第1図は本発明の一実施例の構成を示すブロック図、第
2図は従来ファイルが入力モードの場合の動作説明図お
よび第3図は従来ファイルが出力モードの場合の動作説
明図である。 1……利用者プログラム、2……コミット命令モジュー
ル、3……データベースコミット制御呼出手段、4……
従来ファイルコミット制御呼出手段、5……ロールバッ
ク命令モジュール、6……データベースロールバック制
御呼出手段、7……従来ファイルロールバック制御呼出
手段、8……データベースコミット制御手段、9……デ
ータベースロールバック制御手段、10……従来ファイル
コミット制御手段、11……従来ファイルロールバック制
御手段、12……ファイル管理テーブル、13……入出力バ
ッファ、14……データベースファイル、14A……ジャー
ナルファイル、15……ジャーナルレスファイルである従
来ファイル、16……セーブエリア、17……ボリューム目
録。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention, FIG. 2 is an operation explanatory diagram when a conventional file is in an input mode, and FIG. 3 is an operational explanatory diagram when a conventional file is in an output mode. . 1. User program 2. Commit command module 3. Database commit control calling means 4.
Conventional file commit control calling means, 5: rollback instruction module, 6: database rollback control calling means, 7: conventional file rollback control calling means, 8: database commit control means, 9: database rollback Control means 10, conventional file commit control means 11, conventional file rollback control means 12, file management table 13, input / output buffer 14, database file 14A journal file 15, … Conventional files that are journalless files, 16… Save areas, 17… Volume catalogs.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】所定の処理プログラムで処理されるデータ
ベースファイルと、当該データベースファイルの実更新
およびレコードロックの解放を行い前記データベースフ
ァイルの静止点を確立するコミット命令と、前記データ
ベースファイルの直前の静止点以降のデータ更新を無効
とし前記データベースファイルの静止点を確立するロッ
クバック命令とを含みレコードのロック管理を行うコミ
ットメント制御方式に対応するジャーナルレスファイル
のコミット同期制御方式であって、前記コミット命令の
実行時に、ジャーナルレスファイルのレコードの位置を
示すファイル現在指示子を退避するとともに、前記ジャ
ーナルレスファイルが出力モードの場合にはレコードの
実出力を行い、前記ジャーナルレスファイルの静止点を
確立するジャーナルレスファイルコミット制御手段と、
前記ロールバック命令の実行時に、前記ジャーナルレス
ファイルの現在指示子を直前のコミット命令実行時点に
戻すとともに、前記ジャーナルレスファイルが出力モー
ドの場合には直前のコミット命令実行以降に出力したレ
コードを無効とし、前記ジャーナルレスファイルの静止
点を確立するジャーナルレスファイルロールバック手段
と、前記処理プログラムから前記ジャーナルレスファイ
ルコミット制御手段を呼び出すジャーナルレスファイル
コミット制御呼出手段と、前記処理プログラムから前記
ジャーナルレスファイルロールバック制御手段を呼び出
すジャーナルレスファイルロールバック制御呼出手段
と、を有することを特徴とするジャーナルレスファイル
のコミット同期制御方式。
1. A database file to be processed by a predetermined processing program, a commit instruction for actually updating the database file and releasing a record lock to establish a quiesce point of the database file, and a quiesce immediately before the database file. And a lockback command for invalidating data update after the point and establishing a quiesce point of the database file, and a commit synchronization control method for a journalless file corresponding to a commitment control method for performing lock management of a record, wherein the commit command Saves the file current indicator indicating the position of the record in the journalless file, and when the journalless file is in the output mode, performs the actual output of the record and establishes the quiesce point of the journalless file Journal And less file commit control means,
When the rollback instruction is executed, the current indicator of the journalless file is returned to the time when the immediately preceding commit instruction was executed, and when the journalless file is in the output mode, records output since the previous commit instruction was executed are invalidated. And a journalless file rollback means for establishing a quiesce point of the journalless file; a journalless file commit control calling means for calling the journalless file commit control means from the processing program; and the journalless file from the processing program. And a journalless file rollback control calling means for calling a rollback control means.
JP2327948A 1990-11-28 1990-11-28 Commit synchronization control method for journalless files Expired - Lifetime JP2623968B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2327948A JP2623968B2 (en) 1990-11-28 1990-11-28 Commit synchronization control method for journalless files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2327948A JP2623968B2 (en) 1990-11-28 1990-11-28 Commit synchronization control method for journalless files

Publications (2)

Publication Number Publication Date
JPH04195558A JPH04195558A (en) 1992-07-15
JP2623968B2 true JP2623968B2 (en) 1997-06-25

Family

ID=18204804

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2327948A Expired - Lifetime JP2623968B2 (en) 1990-11-28 1990-11-28 Commit synchronization control method for journalless files

Country Status (1)

Country Link
JP (1) JP2623968B2 (en)

Also Published As

Publication number Publication date
JPH04195558A (en) 1992-07-15

Similar Documents

Publication Publication Date Title
CA1273434A (en) Method for restarting a long-running, fault-tolerant operation in a transaction-oriented data base system without burdening the system log
JP4237354B2 (en) Transaction processing method and transaction processing system
US7536517B2 (en) Direct-update software transactional memory
JPH04229344A (en) Method for supporting sequential batch application using continuous restartable cursor
JP2623968B2 (en) Commit synchronization control method for journalless files
JPH1063557A (en) Distributed file synchronization system
JPH0764843A (en) Distributed data base update method
JPH01180651A (en) Commit synchronization control system for report file output
JP2743860B2 (en) User program debug processing system
JPS6159538A (en) Queue control system between tasks
JPH02257228A (en) File control system for data base system
JP2610972B2 (en) Database data integrity method
JP2634908B2 (en) Information processing device
JPH0916454A (en) Computer system and buffer management method therefor
JPH02304645A (en) Information operating history managing system
JPH01114948A (en) File edition supporting method
JPH03231337A (en) Collection processing system for system execution history
JPH0827751B2 (en) Transaction resource dynamic update method
JPH0962554A (en) Quiescent point save generation system
JP2957185B2 (en) Shared variable access method
JPH03246644A (en) Record sharing control system
JPH02138646A (en) Processing system for addition of record
JPS6310251A (en) Control system for record indicator
JPS63228245A (en) Automatic restoration system for data base
JPH04188339A (en) Control system for deleted record