JPH04139545A - Data base updating processing system - Google Patents

Data base updating processing system

Info

Publication number
JPH04139545A
JPH04139545A JP2263323A JP26332390A JPH04139545A JP H04139545 A JPH04139545 A JP H04139545A JP 2263323 A JP2263323 A JP 2263323A JP 26332390 A JP26332390 A JP 26332390A JP H04139545 A JPH04139545 A JP H04139545A
Authority
JP
Japan
Prior art keywords
database
buffer
application program
processing
updated
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
JP2263323A
Other languages
Japanese (ja)
Inventor
Ariko Tsuchiya
土屋 亜里子
Motoaki Iwasaki
岩崎 元昭
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2263323A priority Critical patent/JPH04139545A/en
Publication of JPH04139545A publication Critical patent/JPH04139545A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To prevent the reference processing to other programs from being kept waiting for a long time even at execution of an application program which updates a large number of data base records by setting a local buffer of a data base buffer area exclusive for the application program against an application program which updates plural data base records. CONSTITUTION:The reference updating processing is applied to the data base records 10 from the application programs 1 and 2 via a data base control system 3. A local buffer 7 is provided in a memory 4 to the processing of the program 1 and the data base records 12 which are updated by the program 1 are copied to the buffer 7 from a global buffer 56. Thus the records 12 are updated in the buffer 7. As a result, the time during which other programs are unable to refer to the record 12 to be updated is shortened.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、データベース更新処理方式に関し、特に、複
数のアプリケーションプログラムが複数のデータベース
レコードをそれぞれに参照更新するデータベースシステ
ムにおいて、他アプリケーションプログラムから参照が
不可能な排他モードでの排他期間を短くして、複数のデ
ータベースレコードの更新を行うデータベース更新処理
方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a database update processing method, and in particular, in a database system where multiple application programs refer to and update multiple database records respectively, the present invention relates to a database update processing method. The present invention relates to a database update processing method that updates a plurality of database records by shortening the exclusive period in an exclusive mode in which it is impossible.

〔従来の技術〕[Conventional technology]

従来、データベースシステムにおいて、共有資源のデー
タベースレコードは、できるだけ各々のアプリケーショ
ンプログラムが混乱なく任意に参照更新できるように、
互いに排他をかけて処理を行う。複数のアプリケーショ
ンプログラムから参照更新されるデータベースレコード
については、各アプリケーションプログラムの処理が、
参照処理どうしであれば、同時に参照ができるように、
他アプリケーションプログラムから参照可能な共有モー
ドでの排他をかけて参照処理を行う。また、更新処理で
あれば、そのデータベースレコードを専有できるように
するため、他アプリケーションプログラムから参照不可
能な排他モードでの排他をかけた更新処理を行う。
Conventionally, in database systems, database records of shared resources are stored so that each application program can refer to and update them arbitrarily without confusion.
Processing is performed with mutual exclusion. For database records that are referenced and updated by multiple application programs, each application program's processing is
For reference processing, so that they can be referenced at the same time,
Reference processing is performed with exclusive access in shared mode that can be referenced from other application programs. In addition, in the case of update processing, in order to make the database record exclusive, the update processing is performed in an exclusive mode that cannot be referenced from other application programs.

複数のデータベースレコードの更新処理を行うため、更
新対象のデータベースレコードを検索するとき、排他モ
ードでの排他をかけて検索処理を行うと、他のアプリケ
ーションプログラムでの参照処理が不必要に待たされ、
共有モードで排他をかけて検索処理を行うと、更新対象
のデータベースレコードを検索した後に排他モードに変
更しなければならず、この間に他のアプリケーションプ
ログラムにより排他モードでの排他をかけられた場合な
どでは、デッドロックが発生しやすくなるという問題が
ある。
When updating multiple database records, when searching for the database record to be updated, if the search is performed with exclusive mode, the reference processing in other application programs will be forced to wait unnecessarily.
If you perform a search process with exclusion applied in shared mode, you must change to exclusive mode after searching for the database record to be updated, and during this time, if another application program applies exclusion in exclusive mode, etc. However, there is a problem in that deadlocks are more likely to occur.

更新対象のデータベースレコードを検索している間は、
他のアプリケーションプログラムでの参照が待たされる
ことなく、かつデッドロックの発生しにくい排他制御方
法として、例えば、特開昭63−124139号公報に
記載の「共有資源排他制御方式Jの提案がある。この共
有資源排他制御方式では、共有モードを参照共有モード
と更新共有モードに分けておき、更新のための参照処理
は更新共有モードで排他をかけ、更新のない参照処理は
参照共有モードで排他をかけて処理を行う。
While searching for database records to update,
As an exclusive control method that does not require other application programs to wait for reference and is less likely to cause deadlock, there is a proposal for ``Shared Resource Exclusive Control Method J'' described in, for example, Japanese Unexamined Patent Publication No. 63-124139. In this shared resource exclusive control method, the sharing mode is divided into reference sharing mode and update sharing mode. Reference processing for updating is exclusive in update sharing mode, and reference processing without updating is exclusive in reference sharing mode. processing.

