JP3970524B2 - Exclusive control method between multiple operations - Google Patents

Exclusive control method between multiple operations Download PDF

Info

Publication number
JP3970524B2
JP3970524B2 JP2001015919A JP2001015919A JP3970524B2 JP 3970524 B2 JP3970524 B2 JP 3970524B2 JP 2001015919 A JP2001015919 A JP 2001015919A JP 2001015919 A JP2001015919 A JP 2001015919A JP 3970524 B2 JP3970524 B2 JP 3970524B2
Authority
JP
Japan
Prior art keywords
exclusive control
update
data
terminal
key information
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
JP2001015919A
Other languages
Japanese (ja)
Other versions
JP2002215443A (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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2001015919A priority Critical patent/JP3970524B2/en
Publication of JP2002215443A publication Critical patent/JP2002215443A/en
Application granted granted Critical
Publication of JP3970524B2 publication Critical patent/JP3970524B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、複数の端末がデータベースを共有するシステムにおいて、夫々の端末が複数オペレーション操作で、またはバッチ処理でデータベースを更新する場合のデータベースの排他制御方法に係り、特に、排他範囲を最小限とすることによって端末などからの操作性向上およびバッチ処理の性能向上に関する。
【0002】
【従来の技術】
従来、排他制御方法として、例えば、特開平6−103143号公報,特開平4−248628号公報及び特開昭54−38730号公報に記載のものが知られている。
【0003】
特開平6−103143号公報に記載の技術は、データの利用要求に対し、利用宣言ファイルを作成し、その作成完了後一定時間待って作成した利用宣言ファイルが自己の利用要求に対するものであるかを確認させ、自己の利用要求に対するものであるときのみ、データの利用を許可することを特徴とする。
【0004】
また、特開平4−248628号公報に記載の技術は、まず、予め定められたファイル名のファイル作成処理を行ない、ファイルが作成できた場合のみ、該当する情報のアクセスを行なうことを特徴とする。
【0005】
さらに、特開昭54−38730号公報に記載の技術は、共有すべきファイルエリアを1つとし、処理装置毎にファイルを管理するフラグを持ち、他の処理装置のフラグを確認してフラグを立て、再度他の処理装置のフラグを確認してから、ファイルする2回確認により、ファイルの競合を避けるようにした点を特徴とする。
【0006】
【発明が解決しようとする課題】
しかしながら、上記特開平6−103143号公報に記載の技術は、データの利用を中止または終了する場合には、利用宣言ファイルを削除する必要があり、削除されない場合には、他の端末での利用ができないという問題がある。また、複数オペレーションに跨った操作の場合、これらオペレーションが完了するまで他の端末は長時間利用できないという問題がある。さらに、複数ファイルをアクセスする場合には、全てのファイルに対して宣言ファイルを作成する必要があり、利用するファイルが大量である場合には、排他時間が長くなるために、また、デッドロック防止のために、ユーザープログラムからのデータベースアクセス要求順序を統一する必要があり、処理が複雑化するという問題がある。
【0007】
上記特開平4−248628号公報や特開昭54−38730号公報に記載の技術も、前記と同様の問題がある。
【0008】
本発明の目的は、上記問題を解消するために、1つの端末で人の判断が入ることによる排他時間の長期化や操作中断があっても、排他待ちの発生がなくて他の端末での操作を可能とし、また、排他が発生しても、それによる待ち時間を最小にし、さらに、ユーザプログラムからのデータベースアクセス順序の統一を必要とせずに、デッドロックを防止することができるようにした複数オペレーション間の排他制御方法を提供することにある。
【0009】
【課題を解決するための手段】
上記目的を達成するために、本発明は、データベースとは別個に設けた排他制御監視テーブルに処理対象のデータのキー情報と管理情報を登録し、データベースとは異なる排他制御単位で排他制御を行なうようにしたものであり、以下の方式で実現する。
【0010】
データベース更新を前提とするデータベース参照の端末操作(参照/登録オペレーション)の延長で、更新する可能性のある全てのキー情報と管理情報をユーザープログラムが全て排他制御監視テーブル及び端末対応の一時記憶テーブルに登録し、データベース更新操作までこれら情報を引継ぐ。
【0011】
データベース更新を行なう端末操作(更新オペレーション)の延長で、データベース参照時に登録した排他制御監視テーブルの情報と端末対応の一時記憶テーブルに登録してある情報とを照合し、一致した場合、他の端末によるデータベース更新の操作がなかったものとしてデータベースの更新を行ない、不一致の場合には、他の端末によるデータベース更新があったとして、上記第1のオペレーションから端末操作を再度実行する。
【0012】
データベース更新後、排他制御監視テーブルに登録したレコード(上記のキー情報と管理情報の記録)を削除し、これにより、データベースの更新がなされた状態とする。
【0013】
【発明の実施の形態】
以下、本発明の実施形態を図面を用いて説明する。
【0014】
図1は本発明を用いたシステムの概略構成を示す構成図であって、1a,1b,……はDB(データベース)、2a,2b,……は端末、3は排他制御監視テーブル、4は一時記憶排他制御監視テーブル退避部、5はネットワークである。
【0015】
同図において、複数のDB1a,1b,……(なお、これらを総称してDB1という)や複数の端末2a,2b,……(なお、これらを総称して端末2という)が共通のネットワーク5を介して接続され、夫々の端末2a,2b,……がDB1a,1b,……の全てを共有している。端末2a,2b,……のいずれかがDB1a,1b,……のいずれかのデータを更新(追加,変更,削除など)する場合には(これを、以下、「データベース更新」という)、このデータを排他制御対象として、排他制御がなされ、そのとき、他の端末がこの同じデータを更新しようとしても、これを禁止する。
【0016】
ここで、これらDB1では、データ毎に異なるキーが設定されており、このキーを用いることによってDB1でのデータが指定され、これによってこのデータの更新(これをDBの更新という)が可能となるが、かかるDBの更新を行なうためには、更新を希望するデータ(更新対象データ)に対するキーが排他制御監視テーブル3に登録されていなければならない。従って、或る端末2が所望のデータを更新したいときに、これに対するキーが排他制御監視テーブル3に登録されていないときには、この端末2がこのキーと管理情報とを排他制御管理テーブル3に登録する。この管理情報は登録日時などを表わす情報であって、後述するように、排他制御監視テーブル3に登録されているキーが更新されたものであるか否かを判断するために用いられる。
【0017】
また、同じデータを他の端末2で更新する場合も、この更新対象データに対する同じキーが使用される。従って、或る端末2が所望のデータを更新したいときに、これに対するキーが他の端末2によって既に排他制御監視テーブル3に登録されているときには、これをもってこの端末2はこのキーに対するデータの更新が可能となる。
【0018】
さらに、端末2は、更新対象データを更新し終わると、排他制御管理テーブル3に登録されているこのデータに対するキーや管理情報をキャンセル(削除する)。これにより、同じデータを更新したい端末2が複数個ある場合、最初にこのデータを更新した端末2(例えば、端末2a)が排他制御管理テーブル3に登録されているキーをキャンセルする(なお、この端末2aがこのデータの更新を行なっている期間、この端末2aによって排他制御が行なわれているため、他の端末2、例えば、端末2bはこの同じデータの更新を行なうことができない)。このため、他の端末2bは、この同じデータを更新するためには、排他制御管理テーブル3に再度同じキーと管理情報とを登録する必要がある。
【0019】
各端末2は、所望データの更新を行なう場合、上記のように、この更新対象データに対するキーが排他制御管理テーブル3に登録されているか否かの確認を行なうが、これを、以下、「データベース参照」という。このデータベース参照では、端末2が、排他制御管理テーブル3で確認したキーと管理情報とを一時記憶するが、この記憶のために、一時記憶排他制御管理テーブル退避部4を有している。この一時記憶排他制御管理テーブル退避部4に一時記憶されたキーと管理情報とは、データベース更新のときに使用される。なお、以下では、かかる一時記憶排他制御管理テーブル退避部4は、夫々の端末2が有するようにする。
【0020】
図2は図1に示すシステムに用いる本発明による複数オペレーション間の排他制御方法の一実施形態を概略的に示す図であって、図1に対応する部分には同一符号をつけている。
ここでは、2つの端末2a,2bで、同じデータ(更新対象データ)に対し、データベースのデータ更新のオペレーションが行なわれるものとして説明する。
【0021】
図2において、DB1(図1)で所望データの更新(DB更新)を行なうためには、このDB更新を行なう端末2において、排他制御管理テーブル3を参照して対応するキーや管理情報の登録状態とする第1のオペレーション(これを、以下、参照/登録オペレーションという)と排他制御管理テーブル3が対応するキーや管理情報の登録状態にあることを確認してデータの更新を行なう第2のオペレーション(これを、以下、更新オペレーションという)が行なわれる。
【0022】
端末2aにおいては、オペレーション200aがオペレータ操作101による参照/登録オペレーションであり、オペレーション200bがオペレータ操作102に伴う更新オペレーションである。同様にして、端末2bにおいても、オペレーション300aがオペレータ操作104に伴う参照/登録オペレーションであり、オペレーション300bがオペレータ操作105に伴う更新オペレーションである。なお、オペレータ操作103,106は、後述するようにしてDB更新ができなかった場合の操作である。
【0023】
いま、端末2aにおいて、DB更新を行なう場合には、まず、オペレータ操作101が行なわれると、この端末2aと排他制御管理テーブル3との間で情報のやり取りを行なう参照/登録オペレーション200aが行なわれる。この参照/登録オペレーション200aは、端末2aで入力した更新対象データのキーが排他制御管理テーブル3に登録するための処理であって、入力されたキー毎にこの処理が行なわれ、排他制御管理テーブル3から登録されている更新対象データ毎のキーと管理情報(以下、これらをまとめてキー情報という)11,12を読み取って一時記憶排他制御管理テーブル退避部4に一時記憶するものである。なお、ここでは、更新対象データが2つあり、夫々に対応するキー情報11,12が排他制御管理テーブル3に登録されたものとしている。端末2aでは、一時記憶排他制御管理テーブル退避部4にこれらキー情報11,12が一時記憶される。
【0024】
なお、この参照/登録オペレーション200aでは、キー情報11,12を排他制御管理テーブル3に登録するときだけ、排他制御が掛かり、他の端末2は排他制御管理テーブル3にアクセスすることができない。
【0025】
以上のオペレータ操作101による参照/登録オペレーション200aが終了し、次のオペレータ操作102が行なわれると、同様にして、この端末2aと排他制御管理テーブル3との間で情報のやり取りとデータの更新のための更新オペレーション200bが行なわれる。この更新オペレーション200bは、このオペレータ操作102が行なわれたときに、一時記憶排他制御管理テーブル退避部4に一時記憶したキー情報11,12と同じものが排他制御管理テーブル3に登録されているか否かを確認し、登録されていれば、上記の更新対象データの更新を行なうものであり、登録されていなければ、あるいはまた、この更新オペレーションが行なわれる前に他の端末によって同じキー情報が排他制御管理テーブル3に登録されている(これを割込みというが、この場合、キーは同じであるが、管理情報が異なる)場合には、DB更新を行なうことができず、オペレータ操作103を行なうことにより、再度参照/登録オペレーション200aを行なうことができるようにになる(これを、以下、エラーリターンという)。端末2aは、所望データの更新を終了すると、これに対応するキー情報11,12を排他制御管理テーブル3から削除する。
【0026】
なお、このオペレータ操作102があってから更新オペレーション200bが終了する(即ち、データの更新が終了して排他制御管理テーブル3から対応するキー情報11,12を削除する、あるいは排他制御管理テーブル3に対応するキー情報11,12がないという確認が得られる)までは、この端末2aによって排他制御がなされ、この間他の端末2は排他制御管理テーブル3をアクセスすることができず、DB更新(キー情報の登録やデータの更新)をすることができない。
【0027】
他の端末2bについても同様であり、DB更新をする場合には、まず、オペレータ操作104が行なわれることにより、端末2aでの参照/登録オペレーション200aと同様の参照/登録オペレーション300aが行なわれ、排他制御管理テーブル3に登録されているキー情報11,12を一時記憶排他制御管理テーブル退避部4に一時記憶する。そして、オペレータ操作105が行なわれると、排他制御が掛かって端末2aでの更新オペレーション200bと同様の更新オペレーション300bが行なわれ、データの更新,排他制御管理テーブル3でのキー情報の削除、あるいはエラーリターンが行なわれる。
【0028】
次に、まず、端末2aでオペレータ操作101が行なわれ、これによる参照/登録オペレーション200aの終了後DB更新のオペレーションが中断し、その後オペレータ操作102が行なわれるが、この端末2aでのDB更新のオペレーションの中断期間内に端末2bでDB更新のオペレータ操作104,105が行なわれるものとして、図3により、この実施形態をさらに具体的に説明する。なお、図3では、図2に対応する部分に同一符号をつけている。
【0029】
同図において、端末2でカード(図示せず)を装着し、オペレータ操作101を行なうと、図2で説明したように、参照/登録オペレーション200aが行なわれる。ここで、一例として、このカードを社会保険証とすると、図4(a)に示すように、本人の年金番号Aとその家族の番号B,C,……が記憶されているものとし、かかる年金番号Aや家族番号B,C,……が上記のキーとして用いられるものとする。一方、DB1(図1)には、かかるキーに対して夫々本人や家族に関するデータが格納されているが、その一例として、図4(b)に示すように、DB1として、本人やその家族の職歴のデータがキー毎に区分して格納される職歴DB,同じく住所に関するデータがキー毎に区分されて格納される住所DB,同じく年金の支払い履歴のデータがキー毎に区分されて格納される支払いDBなどが設けられている。このように、DB1では、同じ個人のデータがこの個人に対するキーが付加されて格納されており、このキーを用いることにより、このキーに対応した個人の全てのデータに対して更新が可能となる。ここでは、かかる社会保険のデータの更新を例にして説明するものであるが、勿論この例のみに限るものではない。
【0030】
上記のように、端末2aに社会保険証が装着されてDB更新のためのオペレータ操作101が行なわれると、この社会保険証からキー(即ち、図4(a)に示す年金番号Aや家族番号B,C,……)が読み取られ(但し、ここでは、説明の都合上、社会保険証には年金番号Aと家族番号Bとの2つのキー(以下、夫々をキーA,Bという)が格納されており、これらが端末2aに読み取られるものとする)、参照/登録オペレーション200aとして、まず、排他制御監視テーブル3の参照(ステップ201)が行なわれる。これは、図5に示すように排他制御監視テーブル3に格納されているキー情報を読み取り、社会保険証から読み取った最初のキー(例えば、図4(a)に示す年金番号A)と照合するものである。このキーAを含むキー情報11が排他制御監視テーブル3に格納されていることが確認されると(即ち、「当該レコードがある」:ステップ202)、次のデータベース参照(即ち、DB更新のための排他制御監視テーブル3の参照)を行なう必要があるキーがあるか否かの確認し(ステップ204)、この場合、家族番号B(図4(a))としてのキーBが読み取られているので、このキーBについて、同様の排他制御監視テーブル3の参照(ステップ205)が行なわれる。また、キーAのキー情報11が排他制御監視テーブル3に格納されていないことが確認されたときには(即ち、「当該レコードがない」:ステップ202)、端末2aはこのキー情報11を排他制御管理テーブル3に登録し(ステップ203)、次のステップ204に進む。
【0031】
ステップ204で次のキーBがあることが認識されるので、このキーBについてステップ201と同様の排他制御管理テーブル3の参照を行ない(ステップ205)、このキーBを含むキー情報12が排他制御管理テーブル3に登録されていなければ(即ち、「当該レコードがない」:ステップ206)、このキー情報12を排他制御管理テーブル3に登録(ステップ207)してから、また、このキー情報12が排他制御管理テーブル3に登録されていれば(即ち、「当該レコードがある」:ステップ206)、直ちに、入力されたキーがもうないことを確認して(ステップ208)、排他制御管理テーブル3に登録された上記のキー情報11,12を、一時記憶排他制御監視テーブル退避部4に一時記憶する(ステップ209)。図6はこの一時記憶排他制御監視テーブル退避部4での記憶状態を摸式的に示したものである。
【0032】
以上のようにして、オペレータ操作101に対する参照/登録オペレーション200aが完了し、排他制御監視テーブル3と端末2aの一時記憶排他制御監視テーブル退避部4とに同じキー情報11,12が登録されることになる。
【0033】
ここで、端末2aで参照/登録オペレーション200aの完了後、直ちに所定のオペレータ操作102がなされると、次の更新オペレーション200bが実行される。この更新オペレーション200bでは、まず、排他制御管理テーブル3の参照が行なわれ(ステップ210)、この排他制御管理テーブル3に参照/登録オペレーション200aで登録したキー情報11,12がそのまま保持されているか否かの確認が行なわれる(ステップ211,212)。ここで、他の端末2による同じキーA,Bに対するDB更新がないものとすると、後述するように、排他制御管理テーブル3にキー情報11,12がそのまま保持されており、従って、これらキー情報11,12が存在し(即ち、「当該レコードがある」:ステップ211)、かつ後述する割込みが発生していない(ステップ212)として、これらキーAの昇順(即ち、連勤番号Aや家族番号Bの番号順)に、キーA,Bに対するデータの更新(変更,削除,追加など)がDB1(図1)で行なう(ステップ213)。この更新が終了すると、排他制御管理テーブル3の対象となったキー情報11,12の削除を行なう(ステップ214)とともに、一時記憶排他制御管理テーブル退避部4に一時記憶したキー情報11,12を削除し、排他制御を解除してDB更新を終了する。
【0034】
このようにして、DB1でキーA,Bに対するデータの更新を行なう場合、排他制御を掛けて行なうので、他の端末2はこのキーA,Bに関するデータについてDB1にアクセスすることができない。このため、当該端末2aでは、このキーA,Bのユーザプログラムによる順序を配慮することなく、DB1でのデータ更新を一括して行なうことができる。このような排他が掛けられない場合には、当該端末2aでキーA,Bのユーザプログラムによる順序を配慮することなくデータ更新を行なうと、他の端末2がDB更新のためにアクセスするデータと同じデータをアクセスする場合もあり、いわゆるデットロックが生じて処理が進まなくなる。しかし、この実施形態では、上記のことから、かかるデットロックを防止することもできる。
【0035】
ここで、DB1でのデータが、図4(b)に示すように、社会保険証の本人や家族の職歴や住所,年金支払い履歴(支払い金も含む)などの複数の項目からなる場合、ステップ213でのかかるデータの更新では、更新対象のキーに対する全てのデータがDBから読み取られるが、これら項目のいずれかまたは全部のデータを更新できるものであることはいうまでもない。
【0036】
一方、端末2aでオペレータ操作101が行なわれて参照/登録オペレーション200aの終了後、図7(a)に示すように、DB更新のための処理動作が中断し、この間に端末2bでオペレータ操作104によって上記と同じキーA,BについてのDB更新が開始された場合には、この端末2bでも、オペレータ操作104とともに、参照/登録オペレーション300aが行なわれる。この参照/登録オペレーション300aは端末2aでの上記の参照/登録オペレーション200aと同様である。なお、図7(a)では、図3に対応する部分には同一符号をつけている。
【0037】
端末2aは、かかる参照/登録オペレーション200aの実行中、キー情報11,12を排他制御管理テーブル3に登録する(ステップ203,207)とき以外のときには、及び端末2aの動作中断期間では、端末2aは排他制御を掛けていないので、他の端末2もこの排他制御管理テーブル3にアクセスすることができる。そこで、端末2aの動作の中断期間に端末2bで行なうDB更新が端末2aで上記のように行なったDB更新と同じデータ(年金番号Aと家族番号Bに対するデータ)に対するものであるときには、端末2bにおいては、オペレータ操作104で、端末2aと同様、キーA,Bが入力されることになる。そして、参照/登録オペレーション300aで排他制御管理テーブル3の参照を行なうのであるが(ステップ301)、このとき、既に端末2aによって排他制御管理テーブル3にこれらキーA,Bに対するキー情報11,12が登録されているので(ステップ302,306)、キーA,B以外にキーが入力されていないことを確認されてから(ステップ308)、これらキー情報11,12が端末2bの一時記憶排他制御管理テーブル退避部4に一時記憶されることになる(ステップ309)。
【0038】
このようにして、端末2bにおいても、参照/登録オペレーション300aが完了して一時記憶排他制御管理テーブル退避部4に排他制御管理テーブル3に登録されているのと同じキー情報11,12が一時記憶されていることになる。
【0039】
そして、この参照/登録オペレーション300aの終了後直ちにオペレータ操作105が行なわれ、このときも、まだ、端末2aが動作中断の状態にあるとすると、端末2bでは、これが排他制御を掛けて、このオペレータ操作105に伴う更新オペレーション300bが行なわれる。
【0040】
この更新オペレーション300bでは、まず、参照/登録オペレーション300aでのステップ301と同様の排他制御管理テーブル3の参照(ステップ310)が行なわれ、排他制御管理テーブル3に上記と同じキー情報11,12が保存されているかどうかの確認(ステップ311)と他の端末2による割込みがなされたか否かの判定(ステップ312)が行なわれる。この場合のステップ311の確認は、排他制御管理テーブル3から読み取ったキー情報11,12のキーA,Bと先に一時記憶排他制御監視テーブル退避部4に一時記憶したキー情報11,12のキーA,Bと対比することによって行なわれる。また、割込みの有無の確認(ステップ312)は、排他制御管理テーブル3から読み取ったキー情報の管理情報の内容を基に行なう。管理情報としては、キー情報を排他制御管理テーブル3に登録した日時の情報を含むものであり、他の端末2によって同じキーを用いた割込みがある場合には、管理情報が異なることになる。この点については、後述する。
【0041】
排他制御管理テーブル3中に同じキー情報11,12が保存され(即ち、「当該レコードがある」:ステップ311)、かつかかる割込みがないときには(ステップ312)、更新対象データ(即ち、キーA,Bに対するデータ)を更新し(ステップ313)、しかる後、排他制御管理テーブル3での使用したキー情報11,12を削除する(ステップ314)。これとともに、排他制御が解除される。
【0042】
このようにして、端末2aのDB更新の動作が中断しているときには、このDB更新の更新対象データのキーに対して排他制御が掛けられていないので、これと同じキーの更新対象データに対して、他の端末2bがDB更新を行なうことができる。当該端末2でDB更新を行なう場合、従来では、その最初のオペレータ操作からDB更新が終了するまで排他制御が掛けられるものであるから、このDB更新が終了するまで、他の端末2では、同じキーに対してDB更新をすることができず、当該端末2のDB更新が中断していつまでも再起動しないときには、他の端末2でDB更新をすることができなかったが、この実施形態では、他の端末でDB更新を行なうことができる。
【0043】
また、端末2aのDB更新の動作の中断が、このDB更新以外の操作をするためであってもよい。即ち、端末2aにおいて、オペレータ操作101の後、キーA,Bに対するDB更新以外の操作が必要となった場合、その操作を行なっても、DB更新の動作が中断するだけで、参照/登録オペレーション200aの結果がそのまま保持されており、その後、DB更新のためのオペレータ操作102が行なわれると、更新オペレーション200bが実行できることになる。
【0044】
端末2bでオペレータ操作105が行なわれた後に、端末2aでオペレータ操作102が行なわれて動作の中断が解除しても、端末2bによってキーA,Bに対して排他制御が掛けられているので、端末2aは、このオペレータ操作102に伴う更新オペレーション200bを実行することができず、端末2bが更新オペレーション300bを終了するまで待機する。
【0045】
その後、端末2bが更新オペレーション300bを終了して排他制御を解除すると、端末2aは更新オペレーション200bを開始する。この更新オペレーション200bでは、更新オペレーション300bと同様に、まず、排他制御が掛けられて排他制御管理テーブル3の参照を行なうが(ステップ210)、このとき、端末2bの更新オペレーション300bでのステップ314により、排他制御管理テーブル3でキー情報11,12が削除されているので、ステップ209で一時記憶排他制御管理テーブル退避部4に記憶されたキーA,Bが排他制御管理テーブル3に存在しない(即ち、「当該レコードがない」:ステップ211)と判定され、排他制御が解除されてオペレーション200a,200bの処理結果が全て無効となり、エラーリターンとしてユーザに通知される(ステップ215)。このときには、オペレータ操作103を行なうことにより、オペレータ操作101からのDB更新が再度できるようになる。
【0046】
このようにして、端末2aでDB更新の動作を中断しているときに、他の端末2bで同じ更新データに対してDB更新を行なった場合には、この端末2bによって端末2aが排他制御管理テーブル3に登録したキー情報が削除されるので、端末2aはDB更新の操作を最初から、即ち、オペレータ操作101から再度やり直させばよい。上記のデッドロックも防止できる。
【0047】
なお、以上の例では、端末2bのDB更新によって排他制御管理テーブル3でキー情報11,12が全て削除されたものとしたが、端末2bとしては、キーA,Bのうちいずれか1つ、例えば、キーAについてDB更新を行なう場合もある。この場合には、更新オペレーション300bでのステップ314でキー情報11のみが排他制御管理テーブル3から削除されることになるが、この場合でも、端末2aは、排他制御管理テーブル3に登録したものがキー情報11,12であるから、更新オペレーション200bにおいて、排他制御管理テーブル3からこれらキー情報11,12が参照されない限り、「当該レコードがない」と判定されて(ステップ211)、エラーリターンする(ステップ215)ことになる。
【0048】
また、端末2aにおいて、オペレータ操作101に対する参照/登録オペレーション200aの終了後、直ちにオペレータ操作102が行なわれた場合には、端末2aによって排他制御が掛けられて更新オペレーション200bが行なわれることになるから、他の端末2bでは、端末2aでの更新オペレーション200bが終了するまで、同じデータに対するDB更新を行なうことができない。従って、端末2a,2bのオペレーションの時間関係が上記とは逆になっている場合には、端末2bでの更新オペレーション300bにおいて、当該レコードがないことになるので(ステップ311)、エラーリターン(ステップ315)が行なわれる。
【0049】
図3は端末2aで参照/登録オペレーションの後次のオペレータ操作を中断している期間内に他の端末2bでDB更新が行なわれた場合を示すものであったが、図8は、図7(b)に示すように、端末2aでの上記中断期間中に、他の端末2bのDB更新に続いてさらに他の端末2cのDB更新が開始された場合を示すものである。この端末2cのDB更新が、端末2aに対して、後述するようにキー情報が変更されているので、割込みとなる。
【0050】
また、図8では、端末2aについては、オペレータ操作102とこれに伴う更新オペレーション200bのみを示し、また、この端末2aの動作の中断期間中に図3に示した端末2bのDB更新に続いて端末2cが実行するDB更新を示して、端末2bについては省略している。また、端末2cのDB更新のオペレーション400a,400bも、先に説明した端末2a,2bと同様のプログラムで実行されるものであるから、これらと重複する説明は省略する。
【0051】
図8において、端末2cで上記の更新対象データについてのDB更新のためのキーA,Bの入力を伴うオペレータ操作107がなされた時点では、端末2bの図3に示したDB更新により、排他制御管理テーブル3では、これらキーA,Bのキー情報11,12が削除されている。このために、このオペレータ操作107に伴う参照/登録オペレーション400aにおいては、排他制御監視テーブル3を参照しても(ステップ401)、キーA,Bを含むキー情報がないので(即ち、「当該レコードがない」:ステップ402,406)、これらキーA,Bを含むキー情報13,14を排他制御監視テーブル3に登録し(ステップ403,407)、さらに入力されたキーがないことを確認してから(ステップ408)、これらキー情報13,14を、図6に示したように、一時記憶排他制御監視データ退避部4に一時記憶する。勿論、この場合のキー情報13,14は、その管理情報が表わす日時がこのキー情報13,14の登録日時であるから、端末2aが参照/登録オペレータ200a(図3)で排他制御監視テーブル3に登録したキー情報11,12の管理情報の日時と異なる。
【0052】
このように端末2cによって排他制御監視テーブル3にキー情報13,14が登録されてから直ちにオペレータ操作108が行なわれると、端末2cで上記と同様の更新オペレーション400bが排他制御が掛けられて実行されるが、端末2cによって排他制御監視テーブル3にキー情報13,14が登録されてからこの端末2cでオペレータ操作108が行なわれるまでは、この端末2cによって排他制御が掛けられていないので、その間に端末2aでオペレータ操作102が行なわれると排他制御が掛けられて更新オペレーション200bが実行される。この更新オペレーション200bでは、上記のように、まず、排他制御管理テーブル3の参照が行なわれ(ステップ210)、この排他制御管理テーブル3から取り込んだキー情報13,14を一時記憶排他制御監視テーブル退避部4に記憶されているキー情報11,12と対比する。この場合、キー情報13,14のキーA,Bはキー情報11,12のキーA,Bと一致するが(即ち、「当該レコードがある」:ステップ211)、キー情報13,14とキー情報11,12とでの管理情報(日時)が異なるために、割込みが発生したと判定し(ステップ212)、排他制御が解除されてオペレーション200a,200bの処理結果が全て削除され、エラーリターンとしてユーザに通知される(ステップ215)。ユーザはオペレータ操作103を行なうことにより、オペレータ操作101からのDB更新が再度できるようになる。
【0053】
一方、端末2aでのかかる更新オペレーション200bが終了して排他制御が解除されるまで、端末2cは、例えオペレータ操作108が行なわれても、待機状態にある。そして、この排他制御が解除されると、端末2cは排他制御を掛けて更新オペレーション400bを実行する。この更新オペレーション400bは他の端末2a,2bでの更新オペレーション200b,300bと同様であり、キー情報13,14について更新対象データの更新が行なわれ(ステップ413)、排他制御管理テーブル3でのキー情報13,14の削除が行なわれ(ステツプ414)、さらに、排他制御が解除されてDB更新が完了する。
【0054】
なお、以上の例では、端末2cのDB更新で排他制御管理テーブル3にキーA,Bを含むキー情報13,14が登録されたものとしたが、端末2cとしては、キーA,Bのうちいずれか1つ、例えば、キーAについてのみDB更新を行なうために、これを含むキー情報13のみが排他制御管理テーブル3に登録される場合もある。しかし、この場合でも、端末2aでの更新オペレーション200bにおいて、上記と同様であり、このキー情報13自体が先のキー情報11と管理情報(日時)について異なるため、割込み発生あり(ステップ212)としてエラーリターンする(ステップ215)ことになる。排他制御管理テーブル3から読み込んだキー情報を一括してステップ211の処理を行ない、次いで、ステップ212の処理を行なうようにする場合には、キーBを含むキー情報14からないために、「当該レコードがない」と判定し(ステップ211)、エラーリターンする(ステップ215)ようにしてもよい。
【0055】
以上のように、この実施形態では、DB更新をする際、排他制御管理テーブル3へのキー情報の登録や更新オペレーションの実行のみに排他制御が掛けられ、排他制御が掛けられる範囲を必要最小限度にするものであるから、他の端末のDB更新の制約が緩和されることになるし、デッドロックも防止できる。DB更新オペレーションの進行中、他の操作が必要となった場合、このDB更新の動作を中断して他の操作をすることになるが、この中断中は排他制御が解除されているので、他の端末が同じDB更新を行なうことができることになる。
【0056】
また、DB更新が終了すると、排他制御管理テーブル3に登録されているキー情報を削除するようにしているが、これは、不要な情報が排他制御管理テーブル3に残ることを避けてその容量を有効に使用することができるようにするためであり、また、参照/登録オペレーション200a,300a,400aにおいて、排他制御管理テーブル3に所望とするキー情報が既に登録されていれば、新たにこのキー情報を登録することなく、この登録されているキー情報を使用するのは、同じキーのキー情報が重複して排他制御管理テーブル3に登録されないようにするためである。このため、自端末でキー情報を排他制御管理テーブル3に登録しても、自端末でのDB更新の中断中、他の端末でこのキー情報が使用されれば、もはやこのキー情報は他の端末のものとなり、従って、自端末は、再度キー情報を排他制御管理テーブル3に登録した状態としなければ、DB更新を行なうことができないのである。
【0057】
なお、見るだけのためにDB1からデータを読み出す場合には、上記のようなオペレーションは不要であり、直接DBにアクセスできるものである。
【0058】
また、図3,図8で説明した動作において、排他制御管理テーブル3にキーA,B以外のキーを含むキー情報が登録されても、これはキーA,Bを含むキー情報を対象とする端末2a〜2cには全く関係のないものである。
【0059】
図9は本発明による複数オペレーション間の排他制御方法の他の実施形態を示す図である。
【0060】
この実施形態は、バッチ形態に対するものであって、バッチ形態のデータ群の処理をバッチ処理のBMP(Batch Massege processing Program)からデータの入力毎に処理を実行するMPP(Message Processing Program)に移し、1処理単位毎に処理するデータを振り分けるものである。なお、この実施形態を用いるシステム構成も、図1に示す構成と同様である。
【0061】
図9において、図示しないが、バッチ処理の対象となる複数のデータからなるデータ群があって、夫々のデータを処理順にデータ1,データ2,データ3,……とする。これらデータは、先に説明した実施形態でのデータと同様、キーが異なる1以上のデータからなっているものとする。従って、例えば、更新対象データを社会保険証のデータとすると、夫々のデータ1,データ2,データ3,……は複数の個人のデータであって、この実施形態はこれらをバッチ処理するものであり、夫々のデータ1,データ2,データ3,……は、図4(a)にしたように、本人の年金番号Aや家族番号B,C,……といったキー番号を持つことになる。
【0062】
そこで、いま、図示しないセンタからの指示によってBMP501が起動してデータ1,データ2,データ3,……のバッチ処理が開始すると、まず、MPPが最初のデータ1を受け取り、図示するステップ201〜214、またはステップ201〜211,212,216からなるオペレーションが実行される。
【0063】
ここで、ステップ201〜ステップ209のオペレーションは先の実施形態での参照/登録オペレーション200a,300a,400aと同様であれ、また、ステップ210〜ステップ214のオペレーションは同じく更新オペレーション200b,300b,400bと同様である。この実施形態では、各データ1,データ2,データ3,……毎に順次かかるオペレーション201〜216が行なわれるのである。
【0064】
即ち、まず、データ1に対し、2つのキーA,Bがあるとすると、MPPにより、排他制御を掛けない状態で、排他制御管理テーブル3を参照し(ステップ201)、キーAがこの排他制御管理テーブル3に登録されているか否か確認し(ステップ202)、登録されていれば、排他制御管理テーブル3をそのままの状態とし、登録されていなければ、排他制御を掛けてこのキーAに対するキー情報11を排他制御管理テーブル3に登録し、排他制御を解除する。このようにして、排他制御管理テーブル3をキー情報11の登録状態とすると、次に、キーBに対して、ステップ204〜207により、排他制御管理テーブル3をこのキーBを含むキー情報12の登録状態とする。さらにキーがあれば(ステップ208)、夫々のキー毎に上記の動作を繰り返して排他制御管理テーブル3を夫々のキー情報の登録状態とする。
【0065】
このようにして、データ1の全てのキーについて、排他制御管理テーブル3を夫々のキー情報の登録状態とすると、登録状態とした排他制御管理テーブル3の全てのキー情報を一時記憶排他制御管理テーブル退避部4に一時記憶する(ステップ209)。
【0066】
以上が、キーA,Bについての先の実施形態での参照/登録オペレーションに相当するものであるが、次に、排他制御管理テーブル3に登録した上記のキー情報11,12に対して排他制御が掛けられ、排他制御管理テーブル3に登録されているキー情報11,12を昇順に読み込む参照を行ない(ステップ210)、一時記憶排他制御管理テーブル退避部4に一時記憶したキー情報11,12と照合する。
【0067】
この照合の結果、一時記憶排他制御管理テーブル退避部4に一時記憶したキー情報11,12と同じキー情報11,12が排他制御管理テーブル3に保持されていれば、他の端末でこのキー情報11,12が使用されておらず(ステップ211)、また、キーA,Bについて他の端末のDB更新の割込みがなかったものとし(ステップ212)、DB1でこのキーA,Bに対するデータの更新を行なう(ステップ213)。そして、かかるデータの更新が終了すると、排他制御管理テーブル3や一時記憶排他制御管理テーブル退避部4に登録したキー情報、即ち、キー情報11,12を削除し(ステップ214)、排他制御を解除してデータ1に対する更新処理が終了する。
【0068】
このようにして、データ1の更新処理が終了すると、次のデータ2について、ステップ201からのオペレーションが実行され、順次データ3,4,……の順で更新が行なわれる。
【0069】
ところで、ある端末2(以下、当該端末2という)で或るデータ(例えば、データ2とする)に対して以上のオペレーションの実行中、他の端末2によって同様のオペレーションが実行されて、当該端末2でのステップ210の実行開始前に(当該端末2による排他制御がかかっていない)当該端末2によって排他制御管理テーブル3に登録されたキー情報の少なくとも1つが削除もしくは割り込みされたとすると、この他の端末2による排他制御の解除後、当該端末2は排他制御管理テーブル3の参照(ステップ210)を開始するが、登録したキー情報の一部が排他制御管理テーブル3から削除されていたり(ステップ211)、割り込みがあるため(ステップ212)、このデータ2については更新が行なわれない。そして、このデータ2については、再処理の指示があって(ステップ216)、再度このオペレーションを最初から、即ち、ステップ201からし直すことになる。
【0070】
このようにして、この実施形態においても、バッチ処理するデータについて、キー情報を排他制御管理テーブル3に登録するときとステップ210からのデータ更新するときとの必要最小の範囲で排他制御がかかるようにしているので、バッチ処理する全てのデータの更新処理の最初から最後まで排他制御を掛ける場合に比べて、排他制御の期間が大幅に低減でき、他の端末2によるDB更新の実行を制約することが大幅に低減できることになる。
【0071】
なお、図9に示した実施形態において、複数のMPPを稼働させて複数のデータのDB更新を行なわせ、この処理が終了して空いたMPPに次のデータのDB更新を行なわせることにより、複数のデータの処理時間を大幅に短縮させることもできる。
【0072】
【発明の効果】
以上説明したように、本発明によれば、データベース更新において、排他制御管理テーブル参照の端末操作からデータ更新の端末操作までの間でデータベース排他を行なわないため、当該端末が長時間データベース更新の処理を完結できない場合でも、また、かかる処理を途中で止めた場合でも、他の端末が優先して処理を行なうことが可能となるし、操作の途中で全く別のオペレーションを行なうことが可能となり、端末の操作性が向上する。
【0073】
また、本発明によると、データベース更新の一般的規則は、データベース参照時に排他確保・データベース更新・排他解除であり、ユーザープログラムからのデータベースアクセス順序を統一しない場合、デッドロックを防止できないが、本発明によると、データベース更新での排他制御管理テーブル参照を排他を掛けずにで行ない、排他制御を掛けることが必要なデータの更新は一括して行なうものであるから、データベースアクセス時の排他範囲が最小限となる。
【0074】
さらに、本発明によると、データベース更新時の処理を一定順序で行なうことにより、デッドロックも防止できる。
【0075】
さらに、本発明によると、ユーザプログラムからのデータベースアクセス順序を厳しく制限することなく、業務開発が容易になる。
【図面の簡単な説明】
【図1】本発明による複数オペレーション間の排他制御方法が用いられるシステムの概略構成図である。
【図2】本発明による複数オペレーション間の排他制御方法の一実施形態を概略的に示す図である。
【図3】図2に示した実施形態をさらに具体的に示す図である。
【図4】図3に示した実施形態に用いるキーとこれに対するデータベースでのデータの一具体例を示す図である。
【図5】図1における排他制御管理テーブルの概略説明図である。
【図6】図1における一時記憶排他制御管理テーブル退避部の概略説明図である。
【図7】当該端末と他の端末とでのデータベース更新の処理タイミングの例を示す図である。
【図8】図2に示した実施形態の割込み発生の場合の処理を示す図である。
【図9】本発明による複数オペレーション間の排他制御方法の他の実施形態を概略的に示す図である。
【符号の説明】
1a,1b データベース
2a,2b 端末
3 排他制御管理テーブル
4 一時記憶排他制御管理テーブル退避部
5 ネットワーク
101〜109 オペレータ操作
200a,300a,400a 参照/登録オペレーション
200b,300b,400b 更新オペレーション
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a database exclusive control method in a system in which a plurality of terminals share a database and each terminal updates the database by a plurality of operation operations or by batch processing, and in particular, minimizes the exclusion range. By doing so, it relates to improvement in operability from a terminal and the like and improvement in performance of batch processing.
[0002]
[Prior art]
Conventionally, as exclusive control methods, for example, those described in JP-A-6-103143, JP-A-4-248628, and JP-A-54-38730 are known.
[0003]
In the technique described in Japanese Patent Laid-Open No. 6-103143, a usage declaration file is created in response to a data usage request, and whether the usage declaration file created after waiting for a certain period of time for the usage request is for its own usage request. It is characterized in that the use of data is permitted only when the request is for the use request of the user.
[0004]
The technique described in Japanese Patent Laid-Open No. 4-248628 is characterized in that first, a file creation process with a predetermined file name is performed, and the corresponding information is accessed only when the file can be created. .
[0005]
Furthermore, the technique described in Japanese Patent Application Laid-Open No. 54-38730 has one file area to be shared and has a flag for managing the file for each processing device, and checks the flag of the other processing device and sets the flag. It is characterized in that file conflict is avoided by confirming the flag of another processing apparatus again and then confirming the file twice.
[0006]
[Problems to be solved by the invention]
However, the technique described in Japanese Patent Laid-Open No. Hei 6-103143 requires the use declaration file to be deleted when the use of data is stopped or terminated. There is a problem that can not be. In addition, in the case of operations over a plurality of operations, there is a problem that other terminals cannot be used for a long time until these operations are completed. Furthermore, when accessing multiple files, it is necessary to create a declaration file for all the files. If there are a large number of files to be used, the exclusion time will be longer, and deadlock prevention will be performed. Therefore, it is necessary to unify the order of database access requests from the user program, and there is a problem that the processing becomes complicated.
[0007]
The techniques described in JP-A-4-248628 and JP-A-54-38730 also have the same problem as described above.
[0008]
The purpose of the present invention is to solve the above-described problem, even if the exclusion time is prolonged or the operation is interrupted due to the judgment of a person at one terminal, there is no occurrence of exclusion waiting, and there is no other terminal. Operation is possible, and even if exclusion occurs, the waiting time is minimized, and deadlock can be prevented without the need to unify the database access order from the user program. An object of the present invention is to provide an exclusive control method between a plurality of operations.
[0009]
[Means for Solving the Problems]
In order to achieve the above object, according to the present invention, key information and management information of processing target data are registered in an exclusive control monitoring table provided separately from a database, and exclusive control is performed in an exclusive control unit different from the database. This is realized by the following method.
[0010]
Terminal operation of database reference that assumes database update ( Browse / register operations The user program registers all the key information and management information that may be updated in the exclusive control monitoring table and the temporary storage table corresponding to the terminal, and takes over these information until the database update operation.
[0011]
Terminal operation to update the database ( update As a result of collating the information in the exclusive control monitoring table registered when referring to the database with the information registered in the temporary storage table corresponding to the terminal, if there is a match, there was no database update operation by another terminal. If the database is updated, the terminal operation is executed again from the first operation assuming that the database has been updated by another terminal.
[0012]
After updating the database, the record registered in the exclusive control monitoring table (recording of the above key information and management information) is deleted, so that the database is updated.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0014]
FIG. 1 is a configuration diagram showing a schematic configuration of a system using the present invention. 1a, 1b,... Are DB (database), 2a, 2b,. The temporary storage exclusive control monitoring table saving unit 5 is a network.
[0015]
In the figure, a common network 5 includes a plurality of DBs 1a, 1b, ... (collectively referred to as DB1) and a plurality of terminals 2a, 2b, ... (collectively referred to as terminals 2). .., And each terminal 2a, 2b,... Shares all of DB1a, 1b,. When any of the terminals 2a, 2b,... Updates (adds, changes, deletes, etc.) any of the data of DB1a, 1b,. Exclusive control is performed with data as an exclusive control target, and at this time, even if another terminal tries to update the same data, this is prohibited.
[0016]
Here, in these DB1, a different key is set for each data, and by using this key, data in DB1 is designated, and this data can be updated (this is called DB update). However, in order to update the DB, a key for the data (update target data) desired to be updated must be registered in the exclusive control monitoring table 3. Accordingly, when a certain terminal 2 wants to update desired data and the key for this is not registered in the exclusive control monitoring table 3, this terminal 2 registers this key and management information in the exclusive control management table 3. To do. This management information is information representing the registration date and time, and is used to determine whether or not the key registered in the exclusive control monitoring table 3 has been updated, as will be described later.
[0017]
In addition, when the same data is updated in another terminal 2, the same key for the update target data is used. Therefore, when a certain terminal 2 wants to update desired data and a key for this is already registered in the exclusive control monitoring table 3 by another terminal 2, this terminal 2 uses this to update the data for this key. Is possible.
[0018]
Furthermore, when the terminal 2 finishes updating the update target data, the terminal 2 cancels (deletes) the key and management information for this data registered in the exclusive control management table 3. Thereby, when there are a plurality of terminals 2 that want to update the same data, the terminal 2 (for example, the terminal 2a) that updated the data first cancels the key registered in the exclusive control management table 3 (Note that Since the exclusive control is performed by the terminal 2a while the terminal 2a is updating this data, the other terminal 2, for example, the terminal 2b cannot update the same data. Therefore, the other terminal 2b needs to register the same key and management information again in the exclusive control management table 3 in order to update the same data.
[0019]
When each terminal 2 updates the desired data, as described above, the terminal 2 checks whether or not the key for the update target data is registered in the exclusive control management table 3. Refer to ". In this database reference, the terminal 2 temporarily stores the key and management information confirmed in the exclusive control management table 3, and has a temporary storage exclusive control management table saving unit 4 for this storage. The key and management information temporarily stored in the temporary storage exclusive control management table saving unit 4 are used when updating the database. In the following description, the temporary storage exclusive control management table saving unit 4 is provided in each terminal 2.
[0020]
FIG. 2 is a diagram schematically showing an embodiment of an exclusive control method between a plurality of operations according to the present invention used in the system shown in FIG. 1, and the same reference numerals are given to portions corresponding to FIG.
Here, it is assumed that the data update operation of the database is performed on the same data (update target data) in the two terminals 2a and 2b.
[0021]
In FIG. 2, in order to update the desired data (DB update) in DB1 (FIG. 1), the corresponding key and management information are registered by referring to the exclusive control management table 3 in the terminal 2 that performs the DB update. A second operation for updating data after confirming that the first operation to be in a state (hereinafter referred to as a reference / registration operation) and the exclusive control management table 3 are in a corresponding key or management information registration state. An operation (hereinafter referred to as an update operation) is performed.
[0022]
In the terminal 2a, the operation 200a is a reference / registration operation by the operator operation 101, and the operation 200b is an update operation accompanying the operator operation 102. Similarly, in the terminal 2b, the operation 300a is a reference / registration operation accompanying the operator operation 104, and the operation 300b is an update operation accompanying the operator operation 105. The operator operations 103 and 106 are operations when the DB update cannot be performed as will be described later.
[0023]
When the terminal 2a performs DB update, first, when an operator operation 101 is performed, a reference / registration operation 200a for exchanging information between the terminal 2a and the exclusive control management table 3 is performed. . This reference / registration operation 200a is a process for registering the key of the update target data input at the terminal 2a in the exclusive control management table 3, and this process is performed for each input key, and the exclusive control management table 3, the keys and management information (hereinafter collectively referred to as key information) 11 and 12 for each update target data registered from 3 are read and temporarily stored in the temporary storage exclusive control management table saving unit 4. Here, it is assumed that there are two update target data, and the corresponding key information 11 and 12 is registered in the exclusive control management table 3. In the terminal 2a, the key information 11 and 12 are temporarily stored in the temporary storage exclusive control management table saving unit 4.
[0024]
In this reference / registration operation 200a, exclusive control is applied only when registering the key information 11 and 12 in the exclusive control management table 3, and other terminals 2 cannot access the exclusive control management table 3.
[0025]
When the reference / registration operation 200a by the operator operation 101 is completed and the next operator operation 102 is performed, the exchange of information and the update of data are similarly performed between the terminal 2a and the exclusive control management table 3. An update operation 200b is performed. In this update operation 200b, whether or not the same key information 11 and 12 temporarily stored in the temporary storage exclusive control management table saving unit 4 is registered in the exclusive control management table 3 when the operator operation 102 is performed. If it is registered, the above update target data is updated. If it is not registered, the same key information is exclusive by another terminal before this update operation is performed. If it is registered in the control management table 3 (this is called an interrupt, but in this case, the key is the same, but the management information is different), the DB cannot be updated and the operator operation 103 is performed. Thus, the reference / registration operation 200a can be performed again (hereinafter referred to as error return). That). When the terminal 2a finishes updating the desired data, the terminal 2a deletes the corresponding key information 11 and 12 from the exclusive control management table 3.
[0026]
Note that the update operation 200b ends after the operator operation 102 is present (that is, the data update is completed and the corresponding key information 11 and 12 is deleted from the exclusive control management table 3, or the exclusive control management table 3 Until the confirmation that there is no corresponding key information 11, 12 is obtained, exclusive control is performed by this terminal 2 a, during which other terminals 2 cannot access the exclusive control management table 3, and DB update (key Information registration and data update).
[0027]
The same applies to the other terminals 2b. When DB update is performed, first, the operator operation 104 is performed, so that the reference / registration operation 300a similar to the reference / registration operation 200a at the terminal 2a is performed. The key information 11 and 12 registered in the exclusive control management table 3 is temporarily stored in the temporary storage exclusive control management table saving unit 4. When the operator operation 105 is performed, the exclusive control is applied, and the update operation 300b similar to the update operation 200b in the terminal 2a is performed to update the data, delete the key information in the exclusive control management table 3, or an error. A return is made.
[0028]
Next, the operator operation 101 is first performed at the terminal 2a, and the DB update operation is interrupted after the reference / registration operation 200a is completed. Then, the operator operation 102 is performed, but the DB update at the terminal 2a is performed. This embodiment will be described more specifically with reference to FIG. 3, assuming that the DB update operator operations 104 and 105 are performed at the terminal 2b within the operation interruption period. In FIG. 3, the same reference numerals are given to the portions corresponding to FIG.
[0029]
In FIG. 2, when a card (not shown) is mounted at the terminal 2 and an operator operation 101 is performed, a reference / registration operation 200a is performed as described with reference to FIG. Here, as an example, if this card is a social insurance card, as shown in FIG. 4 (a), the person's pension number A and family numbers B, C,... Pension number A and family numbers B, C,... Are used as the above keys. On the other hand, DB1 (FIG. 1) stores data relating to the person and family for each of these keys. As an example, as shown in FIG. Work history DB in which work history data is stored separately for each key, Address DB in which data related to addresses are stored separately for each key, and pension payment history data are also stored separately for each key Payment DB etc. are provided. In this way, in DB1, the same individual data is stored with the key for this individual added, and by using this key, all of the individual data corresponding to this key can be updated. . Here, the update of such social insurance data will be described as an example, but the present invention is not limited to this example.
[0030]
As described above, when the social insurance card is attached to the terminal 2a and the operator operation 101 for updating the DB is performed, the key (ie, the pension number A and the family number shown in FIG. B, C,... Is read (however, for convenience of explanation, the social insurance card has two keys, pension number A and family number B (hereinafter referred to as keys A and B, respectively). As the reference / registration operation 200a, first, the exclusive control monitoring table 3 is referred (step 201). This reads the key information stored in the exclusive control monitoring table 3 as shown in FIG. 5 and collates it with the first key read from the social insurance card (for example, the pension number A shown in FIG. 4A). Is. When it is confirmed that the key information 11 including this key A is stored in the exclusive control monitoring table 3 (that is, “there is the record”: step 202), the next database reference (that is, for DB update) (See the exclusive control monitoring table 3) (step 204), and in this case, the key B as the family number B (FIG. 4A) is read. Therefore, the same exclusive control monitoring table 3 is referred to for this key B (step 205). When it is confirmed that the key information 11 of the key A is not stored in the exclusive control monitoring table 3 (that is, “there is no such record”: step 202), the terminal 2a manages the key information 11 with exclusive control management. Register in the table 3 (step 203) and proceed to the next step 204.
[0031]
Since it is recognized in step 204 that there is the next key B, the same exclusive control management table 3 as that in step 201 is referred to for this key B (step 205), and the key information 12 including this key B is exclusive controlled. If the key information 12 is not registered in the management table 3 (that is, “there is no such record”: step 206), the key information 12 is registered in the exclusive control management table 3 (step 207). If registered in the exclusive control management table 3 (that is, “there is the record”: step 206), it is immediately confirmed that there is no input key (step 208). The registered key information 11 and 12 are temporarily stored in the temporary storage exclusive control monitoring table saving unit 4 (step 209). FIG. 6 schematically shows the storage state in the temporary storage exclusive control monitoring table saving unit 4.
[0032]
As described above, the reference / registration operation 200a for the operator operation 101 is completed, and the same key information 11 and 12 is registered in the exclusive control monitoring table 3 and the temporary storage exclusive control monitoring table saving unit 4 of the terminal 2a. become.
[0033]
Here, when the predetermined operator operation 102 is performed immediately after the reference / registration operation 200a is completed at the terminal 2a, the next update operation 200b is executed. In the update operation 200b, the exclusive control management table 3 is first referred to (step 210), and whether or not the key information 11 and 12 registered in the exclusive control management table 3 by the reference / registration operation 200a is held as it is. Is confirmed (steps 211 and 212). Here, assuming that there is no DB update for the same keys A and B by other terminals 2, the key information 11 and 12 are held as they are in the exclusive control management table 3, as will be described later. 11 and 12 exist (that is, “there is the record”: step 211), and an interrupt described later does not occur (step 212). Ascending order of these keys A (that is, consecutive number A and family number) In order of B), data update (change, deletion, addition, etc.) for keys A and B is performed in DB1 (FIG. 1) (step 213). When this update is completed, the key information 11 and 12 which are the targets of the exclusive control management table 3 are deleted (step 214), and the key information 11 and 12 temporarily stored in the temporary storage exclusive control management table saving unit 4 is stored. Delete, release exclusive control, and end DB update.
[0034]
Thus, when updating the data for the keys A and B in the DB 1, since the exclusive control is applied, the other terminals 2 cannot access the DB 1 for the data related to the keys A and B. Therefore, in the terminal 2a, the data update in the DB 1 can be performed in a batch without considering the order of the keys A and B by the user program. When such exclusion cannot be applied, if the terminal 2a performs data update without considering the order of the user programs of the keys A and B, the data that other terminals 2 access for DB update In some cases, the same data is accessed, so-called deadlock occurs, and processing does not proceed. However, in this embodiment, it is possible to prevent such a deadlock from the above.
[0035]
Here, as shown in FIG. 4 (b), when the data in DB1 is composed of a plurality of items such as the social insurance card person's or family's work history and address, pension payment history (including payments), etc. In the data update in 213, all data for the update target key is read from the DB, but it goes without saying that any or all of these items can be updated.
[0036]
On the other hand, after the operator operation 101 is performed at the terminal 2a and the reference / registration operation 200a is completed, the processing operation for DB update is interrupted as shown in FIG. When the DB update for the same keys A and B as described above is started, the reference / registration operation 300a is performed together with the operator operation 104 on this terminal 2b. This reference / registration operation 300a is the same as the above-mentioned reference / registration operation 200a in the terminal 2a. In FIG. 7A, the same reference numerals are given to the portions corresponding to FIG.
[0037]
During the execution of the reference / registration operation 200a, the terminal 2a does not register the key information 11 and 12 in the exclusive control management table 3 (steps 203 and 207), and during the operation interruption period of the terminal 2a, the terminal 2a Since no exclusive control is applied, other terminals 2 can also access this exclusive control management table 3. Therefore, when the DB update performed at the terminal 2b during the interruption of the operation of the terminal 2a is for the same data as the DB update performed at the terminal 2a as described above (data for the pension number A and the family number B), the terminal 2b In this case, the keys A and B are input by the operator operation 104 as in the case of the terminal 2a. Then, the reference / registration operation 300a refers to the exclusive control management table 3 (step 301). At this time, the key information 11 and 12 for these keys A and B has already been stored in the exclusive control management table 3 by the terminal 2a. Since it is registered (steps 302 and 306), it is confirmed that no key is input other than the keys A and B (step 308), and these key information items 11 and 12 are stored in the temporary storage exclusive control management of the terminal 2b. It is temporarily stored in the table saving unit 4 (step 309).
[0038]
In this way, also in the terminal 2b, the same key information 11 and 12 that is registered in the exclusive control management table 3 in the temporary storage exclusive control management table saving unit 4 after the reference / registration operation 300a is completed is temporarily stored. Will be.
[0039]
Then, immediately after the end of the reference / registration operation 300a, the operator operation 105 is performed. At this time, if the terminal 2a is still in an operation interrupted state, the terminal 2b applies exclusive control, and this operator An update operation 300b accompanying the operation 105 is performed.
[0040]
In this update operation 300b, first, the exclusive control management table 3 is referred to (step 310) as in step 301 in the reference / registration operation 300a, and the same key information 11 and 12 as described above is stored in the exclusive control management table 3. It is confirmed whether or not it is saved (step 311) and whether or not an interruption by another terminal 2 has been made (step 312). In this case, the confirmation in step 311 is performed by checking the keys A and B of the key information 11 and 12 read from the exclusive control management table 3 and the keys of the key information 11 and 12 temporarily stored in the temporary storage exclusive control monitoring table saving unit 4 previously. This is done by comparing A and B. Further, the confirmation of the presence or absence of interruption (step 312) is performed based on the contents of the management information of the key information read from the exclusive control management table 3. The management information includes information on the date and time when the key information is registered in the exclusive control management table 3. If there is an interrupt using the same key by another terminal 2, the management information will be different. This point will be described later.
[0041]
When the same key information 11 and 12 is stored in the exclusive control management table 3 (that is, “there is the record”: step 311) and there is no such interruption (step 312), the update target data (that is, key A, (Data for B) is updated (step 313), and then the key information 11 and 12 used in the exclusive control management table 3 is deleted (step 314). At the same time, exclusive control is released.
[0042]
In this way, when the DB update operation of the terminal 2a is interrupted, the exclusive control is not applied to the key of the update target data of this DB update. The other terminal 2b can update the DB. When DB update is performed at the terminal 2, conventionally, since exclusive control is applied from the first operator operation until the DB update ends, the other terminals 2 keep the same until the DB update ends. When the DB update for the key cannot be performed and the DB update of the terminal 2 is interrupted and does not restart indefinitely, the DB update cannot be performed on the other terminals 2, but in this embodiment, DB update can be performed at other terminals.
[0043]
Further, the interruption of the DB update operation of the terminal 2a may be for performing an operation other than the DB update. That is, in the terminal 2a, when an operation other than the DB update for the keys A and B is required after the operator operation 101, even if the operation is performed, the DB update operation is only interrupted, and the reference / registration operation is performed. The result of 200a is held as it is, and when the operator operation 102 for DB update is performed thereafter, the update operation 200b can be executed.
[0044]
Even after the operator operation 105 is performed at the terminal 2b and the operator operation 102 is performed at the terminal 2a to cancel the interruption of the operation, the exclusive control is applied to the keys A and B by the terminal 2b. The terminal 2a cannot execute the update operation 200b accompanying the operator operation 102, and waits until the terminal 2b finishes the update operation 300b.
[0045]
Thereafter, when the terminal 2b ends the update operation 300b and releases the exclusive control, the terminal 2a starts the update operation 200b. In the update operation 200b, as in the update operation 300b, first, exclusive control is applied and the exclusive control management table 3 is referred to (step 210). At this time, the update operation 300b of the terminal 2b is in step 314. Since the key information 11 and 12 is deleted in the exclusive control management table 3, the keys A and B stored in the temporary storage exclusive control management table saving unit 4 in step 209 do not exist in the exclusive control management table 3 (that is, "There is no such record": Step 211), the exclusive control is canceled, and the processing results of the operations 200a and 200b are all invalidated and notified to the user as an error return (Step 215). At this time, by performing the operator operation 103, the DB update from the operator operation 101 can be performed again.
[0046]
In this way, when the DB update operation is interrupted at the terminal 2a and the DB update is performed on the same update data at the other terminal 2b, the terminal 2a causes the terminal 2a to perform exclusive control management. Since the key information registered in the table 3 is deleted, the terminal 2a may restart the DB update operation from the beginning, that is, the operator operation 101 again. The above deadlock can also be prevented.
[0047]
In the above example, the key information 11 and 12 are all deleted in the exclusive control management table 3 due to the DB update of the terminal 2b. However, the terminal 2b has one of the keys A and B, For example, the DB may be updated for the key A. In this case, only the key information 11 is deleted from the exclusive control management table 3 in step 314 in the update operation 300b. However, even in this case, the terminal 2a is registered in the exclusive control management table 3. Since the key information is 11 and 12, in the update operation 200b, unless the key information 11 and 12 is referred to from the exclusive control management table 3, it is determined that “there is no such record” (step 211), and an error is returned (step 211). Step 215).
[0048]
In addition, when the operator operation 102 is performed immediately after the end of the reference / registration operation 200a for the operator operation 101 in the terminal 2a, the terminal 2a performs exclusive control and the update operation 200b is performed. The other terminal 2b cannot perform the DB update for the same data until the update operation 200b at the terminal 2a is completed. Therefore, if the time relationship between the operations of the terminals 2a and 2b is opposite to the above, there is no record in the update operation 300b at the terminal 2b (step 311), so an error return (step 311). 315) is performed.
[0049]
FIG. 3 shows the case where the DB update is performed in the other terminal 2b within the period in which the next operator operation is interrupted after the reference / registration operation in the terminal 2a. As shown in (b), the DB update of the other terminal 2c is started after the DB update of the other terminal 2b during the interruption period in the terminal 2a. This DB update of the terminal 2c is an interrupt because the key information has been changed as will be described later with respect to the terminal 2a.
[0050]
Further, in FIG. 8, only the operator operation 102 and the accompanying update operation 200b are shown for the terminal 2a, and following the DB update of the terminal 2b shown in FIG. 3 during the operation interruption period of the terminal 2a. DB update executed by the terminal 2c is shown, and the terminal 2b is omitted. Further, since the DB update operations 400a and 400b of the terminal 2c are also executed by the same program as the terminals 2a and 2b described above, the description overlapping with these will be omitted.
[0051]
In FIG. 8, at the time when the operator operation 107 accompanied by the input of keys A and B for DB update for the update target data is performed on the terminal 2c, the exclusive control is performed by the DB update shown in FIG. 3 of the terminal 2b. In the management table 3, the key information 11 and 12 of these keys A and B are deleted. For this reason, in the reference / registration operation 400a accompanying the operator operation 107, even if the exclusive control monitoring table 3 is referred to (step 401), there is no key information including the keys A and B (that is, “the record concerned” ”: Steps 402 and 406), the key information 13 and 14 including these keys A and B are registered in the exclusive control monitoring table 3 (steps 403 and 407), and it is confirmed that there is no input key. (Step 408), the key information 13 and 14 are temporarily stored in the temporary storage exclusive control monitoring data saving unit 4 as shown in FIG. Of course, in this case, since the date and time indicated by the management information of the key information 13 and 14 is the registration date and time of the key information 13 and 14, the terminal 2a is the reference / registration operator 200a (FIG. 3) and the exclusive control monitoring table 3 Is different from the date and time of the management information of the key information 11 and 12 registered in.
[0052]
As described above, when the operator operation 108 is performed immediately after the key information 13 and 14 is registered in the exclusive control monitoring table 3 by the terminal 2c, the update operation 400b similar to the above is executed in the terminal 2c under the exclusive control. However, until the operator operation 108 is performed on the terminal 2c after the key information 13 and 14 is registered in the exclusive control monitoring table 3 by the terminal 2c, the exclusive control is not performed by the terminal 2c. When the operator operation 102 is performed at the terminal 2a, exclusive control is applied and the update operation 200b is executed. In the update operation 200b, as described above, the exclusive control management table 3 is first referred to (step 210), and the key information 13 and 14 fetched from the exclusive control management table 3 is temporarily saved in the exclusive storage exclusive control monitoring table. Contrast with the key information 11 and 12 stored in the section 4. In this case, the keys A and B of the key information 13 and 14 match the keys A and B of the key information 11 and 12 (that is, “there is the record”: step 211), but the key information 13 and 14 and the key information Since the management information (date and time) is different between 11 and 12, it is determined that an interrupt has occurred (step 212), the exclusive control is released, all the processing results of operations 200a and 200b are deleted, and the user returns as an error return. (Step 215). The user can update the DB from the operator operation 101 again by performing the operator operation 103.
[0053]
On the other hand, until such an update operation 200b at the terminal 2a is completed and the exclusive control is released, the terminal 2c is in a standby state even if the operator operation 108 is performed. When this exclusive control is released, the terminal 2c executes the update operation 400b with exclusive control. This update operation 400b is the same as the update operations 200b and 300b in the other terminals 2a and 2b, the update target data is updated for the key information 13 and 14 (step 413), and the key in the exclusive control management table 3 is updated. Information 13 and 14 are deleted (step 414), exclusive control is released, and DB update is completed.
[0054]
In the above example, the key information 13 and 14 including the keys A and B is registered in the exclusive control management table 3 by updating the DB of the terminal 2c, but the terminal 2c includes the keys A and B. In some cases, for example, only the key information 13 including the key information 13 is registered in the exclusive control management table 3 in order to update the DB only for the key A. However, even in this case, the update operation 200b at the terminal 2a is the same as described above, and the key information 13 itself is different from the previous key information 11 in terms of management information (date and time), so that an interrupt has occurred (step 212). An error is returned (step 215). When the key information read from the exclusive control management table 3 is collectively processed in step 211 and then in step 212, the key information 14 including the key B is not included. It may be determined that there is no record "(step 211) and return an error (step 215).
[0055]
As described above, in this embodiment, when updating the DB, exclusive control is applied only to registration of key information in the exclusive control management table 3 and execution of the update operation, and the range in which exclusive control can be applied is set to the minimum necessary level. Therefore, restrictions on DB update of other terminals are eased and deadlock can be prevented. If another operation becomes necessary while the DB update operation is in progress, this DB update operation will be interrupted and another operation will be performed. Terminals can perform the same DB update.
[0056]
Also, when the DB update is completed, the key information registered in the exclusive control management table 3 is deleted, but this is to avoid unnecessary information remaining in the exclusive control management table 3 and to increase its capacity. This is to enable effective use, and if the desired key information has already been registered in the exclusive control management table 3 in the reference / registration operations 200a, 300a, 400a, this key is newly added. The reason why the registered key information is used without registering the information is to prevent duplicate key information of the same key from being registered in the exclusive control management table 3. For this reason, even if the key information is registered in the exclusive control management table 3 in the own terminal, if this key information is used in another terminal while the DB update is interrupted in the own terminal, the key information is no longer stored in the other terminal. Therefore, the own terminal cannot update the DB unless the key information is again registered in the exclusive control management table 3.
[0057]
Note that when data is read from the DB 1 just for viewing, the above operation is not necessary, and the DB can be directly accessed.
[0058]
3 and 8, even if key information including keys other than the keys A and B is registered in the exclusive control management table 3, the key information including the keys A and B is targeted. The terminals 2a to 2c are completely unrelated.
[0059]
FIG. 9 is a diagram showing another embodiment of the exclusive control method between a plurality of operations according to the present invention.
[0060]
This embodiment is for a batch form. The process of a batch form data group is moved from a batch process BMP (Batch Massege processing Program) to an MPP (Message Processing Program) that executes a process for each input of data, Data to be processed is distributed for each processing unit. The system configuration using this embodiment is also the same as the configuration shown in FIG.
[0061]
In FIG. 9, although not shown, there is a data group consisting of a plurality of data to be subjected to batch processing, and each data is designated as data 1, data 2, data 3,. These data are assumed to be composed of one or more data having different keys, as in the data described in the above-described embodiment. Therefore, for example, if the data to be updated is social insurance card data, each of the data 1, data 2, data 3,... Is a plurality of individual data, and in this embodiment, these are batch processed. Yes, each data 1, data 2, data 3,... Has a key number such as the person's pension number A and family numbers B, C,... As shown in FIG.
[0062]
Therefore, when the BMP 501 is activated by an instruction from the center (not shown) and batch processing of data 1, data 2, data 3,... Starts, first, the MPP receives the first data 1 and steps 201 to 201 shown in the drawing. 214, or an operation consisting of steps 201 to 211, 212, and 216 is executed.
[0063]
Here, the operations from step 201 to step 209 are the same as the reference / registration operations 200a, 300a, and 400a in the previous embodiment, and the operations from step 210 to step 214 are the same as the update operations 200b, 300b, and 400b. It is the same. In this embodiment, the operations 201 to 216 are sequentially performed for each data 1, data 2, data 3,.
[0064]
That is, first, assuming that there are two keys A and B for data 1, the exclusive control management table 3 is referred to in a state where exclusive control is not applied by the MPP (step 201), and the key A is controlled by this exclusive control. It is confirmed whether or not it is registered in the management table 3 (step 202). If it is registered, the exclusive control management table 3 is left as it is. If not registered, the exclusive control is applied and the key for this key A is applied. The information 11 is registered in the exclusive control management table 3 and the exclusive control is released. When the exclusive control management table 3 is set to the registration state of the key information 11 in this way, the exclusive control management table 3 is then stored in the key information 12 including the key B by steps 204 to 207 with respect to the key B. Registered. If there are more keys (step 208), the above operation is repeated for each key to set the exclusive control management table 3 to the registration state of each key information.
[0065]
Thus, when the exclusive control management table 3 is set to the registration state of the respective key information for all the keys of the data 1, all the key information of the exclusive control management table 3 in the registered state is temporarily stored. Temporary storage is performed in the saving unit 4 (step 209).
[0066]
The above corresponds to the reference / registration operation in the previous embodiment for the keys A and B. Next, exclusive control is performed on the key information 11 and 12 registered in the exclusive control management table 3. The key information 11 and 12 registered in the exclusive control management table 3 is referred to in ascending order (step 210), and the key information 11 and 12 temporarily stored in the temporary storage exclusive control management table saving unit 4 Match.
[0067]
As a result of this collation, if the same key information 11 and 12 as the key information 11 and 12 temporarily stored in the temporary storage exclusive control management table saving unit 4 is held in the exclusive control management table 3, this key information is stored in another terminal. 11 and 12 are not used (step 211), and there is no interruption of DB update of other terminals for the keys A and B (step 212), and the data update for the keys A and B is performed in DB1. (Step 213). When the data update is completed, the key information registered in the exclusive control management table 3 and the temporary storage exclusive control management table saving unit 4, that is, the key information 11 and 12 is deleted (step 214), and the exclusive control is released. Then, the update process for data 1 is completed.
[0068]
In this way, when the update process of data 1 is completed, the operation from step 201 is executed for the next data 2, and the update is performed in the order of data 3, 4,.
[0069]
By the way, during execution of the above operation on certain data (for example, data 2) at a certain terminal 2 (hereinafter referred to as the terminal 2), the same operation is performed by the other terminal 2 and the terminal. If at least one of the key information registered in the exclusive control management table 3 is deleted or interrupted by the terminal 2 before the execution of step 210 in step 2 (exclusive control by the terminal 2 is not applied) After the exclusive control by the terminal 2 is released, the terminal 2 starts referencing the exclusive control management table 3 (step 210), but a part of the registered key information is deleted from the exclusive control management table 3 (step 210). 211) Since there is an interruption (step 212), the data 2 is not updated. For this data 2, there is an instruction for reprocessing (step 216), and this operation is started again from the beginning, that is, from step 201.
[0070]
Thus, in this embodiment as well, exclusive control is applied to the data to be batch-processed within the minimum necessary range when registering key information in the exclusive control management table 3 and when updating data from step 210. Therefore, compared to the case where exclusive control is applied from the beginning to the end of update processing of all data to be batch processed, the exclusive control period can be greatly reduced, and execution of DB update by other terminals 2 is restricted. Can be greatly reduced.
[0071]
In the embodiment shown in FIG. 9, a plurality of MPPs are operated to perform a DB update of a plurality of data, and an MPP which has been vacated after this process is completed performs a DB update of the next data, The processing time for a plurality of data can be greatly reduced.
[0072]
【The invention's effect】
As described above, according to the present invention, in database update, database exclusion is not performed between the terminal operation referring to the exclusive control management table and the terminal operation of data update. Even if the process cannot be completed, or even if such processing is stopped halfway, it becomes possible for other terminals to preferentially perform processing, and it is possible to perform completely different operations during operation, The operability of the terminal is improved.
[0073]
Further, according to the present invention, the general rules for database update are exclusive allocation, database update, and exclusive release when referring to the database, and if the database access order from the user program is not unified, deadlock cannot be prevented. According to the above, the exclusive control management table reference for database update is performed without exclusion, and data that needs to be exclusively controlled is updated all at once. It becomes the limit.
[0074]
Furthermore, according to the present invention, deadlock can also be prevented by performing processing at the time of database update in a certain order.
[0075]
Furthermore, according to the present invention, business development is facilitated without strictly restricting the database access order from the user program.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of a system in which an exclusive control method between a plurality of operations according to the present invention is used.
FIG. 2 is a diagram schematically illustrating an embodiment of an exclusive control method between a plurality of operations according to the present invention.
FIG. 3 is a diagram more specifically showing the embodiment shown in FIG. 2;
4 is a diagram showing a specific example of keys used in the embodiment shown in FIG. 3 and data in a database corresponding thereto. FIG.
FIG. 5 is a schematic explanatory diagram of an exclusive control management table in FIG. 1;
6 is a schematic explanatory diagram of a temporary storage exclusive control management table saving unit in FIG. 1; FIG.
FIG. 7 is a diagram illustrating an example of database update processing timing between the terminal and another terminal;
8 is a diagram showing processing in the case of occurrence of an interrupt according to the embodiment shown in FIG.
FIG. 9 is a diagram schematically illustrating another embodiment of an exclusive control method for a plurality of operations according to the present invention.
[Explanation of symbols]
1a, 1b database
2a, 2b terminal
3 Exclusive control management table
4 Temporary storage exclusive control management table save unit
5 network
101-109 Operator operation
200a, 300a, 400a Reference / registration operation
200b, 300b, 400b update operation

Claims (7)

複数の端末がネットワークを介してデータベースと排他制御監視テーブルとに接続され、該データベースでの同じデータを複数の該端末で共有するデータベース処理システムにおいて、
該排他制御監視テーブルを参照して該排他制御監視テーブルに該データに対するキーと管理情報とからなるキー情報を登録するための参照/登録オペレーションで、該排他制御監視テーブルに更新対象データのキー情報登録しておき該参照/登録オペレーションが終了した後、該データベースでのデータの更新を行なうための更新オペレーションで、排他制御監視テーブルに登録された該キー情報を確認することにより、該参照/登録オペレーションと該更新オペレーションとの間に他の端末からの更新要求の有無を判定し、登録された該キー情報が該排他制御管理テーブルに保存されているときのみ、該更新対象データの更新処理を完結させることを特徴とする複数オペレーション間の排他制御方法。
In a database processing system in which a plurality of terminals are connected to a database and an exclusive control monitoring table via a network, and the same data in the database is shared by the plurality of terminals.
Key information of data to be updated in the exclusive control monitoring table in a reference / registration operation for referring to the exclusive control monitoring table and registering key information including the key for the data and management information in the exclusive control monitoring table may be registered, and after the reference / registration operation is completed, the update operation for updating the data in the database, by checking the key information registered in the exclusive control monitoring table, the reference / Update the update target data only when it is determined whether there is an update request from another terminal between the registration operation and the update operation, and the registered key information is stored in the exclusive control management table An exclusive control method between a plurality of operations, characterized by completing a process.
請求項1において、
前記更新オペレーションで、排他制御監視テーブルに保存されているキー情報が前記登録されたキー情報と異なることが確認されたとき、前記参照/登録オペレーションと該更新オペレーションとの処理を取り消し、再度前記参照/登録オペレーションから実行させることにより、前記更新データの更新処理ができるようにしたことを特徴とする複数オペレーション間の排他制御方法。
In claim 1,
When it is confirmed in the update operation that the key information stored in the exclusive control monitoring table is different from the registered key information , the processing of the reference / registration operation and the update operation is canceled and the reference is performed again . An exclusive control method between a plurality of operations, wherein the update data can be updated by being executed from a registration operation .
請求項1または2において、
前記参照/登録オペレーションでは、データベース参照を無排他で行い、前記更新オペレーションのデータベース更新は前記更新対象データを他の端末による更新を禁止する排他制御対象として行うことにより、データベースアクセス時の排他範囲を最小限としたことを特徴とする複数オペレーション間の排他制御方法。
In claim 1 or 2,
In the reference / registration operation , the database reference is performed without exclusion, and the database update of the update operation is performed as an exclusive control target that prohibits update by other terminals, thereby reducing the exclusive range at the time of database access. An exclusive control method among a plurality of operations characterized by being minimized.
請求項1または2において、
前記更新オペレーションのデータベース更新を、前記更新対象データを他の端末による更新を禁止する排他制御対象として行なうことにより、ユーザプログラムからのデータベースへのアクセス順序を制限することなく、データベースアクセス順不一致によるデッドロックを防止することを特徴とする複数オペレーション間の排他制御方法。
In claim 1 or 2,
By performing the database update of the update operation as an exclusive control target that prohibits the update target data from being updated by other terminals , it is not possible to limit the access order to the database from the user program, and dead due to database access order mismatch An exclusive control method between a plurality of operations, wherein locking is prevented.
請求項1または2において、
バッチ処理の対象となるデータに対し、該処理対象データ毎に、前記排他制御監視テーブルを該処理対象データのキー情報と管理情報とからなるキー情報の登録状態とし、該処理データの更新に際し、前記排他制御監視管理テーブルに登録情報されている該キー情報を確認することにより、排他の期間を低減し、他の端末での操作と同時実行を可能にしたことを特徴とする排他制御方法。
In claim 1 or 2,
For the data subject to batch processing, for each piece of processing target data, the exclusive control monitoring table is set to a registration state of key information consisting of key information and management information of the processing target data, and when updating the processing data, An exclusive control method characterized in that by confirming the key information registered in the exclusive control monitoring management table, the exclusive period is reduced and simultaneous execution with an operation on another terminal is possible.
請求項1または2において、
前記排他制御管理テーブルは、排他制御管理専用のテーブルとして作成し、前記データベースとは異なる排他制御単位で管理することを特徴とする複数オペレーション間の排他制御方法。
In claim 1 or 2,
An exclusive control method between a plurality of operations, wherein the exclusive control management table is created as a table exclusive for exclusive control management and managed in an exclusive control unit different from the database.
請求項1または2において、
前記参照/登録オペレーションで前記排他制御監視テーブルに登録した処理対象データのキー情報と管理情報は、前記端末に関連付けて前記更新オペレーションまで一時記憶し、前記排他制御監視テーブルに登録されている情報との比較を行なうことを特徴とする複数オペレーション間の排他制御方法。
In claim 1 or 2,
The key information and management information of the processing target data registered in the exclusive control monitoring table by the reference / registration operation are temporarily stored in association with the terminal until the update operation, and the information registered in the exclusive control monitoring table A method for exclusive control between a plurality of operations, characterized by comparing the above.
JP2001015919A 2001-01-24 2001-01-24 Exclusive control method between multiple operations Expired - Lifetime JP3970524B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001015919A JP3970524B2 (en) 2001-01-24 2001-01-24 Exclusive control method between multiple operations

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001015919A JP3970524B2 (en) 2001-01-24 2001-01-24 Exclusive control method between multiple operations

Publications (2)

Publication Number Publication Date
JP2002215443A JP2002215443A (en) 2002-08-02
JP3970524B2 true JP3970524B2 (en) 2007-09-05

Family

ID=18882381

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001015919A Expired - Lifetime JP3970524B2 (en) 2001-01-24 2001-01-24 Exclusive control method between multiple operations

Country Status (1)

Country Link
JP (1) JP3970524B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4676192B2 (en) * 2004-12-02 2011-04-27 富士通株式会社 Client programs and clients
JP4486108B2 (en) * 2007-04-27 2010-06-23 株式会社大和証券グループ本社 Data processing system, terminal device and program
JP5431779B2 (en) * 2009-04-22 2014-03-05 日本電気株式会社 Information processing apparatus, information updating method, program, and information processing system
US20210110053A1 (en) * 2018-04-19 2021-04-15 Murata Machinery, Ltd. Exclusive control system and exclusive control method

Also Published As

Publication number Publication date
JP2002215443A (en) 2002-08-02

Similar Documents

Publication Publication Date Title
US8868577B2 (en) Generic database manipulator
US6850938B1 (en) Method and apparatus providing optimistic locking of shared computer resources
JP3512439B2 (en) Locking method in check-in / check-out model
CN101495976B (en) Direct-update software transactional memory
JPH11288428A (en) Cad system for team type design
JPH0785020A (en) Document managing method
JPH08328933A (en) File access control system for parallel processing system
US20030204504A1 (en) Access concurrency for cached authorization information in relational database systems
JP3970524B2 (en) Exclusive control method between multiple operations
JPH0468470A (en) Data sharing control system for cad system
JP5976779B2 (en) Cache memory structure and method
JPH1063557A (en) Distributed file synchronization system
JPH05307478A (en) Constituting method for data base management system
JPH08129492A (en) Resource exclusion checking system and resource exclusion checking method
JP3524270B2 (en) Parallel processing system
JP3475783B2 (en) Method for controlling sharing of database definition information between processes
JP3575236B2 (en) Database exclusive control method and system and storage medium storing database exclusive control program
JPH09269912A (en) Information processing method and information processor
JP3298904B2 (en) Supplementary service execution program management method
JPH08129501A (en) Reservation access processing method for data base
JPH07248950A (en) Linking method for updating of resource
JPH04282733A (en) Method for managing data base
JPH04190434A (en) Device and method for data base control
JP2600800B2 (en) Exclusive control of buffer table and deadlock detection method
JPH07191973A (en) Distributed linking method for combined document

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070124

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070130

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070329

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070529

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070606

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 3970524

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130615

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130615

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160615

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term