これにより、更新のための参照処理と、更新のない参照
処理どうしであれば、同時に参照できるようになる。参
照共有モードでは、既に排他モードで排他がかかってい
る場合にのみ待ち合せ、更新のための参照処理どうしで
あれば、同時に参照できないようにする。更新共有モー
ドでは、既に更新共有モードまたは排他モードで排他が
かかっている場合に待ち合わせる。なお、データベース
レコードを更新する際は、更新共有モードを排他モード
に変更してから更新処理を行う。
This allows reference processing for updating and reference processing for non-updating to be referenced at the same time. In the reference sharing mode, waiting is performed only when exclusion is already applied in the exclusive mode, and if reference processing for updating is performed, the references cannot be made at the same time. In the update sharing mode, a wait is made if an exclusion is already applied in the update sharing mode or exclusive mode. Note that when updating a database record, update processing is performed after changing the update sharing mode to exclusive mode.

このような排他制御を行うことにより、更新対象のデー
タベースレコードを検索している間、他のアプリケーシ
ョンプログラムの更新のない参照処理が待たされないた
め、参照処理の待ち時間が短縮される。
By performing such exclusive control, reference processing that is not updated by other application programs is not made to wait while a database record to be updated is searched, so that the waiting time for reference processing is shortened.

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

ところで、上述した従来の技術において、各々のデータ
ベースレコードに対する排他の解除は、通常、排他をか
けたアプリケーションプログラムの終了時に行なわれる
。データベースレコード更新時には、排他モードで排他
をかけるため、当該アプリケーションプログラムが終了
するまで、他のアプリケーションプログラムは当該デー
タベースレコードを参照できないことになる。
By the way, in the above-mentioned conventional technology, the exclusion of each database record is normally released when the application program that has applied the exclusion is terminated. When updating a database record, exclusion is applied in exclusive mode, so other application programs cannot reference the database record until the application program ends.

また、特開昭63−124139号公報の記載の「共有
資源排他制御方式」でも、更新のための参照(検索)処
理の間は、他のアプリケーションプログラムの更新のな
い参照処理は待たされないが、その後のデータベースレ
コードを更新する時には、排他モードでの排他をかけ、
当該アプリケーションプログラム終了時までは排他を解
除しないので、他のアプリケーションプログラムはその
間は当該データベースレコードを参照できない。
Also, in the "shared resource exclusive control method" described in Japanese Patent Application Laid-Open No. 63-124139, during reference (search) processing for updating, reference processing of other application programs that do not have to be updated is not made to wait. When updating subsequent database records, apply exclusive mode and
Since the exclusion is not released until the application program ends, other application programs cannot refer to the database record during that time.

このため、大量にデータベースレコードを更新するアプ
リケーションプログラムを実行する場合、排他モードで
の排他をかけられるデータベースレコードが多くなり、
また、排他を解除されるまでの時間が長くかかり、他の
アプリケーションプログラムの参照処理が長時間時たさ
れるという問題がある。
Therefore, when running an application program that updates a large number of database records, many database records will be locked in exclusive mode.
Further, there is a problem that it takes a long time to release the exclusion, and the process of referring to other application programs takes a long time.

本発明は、上記問題点を解決するためになされたもので
ある。
The present invention has been made to solve the above problems.

本発明の目的は、データベースシステムにおいて、大量
にデータベースレコードを更新するアプリケーションプ
ログラムの実行時にも、他のアプリケーションプログラ
ムの参照処理が長時開時たされることのないデータベー
ス更新処理方式を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a database update processing method in a database system that does not allow reference processing of other application programs to remain open for a long time even when an application program that updates a large number of database records is executed. It is in.

〔I!題を解決するための手段〕[I! Means to solve the problem]

上記目的を達成するために、本発明のデータベース更新
処理方式は、複数のデータベースレコードを格納してい
る媒体からメモリ上のデータベースバッファに複数のデ
ータベースレコードヲ読み込み、?II数のアプリケー
ションプログラムがそれぞれにデータベースレコードの
排他を指示して。
In order to achieve the above object, the database update processing method of the present invention reads a plurality of database records from a medium storing the plurality of database records into a database buffer on memory. II number of application programs instruct each to exclude database records.

複数のデータベースレコードをそれぞれに参照更新する
データベースシステムにおいて、複数のデータベースレ
コードを更新するアプリケーションプログラムに対して
、当該アプリケーションプログラム専用のデータベース
バッファ領域のローカルバッファを設定し、当該アプリ
ケーションプログラムの複数のデータベースレコードの
更新処理は、更新するデータベースレコードに対して他
アプリケーションプログラムから参照可能な共有モード
での排他を確保して当該データベースレコードをデータ
ベースバッファからローカルバッファにコピーし、ロー
カルバッファ上で尚該データベースレコードの更新を行
い、当該アプリケーションプログラム終了時に、データ
ベースバッファ上の当該アプリケーションプログラムが
更新した当該データベースレコード全てに対して、他ア
プリケーションプログラムから参照が不可能な排他モー
ドでの排他を確保し、データベースバッファ上の当該デ
ータベースレコードをローカルバッファ上で更新したデ
ータベースレコードに書き換え、当該データベースレコ
ードの排他を解除して、データベースレコードの更新処
理を終了することを特徴とする。
In a database system that references and updates multiple database records, a local buffer in the database buffer area dedicated to the application program is set for an application program that updates multiple database records, and multiple database records of the application program are updated. The update process involves securing exclusive access to the database record to be updated in a shared mode that can be referenced from other application programs, copying the database record from the database buffer to the local buffer, and then copying the database record on the local buffer. After updating, when the application program ends, all the database records updated by the application program on the database buffer are secured in exclusive mode that cannot be referenced from other application programs, and the database records on the database buffer are The present invention is characterized in that the database record is rewritten with an updated database record on a local buffer, the exclusion of the database record is released, and the database record update process is completed.

〔作用〕[Effect]

データベースシステムは、複数のアプリケーションプロ
グラムが複数のデータベースレコードをそれぞれに参照
更新する。このため、?Ii数のデータベースレコード
を格納している媒体からメモリ上のデータベースバッフ
ァに複数のデータベースレコードを読み込み、複数のア
プリケーションプログラムがそれぞれにデータベースレ
コードの排他を指示して、複数のデータベースレコード
をそれぞれに参照更新する。
In a database system, multiple application programs refer to and update multiple database records. For this reason,? Multiple database records are read into a database buffer in memory from a medium storing Ii number of database records, multiple application programs instruct each database record to be exclusive, and refer to and update the multiple database records individually. do.

複数のデータベースレコードを更新するアプリケーショ
ンプログラムに対しては、当該アプリケーションプログ
ラム専用のデータベースバッファ領域のローカルバッフ
ァを設定して、当該アプリケーションプログラムによる
複数のデータベースレコードの更新処理を行う。
For an application program that updates a plurality of database records, a local buffer in a database buffer area dedicated to the application program is set, and the application program updates the plurality of database records.

複数のデータベースレコードの更新処理では、当該アプ
リケーションプログラムが、更新するデータベースレコ
ードに対して他アプリケーションプログラムから参照可
能な共有モードでの排他を確保して、更新する当該デー
タベースレコードをデータベースバッファからローカル
バッファにコピーする。そして、ローカルバッファ上で
当該アプリケーションプログラムによる複数の当該デー
タベースレコードの更新を行う。この間、更新を行うデ
ータベースレコードの排他は、他アプリケーションプロ
グラムから参照可能な共有モードでの排他であり、しか
も、コピーを行う時のみであるので、他アプリケーショ
ンプログラムからは任意時に参照可能となっている。
When updating multiple database records, the application program secures exclusive access to the database record to be updated in a shared mode that can be referenced by other application programs, and transfers the database record to be updated from the database buffer to the local buffer. make a copy. Then, the plurality of database records are updated by the application program on the local buffer. During this time, the database record being updated is exclusive in shared mode so that it can be referenced from other application programs, and moreover, it is exclusive only when copying, so it can be referenced from other application programs at any time. .

当該アプリケーションプログラムの終了処理時には、デ
ータベースバッファ上の当該アプリケーションプログラ
ムが更新した当該データベースレコード全てに対して、
他アプリケーションプログラムから参照が不可能な排他
モードでの排他を確保し、データベースバッファ上の当
該データベースレコードを、ローカルバッファ上で更新
したデータベースレコードに書き換える。そして、デー
タベースバッファの当該データベースレコードの排他を
解除して、データベースレコードの更新処理を終了する
When the application program is terminated, all database records updated by the application program in the database buffer are
Exclusion is ensured in an exclusive mode that cannot be referenced from other application programs, and the database record in question on the database buffer is rewritten with the updated database record on the local buffer. Then, the exclusion of the database record in the database buffer is released, and the database record update process is completed.

これにより、大量にデータベースレコードを更新するア
プリケーションプログラムを実行する場合にも、各々の
データベースレコードの更新ハJ有モードでの排他によ
りローカルバッファ上に:ピー処理を行い、コピーされ
た各データベースシステムで更新処理が行なわれており
、他のアブl。
As a result, even when running an application program that updates a large number of database records, each database record update is performed in the local buffer by exclusive use in J-enabled mode, and each copied database system is Update processing is in progress, and other applications are being updated.

ケーションプログラムの参照処理が長時間時た2れるこ
とはない。また、アプリケーションプロろラムが正常終
了しない時には、データベースレコードを更新前の状態
に戻さなければならないが、ここでは、終了処理のロー
カルバッファのデータベースレコードの内容をデータベ
ースバッファCデータベースレコードに書き換える処理
を行なわなければ、更新される前のデータベースレコー
ドがそのままで残っており、特別な処理を行なわなくて
もよい。
Application program reference processing will not be delayed for a long time. Also, when the application program does not terminate normally, the database record must be returned to the state before the update, but here, the contents of the database record in the local buffer of the termination process are rewritten to the database buffer C database record. If not, the database record before being updated remains as it is, and no special processing is required.

〔実施例〕〔Example〕

以下、本発明の一実施例を図面を用いて具体的に説明す
る。
Hereinafter, one embodiment of the present invention will be specifically described using the drawings.

第1図は、本発明の一実施例にかかるデータベースシス
テムの構成を示すブロック図である。第1図において、
1は複数のデータベースレコードを更新するアプリケー
ションプログラム、2はデータベースレコードを参照す
るアプリケーションプログラムである。また、3はデー
タベース管理システム、4はメモリ、5は処理装置、6
はデータベースバッファのグローバルバッファ、7はデ
ータベースバッファの1部の専用領域であるローカルバ
ッファ、8はディスク装置のローカルバッファ用退避媒
体、9はディスク装置のデータベース格納媒体である。
FIG. 1 is a block diagram showing the configuration of a database system according to an embodiment of the present invention. In Figure 1,
1 is an application program that updates a plurality of database records, and 2 is an application program that refers to the database records. Further, 3 is a database management system, 4 is a memory, 5 is a processing unit, and 6 is a database management system.
7 is a global buffer of the database buffer, 7 is a local buffer which is a dedicated area of a part of the database buffer, 8 is a local buffer evacuation medium of the disk device, and 9 is a database storage medium of the disk device.

データベース格納媒体9には、データベースレコード1
0が格納されており、データベースレコード10の参照
処理および更新処理を行う場合には、複数のデータベー
スレコード10がメモリ4上のグローバルバッファ6に
一括して読み込まれ、グローバルバッファ6に複数のデ
ータベースレコード11が格納されている状態でデータ
ベース処理が行なわれる。
The database storage medium 9 includes database records 1
0 is stored, and when performing reference processing and update processing of the database record 10, a plurality of database records 10 are read at once into the global buffer 6 on the memory 4, and the plurality of database records are stored in the global buffer 6. Database processing is performed in a state where 11 is stored.

例えば、アプリケーションプログラム2はデータベース
レコード11の参照のみを行い、アプリケーションプロ
グラム1はデータベースレコード10を大量に更新する
処理を行う。アプリケーションプログラム1およびアプ
リケーションプログラム2からデータベースレコード1
0への参照更新処理は、データベース管理システム3を
介して行う。アプリケーションプログラム1の処理に対
しては、まず、ローカルバッファ7をメモリ4上に設け
、アプリケーションプログラム1が更新するデータベー
スレコード12を、グローバルバッファ6からローカル
バッファ7ヘコピーし、コピーしたローカルバッファ7
上において、当該データベースレコード12の更新処理
を行う。また、ローカルバッファ用退避媒体8は、ロー
カルバッファ7の満杯時にその内容を退避するための格
納領域を供給する。
For example, the application program 2 only references the database records 11, and the application program 1 performs a process of updating the database records 10 in large quantities. Database record 1 from application program 1 and application program 2
The reference update process to 0 is performed via the database management system 3. For the processing of the application program 1, first, a local buffer 7 is provided on the memory 4, the database record 12 to be updated by the application program 1 is copied from the global buffer 6 to the local buffer 7, and the copied local buffer 7 is
Above, the database record 12 is updated. Further, the local buffer saving medium 8 provides a storage area for saving the contents when the local buffer 7 is full.

次に、各アプリケーションプログラムにおけるデータベ
ース管理システムによる処理要素のデータベースレコー
ドの参照処理、更新処理および同期点処理の各処理につ
いて説明する。
Next, each process of reference processing, update processing, and synchronization point processing of database records of processing elements by the database management system in each application program will be explained.

第2図は、データベースレコードの参照処理の処理フロ
ーを示すフローチャートである。参照処理は、例えば、
アプリケーションプログラム2がグローバルバッファ6
の読み込んだデータベースレコード11に対して行う参
照処理である。参照処理は、他アプリケーションプログ
ラムから参照可能な共有モードでの排他をかけて行う。
FIG. 2 is a flowchart showing the processing flow of database record reference processing. Reference processing is, for example,
Application program 2 is global buffer 6
This is a reference process performed on the database record 11 read by. Reference processing is performed by exclusive use in a shared mode that allows reference from other application programs.

まず、処理ステップ21において、グローバルバッファ
上のデータベースレコードに共有モードで排他をかけ、
処理ステップ22において、参照する当該データベース
レコードを出力フィールドにセットして参照処理を終了
する。
First, in processing step 21, exclusive access is applied to the database record on the global buffer in shared mode,
In processing step 22, the database record to be referenced is set in the output field, and the reference processing is completed.

第3図は、データベースレコードの更新処理の処理フロ
ーを示すフローチャートである。この更新処理は、例え
ば、アプリケーションプログラム1がローカルバッファ
7上にコピーしたデータベースレコード12に対して行
う第1の更新処理と、グローバルバッファ6上における
データベースレコード11に対して行う第2の更新処理
とがオプションで選択されて行なわれるように構成され
ている。
FIG. 3 is a flowchart showing the processing flow of database record update processing. This update process includes, for example, a first update process performed on the database record 12 copied onto the local buffer 7 by the application program 1, and a second update process performed on the database record 11 on the global buffer 6. is configured so that it can be selected as an option.

更新処理では、まず、処理ステップ3oにおいて、ロー
カルバッファ使用のオプションの判定を行う。オプショ
ンがなければ、処理ステップ37において、グローバル
バッファ上のデータベースレコード対して排他モードで
排他をかけ、次の処理ステップ38において、データベ
ースレコードの内容をグローバルバッファ上で更新する
処理を行い、更新処理を終了する。この場合には、更新
処理を行ったデータベースレコードに対しては、当該デ
ータベースレコードの更新処理と同時に更新する他のデ
ータベースレコードの更新処理の終了処理を行う同期点
処理(第4図)を行うまでの間は、排他モードでの排他
は解除しない。したがって、更新が行なわれた当該デー
タベースレコードは中間結果となっており、他からの参
照は禁止されている。
In the update process, first, in process step 3o, the option of using a local buffer is determined. If there is no option, in processing step 37, exclusive mode is applied to the database record on the global buffer, and in the next processing step 38, processing is performed to update the contents of the database record on the global buffer, and the update processing is performed. finish. In this case, for the database record that has been updated, the synchronization point process (Figure 4) is performed to complete the update process for other database records that are updated at the same time as the update process for the database record. During this period, exclusive mode will not be released. Therefore, the database record that has been updated is an intermediate result, and reference from others is prohibited.

一方、処理ステップ30のオプションの判定で、オプシ
ョンがあれば、次の処理ステップ31において、グロー
バルバッファ上のデータベースレコードに共有モードで
の排他をかける。次に処理ステップ32において、当該
データベースレコードがローカルバッファまたはローカ
ルバッファ退避媒体上に存在するか否かを判定する。更
新を行う当該データベースレコードが存在する場合、処
理ステップ36に進んで、ローカルバッファ上で当該デ
ータベースレコードの更新を行う。一方、当該データベ
ースレコードがローカルバッファまたはローカルバッフ
ァ退避媒体上に存在しない場合には、次の処理ステップ
33において、ローカルバッファに空きがあるか否かを
判定し、空きが無ければ、次の処理ステップ34におい
て、ローカルバッファ上のルコードをローカルバッファ
退避媒体に退避して空き領域を確保した後に処理ステッ
プ35に進む、また、空きがあれば、そのまま処理ステ
ップ35に進んで、グローバルバッファ上の更新対象の
データベースレコードをローカルバッファの空き領域に
コピーを行う。次に、処理ステップ36において、ロー
カルバッファ上で更新対象のデータベースレコードの更
新を行い、処理を終了する。
On the other hand, if the option is determined in processing step 30, if there is an option, then in the next processing step 31, the database record on the global buffer is excluded in the shared mode. Next, in processing step 32, it is determined whether the database record exists on the local buffer or local buffer save medium. If the database record to be updated exists, the process proceeds to step 36, where the database record is updated on the local buffer. On the other hand, if the database record does not exist in the local buffer or local buffer save medium, in the next processing step 33, it is determined whether or not there is space in the local buffer, and if there is no space, the next processing step In step 34, the code on the local buffer is saved to the local buffer save medium to secure free space, and then the process proceeds to step 35. If there is space, the process directly proceeds to process step 35, and the update target on the global buffer is saved. Copy the database records to free space in the local buffer. Next, in processing step 36, the database record to be updated is updated on the local buffer, and the processing ends.

ここでのローカルバッファ使用のオプションがある場合
の更新処理では、グローバルバッファ上のデータベース
レコード対しては、コピー処理を行うだけであり、参照
処理と同様な共有モードの排他をかけて処理を行う。し
たがって、この場合には、グローバルバッファ上の当該
データベースレコードは更新されていない前の状態で残
っており、他からの参照が可能となっている。
In the update process when there is an option to use the local buffer, the database record on the global buffer is simply copied, and the process is performed with shared mode exclusion similar to the reference process. Therefore, in this case, the database record on the global buffer remains in its previous state without being updated, and can be referenced by others.

第4図は、データベースレコードの同期点処理の処理フ
ローを示すフローチャートである。この同期点処理は、
例えば、アプリケーションプログラム1が同時に行う複
数のデータベースレコードの更新の終了処理となってい
る。処理対象のデータベースレコードにかけた排他モー
ドの解除処理を含む処理となっている。
FIG. 4 is a flowchart showing the processing flow of database record synchronization point processing. This sync point process is
For example, this is a process for ending updates of a plurality of database records that the application program 1 simultaneously performs. This process includes canceling the exclusive mode applied to the database record to be processed.

この同期点処理の場合にも、まず、処理ステップ41に
おいて、ローカルバッファ使用のオプションを判定する
。オプションがなければ、処理ステップ45において、
該当するデータベースの排他の解放のみを行う。また、
ローカルバッファ使用のオプションがあれば、処理ステ
ップ42において、ローカルバッファおよび退避用媒体
上に存在する全てのデータベースレコードに対応するグ
ローバルバッファ上のデータベースレコードに、排他モ
ードで排他をかける。次に、処理ステップ43において
、グローバルバッファにローカルバッファ上のデータベ
ースレコードをコピーし、更に、処理ステップ44にお
いて、グローバルバッファに退避用媒体上のデータベー
スレコードをコピーする。そして、次に処理ステップ4
5において排他を解放する。これにより、ローカルバッ
ファ上で更新されたデータベースレコードが、他から参
照可能なグローバルバッファ上のデータベースレコード
として反映される。
In the case of this synchronization point processing as well, first, in processing step 41, the option of using a local buffer is determined. If there are no options, then in processing step 45,
Only releases the exclusive access of the relevant database. Also,
If there is an option to use the local buffer, in processing step 42, database records on the global buffer corresponding to all database records existing on the local buffer and the save medium are excluded in exclusive mode. Next, in processing step 43, the database record on the local buffer is copied to the global buffer, and further, in processing step 44, the database record on the save medium is copied to the global buffer. Then, processing step 4
In step 5, the exclusive is released. As a result, the database record updated on the local buffer is reflected as a database record on the global buffer that can be referenced from others.

次に、このようなデータベースレコードに対する参照処
理、更新処理および同期点処理が随時に行なわれるアプ
リケーションプログラムにおけるデータベース更新処理
を説明する。
Next, a description will be given of database update processing in an application program in which such reference processing, update processing, and synchronization point processing for database records are performed at any time.

第5図は、アプリケーションプログラムにおいてローカ
ルバッファ使用のオプションがない場合のデータベース
更新の処理例を説明する図である。
FIG. 5 is a diagram illustrating an example of database update processing when there is no option to use a local buffer in the application program.

大量のデータベースレコードの更新を行うアプリケーシ
ョンプログラム1は、一連の処理の中で、データベース
レコードAの更新処理51.データベースレコードBの
更新処理52.および同期点処理53を順次に行い、デ
ータベースの更新を行う。
The application program 1 that updates a large number of database records performs database record A update processing 51 . Database record B update process 52. and synchronization point processing 53 are performed sequentially to update the database.

まず、データベースレコードAの更新処理51を行うと
、データベース管理システム3の処理として、ステップ
51aにおいてデータベースレコードAに排他モードで
排他を確保し、次のステップ51bにおいてグローバル
バッファ6上のデータベースレコードA11aからa′
へ更新する。同様に、データベースレコードBの更新処
理52を行うと、データベース管理システム3の処理と
して、ステップ52aにおいてデータベースレコードB
に排他モードで排他を確保し、次のステップ52bにお
いてグローバルバッファ6上のデータベースレコードB
をbからb′へ更新する。次に当該アプリケーションプ
ログラム1の終了の同期点処理53を行うと、データベ
ース管理システム3の処理として、ステップ53aにお
いてデータベースレコードAとデータベースレコードB
との排他を解除する。
First, when updating processing 51 of database record A is performed, as a process of the database management system 3, in step 51a, exclusiveness is secured for database record A in exclusive mode, and in the next step 51b, from database record A11a on global buffer 6. a′
Update to. Similarly, when the update process 52 of the database record B is performed, the database record B is updated in step 52a as a process of the database management system 3.
In the next step 52b, database record B on the global buffer 6 is secured in exclusive mode.
is updated from b to b'. Next, when the synchronization point process 53 for ending the application program 1 is performed, the database management system 3 processes the database record A and the database record B in step 53a.
Release the exclusion with.

アプリケーションプログラム1が正常に終了しなかった
場合、グローバルバッファ6上のデータベースレコード
は更新前の状態に戻す必要があるので、データベースレ
コードAの更新後、アプリケーションプログラムlが正
常に終了するまでの間は、データベースレコードAの内
容を保証するため、他のアプリケーションプログラムが
参照できないように排他モードで排他をかけて更新処理
を行う。このように、ローカルバッファ使用のオプショ
ンを指定しない場合の処理では、データベースレコード
Aの更新要求時からアプリケーションプログラムlの同
時点処理を行う時点まで、データベースレコードAに排
他モードで排他を確保しているので、他のアプリケーシ
ョンプログラムは、その間はデータベースレコードAを
参照できない。
If application program 1 does not terminate normally, the database record on global buffer 6 must be returned to the state before the update, so after updating database record A until application program l terminates normally, , In order to guarantee the contents of database record A, update processing is performed in exclusive mode so that other application programs cannot refer to it. In this way, in processing when the local buffer use option is not specified, exclusive access to database record A is secured in exclusive mode from the time of an update request for database record A until the time when application program L is processed at the same time. Therefore, other application programs cannot refer to database record A during that time.

したがって、データベースレコードに対して排他モード
で排他を確保する時間を短くするため、すなわち、他の
アプリケーションプログラムが参照できない時間を短く
するため、ローカルバッファ使用のオプションを指定し
て、データベースの更新処理を行う。
Therefore, in order to shorten the time it takes to secure exclusive access to database records in exclusive mode, in other words, to shorten the time when other application programs cannot reference them, specify the option to use local buffers and perform database update processing. conduct.

第6図は、アプリケーションプログラムにおいてローカ
ルバッファ使用のオプションがある場合のデータベース
更新の処理例を説明する図である。
FIG. 6 is a diagram illustrating an example of database update processing when the application program has an option to use a local buffer.

大量のデータベースレコードの更新を行うアプリケーシ
ョンプログラムlは、一連の処理の中で、データベース
レコードAの更新処理61.データベースレコードBの
更新処理62.および同期点処理63を順次に行い、デ
ータベースの更新を行う。この場合には、データベース
レコードAとデータベースレコードBを更新するアプリ
ケーションプログラム1に対して、ローカルバッファ7
が設けられる。
An application program l that updates a large number of database records performs update processing 61 for database record A in a series of processes. Database record B update process 62. and synchronization point processing 63 are performed sequentially to update the database. In this case, for the application program 1 that updates database record A and database record B, the local buffer 7
will be provided.

アプリケーションプログラム1の実行で、データベース
レコードAの更新処理61を行うと、データベース管理
システム3の処理として、ステップ61aにおいて、デ
ータベースレコードAに共有モードで排他をかけ、次の
ステップ61bにおいて、グローバルバッファ6上のデ
ータベースレコードAの内容をローカルバッファ7にコ
ピーする。次のステップ61cにおいて、ローカルバッ
ファ7上でデータベースレコードAの内容をaからa′
に更新する。同様に、データベースレコードBの更新処
理62を行うと、データベース管理システム3の処理と
して、ステップ62aにおいて、データベースレコード
Bに共有モードで排他をかけ、次のステップ62bにお
いて、グローバルバッファ6上のデータベースレコード
Bの内容をローカルバッファ7にコピーする。次のステ
ップ62cにおいて、ローカルバッファ7上で、データ
ベースレコードBの内容をbからb′へ更新する。アプ
リケーションプログラム1の終了の同期点処理63を行
うと、データベース管理システム3の処理として、ステ
ップ63aにおいて、データベースレコードAおよびデ
ータベースレコードBに排他モードで排他をかける。次
に、ステップロ3bにおいて、ローカルバッファ7上の
データベースレコードAとデータベースレコードBσ内
容で、グローバルバッファ6上のデータベル2レコード
AとデータベースレコードBを更新す2そして、次のス
テップ63cにおいて、データベースレコードAとデー
タベースレコードBとのM1他を解除する。
When the application program 1 executes the update process 61 of the database record A, the database management system 3 processes in step 61a to apply exclusion to the database record A in the shared mode, and in the next step 61b, the global buffer 6 Copy the contents of database record A above to local buffer 7. In the next step 61c, the contents of the database record A are transferred from a to a' on the local buffer 7.
Update to. Similarly, when the database record B update process 62 is performed, the database management system 3 processes in step 62a to apply exclusion to the database record B in the shared mode, and in the next step 62b, updates the database record B on the global buffer 6. Copy the contents of B to local buffer 7. In the next step 62c, the contents of database record B are updated from b to b' on the local buffer 7. When the synchronization point process 63 for ending the application program 1 is performed, as a process of the database management system 3, in step 63a, database record A and database record B are excluded in exclusive mode. Next, in step 3b, data bell 2 record A and database record B on the global buffer 6 are updated with the contents of database record A and database record Bσ on the local buffer 72.Then, in the next step 63c, the database Release M1 and others of record A and database record B.

この更新処理でも、アプリケーションプログラム1が正
常に終了しなかった場合、グローバルバッファ6上のデ
ータベースレコードは、アプリケーションプログラム1
で更新する前の状態に戻さなければならないが、ここで
は、アプリケーションプログラム1が正常終了するまで
グローバルバッファ6上のデータベースレコードは参照
されコピーされているだけで更新されていないので、ア
プリケーションプログラムが正常に終了しなかった場合
にも、特に、データベースレコードを戻す処理を行う必
要としない。したがって、データベースレコードに排他
モードで排他をかけるのは、アプリケーションプログラ
ムの終了時に、ローカルバッファ7のデータベースレコ
ードの内容にグローバルバッファ6を更新する時だけで
ある。
Even in this update process, if application program 1 does not terminate normally, the database record on global buffer 6 will be changed to application program 1.
However, in this case, until application program 1 terminates normally, the database records on global buffer 6 are only referenced and copied, but not updated, so the application program is not updated normally. Even if the process does not end, there is no need to perform any processing to return the database record. Therefore, exclusive mode is applied to database records only when the global buffer 6 is updated with the contents of the database records in the local buffer 7 at the end of the application program.

このように、ローカルバッファ使用のオプションを指定
してデータベース更新処理を行うと、同期点処理の間だ
け、データベースレコードAに排他モードで排他が確保
されているので、他のアプリケーションプログラムから
データベースレコードを参照できない時間が短かくなっ
ている。
In this way, when database update processing is performed with the local buffer use option specified, database record A is secured in exclusive mode only during synchronization point processing, so database records cannot be accessed from other application programs. The time when it cannot be referenced has become shorter.

以上、本発明を実施例にもとづき具体的に説明したが、
本発明は、前記実施例に限定されるものではなく、その
要旨を逸脱しない範囲において種々変更可能であること
は言うまでもない。
The present invention has been specifically explained above based on examples, but
It goes without saying that the present invention is not limited to the embodiments described above, and can be modified in various ways without departing from the spirit thereof.

〔発明の効果〕〔Effect of the invention〕

以上、説明したように1本発明によれば、大量にデータ
ベースレコードを更新するアプリケーションプログラム
を実行している間、排他モードでの排他期間を短縮し、
更新対象のデータベースレコードに対しての他のアプリ
ケーションプログラムが参照できない時間を短縮できる
という効果がある。
As described above, according to one aspect of the present invention, while an application program that updates a large number of database records is running, the exclusive period in exclusive mode is shortened,
This has the effect of reducing the time during which other application programs cannot reference the database record to be updated.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は1本発明の一実施例にががるデータベースシス
テムの構成を示すブロック図、第2図は、データベース
レコードの参照処理ノ処理フローを示すフローチャート
、 第3図は、データベースレコードの更新処理の処理フロ
ーを示すフローチャート。 第4向は、データベースレコードの同期点処理の処理フ
ローを示すフローチャート、 第5図は、アプリケーションプログラムにおいてローカ
ルバッファ使用のオプションがない場合のデータベース
更新の処理例を説明する図、第6図は、アプリケーショ
ンプログラムにおいてローカルバッファ使用のオプショ
ンがある場合のデータベース更新の処理例を説明する図
である。 図中、1・・・アプリケーションプログラム、2・・ア
プリケーションプログラム、3・・・データベース管理
システム、4・・・メモリ、5・・・処理装置、6・・
・グローバルバッファ、7・・・ローカルバッファ、8
・・・ローカルバッファ用退避媒体、9・・・データベ
ース格納媒体。
FIG. 1 is a block diagram showing the configuration of a database system according to an embodiment of the present invention, FIG. 2 is a flowchart showing the processing flow of database record reference processing, and FIG. 3 is a database record update process. Flowchart showing the processing flow of processing. The fourth direction is a flowchart showing the processing flow of database record synchronization point processing. FIG. 6 is a diagram illustrating an example of database update processing when an application program has an option to use a local buffer. In the figure, 1... Application program, 2... Application program, 3... Database management system, 4... Memory, 5... Processing device, 6...
・Global buffer, 7...Local buffer, 8
...Local buffer save medium, 9...Database storage medium.

Claims (1)

【特許請求の範囲】[Claims] 1、複数のデータベースレコードを格納している媒体か
らメモリ上のデータベースバッファに複数のデータベー
スレコードを読み込み、複数のアプリケーションプログ
ラムがそれぞれにデータベースレコードの排他を指示し
て、複数のデータベースレコードをそれぞれに参照更新
するデータベースシステムにおいて、複数のデータベー
スレコードを更新するアプリケーションプログラムに対
して、当該アプリケーションプログラム専用のデータベ
ースバッファ領域のローカルバッファを設定し、当該ア
プリケーションプログラムの複数のデータベースレコー
ドの更新処理は、更新するデータベースレコードに対し
て他アプリケーションプログラムから参照可能な共有モ
ードでの排他を確保して当該データベースレコードをデ
ータベースバッファからローカルバッファにコピーし、
ローカルバッファ上で当該データベースレコードの更新
を行い、当該アプリケーションプログラム終了時に、デ
ータベースバッファ上の当該アプリケーションプログラ
ムが更新した当該データベースレコード全てに対して、
他アプリケーションプログラムから参照が不可能な排他
モードでの排他を確保し、データベースバッファ上の当
該データベースレコードをローカルバッファ上で更新し
たデータベースレコードに書き換え、当該データベース
レコードの排他を解除して、データベースレコードの更
新処理を終了することを特徴とするデータベース更新処
理方式。
1. Read multiple database records from a medium storing multiple database records into a database buffer in memory, and multiple application programs instruct each to exclude the database records and refer to the multiple database records individually. In the database system to be updated, a local buffer in the database buffer area dedicated to the application program is set for the application program that updates multiple database records, and the update processing of multiple database records of the application program is performed in the database to be updated. Secure exclusive access to the record in shared mode so that it can be referenced from other application programs, copy the database record from the database buffer to the local buffer,
The database record is updated on the local buffer, and when the application program ends, all the database records updated by the application program on the database buffer are updated.
Secures exclusion in exclusive mode that cannot be referenced from other application programs, rewrites the database record in the database buffer with the updated database record in the local buffer, cancels the exclusion of the database record, and A database update processing method characterized by terminating update processing.
JP2263323A 1990-10-01 1990-10-01 Data base updating processing system Pending JPH04139545A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2263323A JPH04139545A (en) 1990-10-01 1990-10-01 Data base updating processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2263323A JPH04139545A (en) 1990-10-01 1990-10-01 Data base updating processing system

Publications (1)

Publication Number Publication Date
JPH04139545A true JPH04139545A (en) 1992-05-13

Family

ID=17387881

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2263323A Pending JPH04139545A (en) 1990-10-01 1990-10-01 Data base updating processing system

Country Status (1)

Country Link
JP (1) JPH04139545A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06103129A (en) * 1992-08-03 1994-04-15 Internatl Business Mach Corp <Ibm> Method and device for data transfer
JPH09171482A (en) * 1995-12-20 1997-06-30 Nec Corp On-line updating system for multimedia information
JP2006277628A (en) * 2005-03-30 2006-10-12 Hitachi Systems & Services Ltd Database updating device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06103129A (en) * 1992-08-03 1994-04-15 Internatl Business Mach Corp <Ibm> Method and device for data transfer
JPH09171482A (en) * 1995-12-20 1997-06-30 Nec Corp On-line updating system for multimedia information
JP2006277628A (en) * 2005-03-30 2006-10-12 Hitachi Systems & Services Ltd Database updating device

Similar Documents

Publication Publication Date Title
US5255387A (en) Method and apparatus for concurrency control of shared data updates and queries
US7653791B2 (en) Realtime-safe read copy update with per-processor read/write locks
US5428783A (en) Lan based loosely coupled large grain parallel processing method
US20080040720A1 (en) Efficiently boosting priority of read-copy update readers in a real-time data processing system
JPH06187232A (en) Control method of access management of common data
JPH01188965A (en) Data processing
JPH0668736B2 (en) Apparatus and method for providing a cache memory unit with a write operation utilizing two system clock cycles
US5706511A (en) Data base system and load distribution control method
JPH08328933A (en) File access control system for parallel processing system
JPH04219844A (en) High-speed medium preferential release type exclusive system
JPH04284548A (en) Data base exclusive controlling system
JPH04139545A (en) Data base updating processing system
JPH05307478A (en) Constituting method for data base management system
JP3381079B2 (en) Exclusive control system using cache memory
JP2843748B2 (en) Exclusive control method
JP2704028B2 (en) File area management method
WO1993003436A1 (en) Method and apparatus for reducing lock period of shared buffer
JP3460265B2 (en) Data transfer method between computers
JP3511935B2 (en) File writing method in multi-thread program
JP2787107B2 (en) Buffer control system and device
JPH0346033A (en) Data transfer control method for inter-job
JPH0367342A (en) File access control method for operating system
CN117667869A (en) Global transaction concurrency control method, device and equipment
JPS61194548A (en) Exclusive control system for file access
JPH03218556A (en) Multitaskization system for intra-procedure loop