JPH06243014A - Data base system - Google Patents

Data base system

Info

Publication number
JPH06243014A
JPH06243014A JP5049905A JP4990593A JPH06243014A JP H06243014 A JPH06243014 A JP H06243014A JP 5049905 A JP5049905 A JP 5049905A JP 4990593 A JP4990593 A JP 4990593A JP H06243014 A JPH06243014 A JP H06243014A
Authority
JP
Japan
Prior art keywords
lock
database
record
locking
data
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
JP5049905A
Other languages
Japanese (ja)
Inventor
Yoshinori Kamimura
義則 上村
Tokuyuki Anzai
徳幸 安在
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP5049905A priority Critical patent/JPH06243014A/en
Publication of JPH06243014A publication Critical patent/JPH06243014A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To prevent the locking release omission of data, to reduce the waiting time for data reference during a locking and to prevent the deterioration in processing efficiency due to the locking of data. CONSTITUTION:A data base 34, a data base management part 33 receiving write/read/locking and locking release requests to the data base from a data base user and processing them, a locking time monitor timer 35' clocking up to the time designated at the time of the locking request from the locking start of a record by the locking request (locking operation instruction) and a locking time monitor part 35 informing the data base management part of time-out when the locking time monitor time 35' is timed out, are contained. The locking request can select/designate either a complete locking function inhibiting both read/write functions or a write locking function enabling reading and inhibiting writing.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、データベースシステム
のデータベースに対する読出し及び書込みをロックする
ロック機能に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a lock function for locking reading and writing in a database of a database system.

【0002】[0002]

【従来の技術】近年、データの論理性や操作性を向上さ
せるために、データをデータベースとして一元管理化す
るデータベースシステムが広く導入されるようになって
きた。以下、従来のデータベースシステムについて説明
する。
2. Description of the Related Art In recent years, in order to improve the logicality and operability of data, a database system for centrally managing data as a database has been widely introduced. The conventional database system will be described below.

【0003】従来、データベースシステムとしては、そ
の例として、図7のブロック図で示すような構成のもの
が採用されてきた。図7において、1はデータベースシ
ステムであり、2はデータベース使用者がデータベース
システム1に対して命令を入力し、データベースシステ
ム1からその応答を受けてそれを表示する入出力端末で
ある。
Conventionally, as a database system, for example, a system having a structure shown in the block diagram of FIG. 7 has been adopted. In FIG. 7, 1 is a database system, and 2 is an input / output terminal for a database user to input a command to the database system 1 and to receive a response from the database system 1 to display it.

【0004】3はデータベース使用者からのデータベー
スに対する操作要求を受けてそれを制御し処理するデー
タベース管理部、4はデータベース使用者のデータを論
理的に体系化し格納するデータベース、5は入出力端末
2とデータベース管理部3との間に接続され、入出力端
末2及びデータベース管理部3に対するデータの入出力
及びその制御を行う入出力制御部である。
Reference numeral 3 is a database management unit for receiving and controlling and processing a database operation request from a database user, 4 is a database for logically systematizing and storing data of the database user, and 5 is an input / output terminal 2. Is an input / output control unit that is connected between the input / output terminal 2 and the database management unit 3 and that controls the input / output of data to / from the input / output terminal 2 and the database management unit 3.

【0005】上記のデータベース管理部3、データベー
ス4、及び入出力制御部5はデータベースシステム1に
含まれるよう構成される。以下、このように構成された
従来のデータベースシステムの動作について説明する。
まず、データベース使用者は入出力端末2を使用してロ
グインの手続き、すなわちログイン手続を実行する。こ
のとき、データベース使用者は、ログイン手続を通して
使用者コードと呼ばれるデータベース使用者を識別する
ための管理番号を指定する。使用者コードは各データベ
ース使用者に対して唯一のものである。
The database management unit 3, the database 4, and the input / output control unit 5 are configured to be included in the database system 1. The operation of the conventional database system thus configured will be described below.
First, the database user uses the input / output terminal 2 to execute a login procedure, that is, a login procedure. At this time, the database user specifies a management number called a user code for identifying the database user through the login procedure. The user code is unique to each database user.

【0006】ログイン手続が終了すると、データベース
使用者はデータベースシステムからのデータベースサー
ビスを受けることができるようになる。データベース4
内の記憶領域はレコードと呼ばれる論理的な単位に分割
される。データベース4に格納されるデータはその種類
毎にグループ化され、レコード内に格納される。データ
ベース4内のデータに対する書込及び読出操作はレコー
ド単位で行われる。したがって、データベースシステム
1に対してデータの操作(書込み又は読出し等)を要求
する場合には、レコード番号と呼ばれるレコードを識別
するための情報(識別情報)を指定する。
When the login procedure is completed, the database user can receive the database service from the database system. Database 4
The internal storage area is divided into logical units called records. The data stored in the database 4 is grouped according to its type and stored in a record. Writing and reading operations for data in the database 4 are performed in record units. Therefore, when requesting a data operation (writing or reading, etc.) to the database system 1, information (identification information) called a record number for identifying a record is designated.

【0007】図8は上記データベース4内の内部構造の
概略を示す模式図である。図8において、6は上記の各
レコードに対するレコード番号(レコード1,レコード
2,レコード3,レコード4,…,レコードN)とデー
タ領域(7,8,9,10,…,N)との関係を示す対
応表であるレコードテーブルであって、例えば、レコー
ド1はデータ領域7に、レコード2はデータ領域8に、
及びレコードNはデータ領域Nに対応する識別情報が記
入されている。
FIG. 8 is a schematic diagram showing an outline of the internal structure in the database 4. In FIG. 8, reference numeral 6 represents the relationship between the record number (record 1, record 2, record 3, record 4, ..., Record N) and data area (7, 8, 9, 10, ..., N) for each of the above records. In the data area 7, the record 2 in the data area 8,
In the record N, identification information corresponding to the data area N is written.

【0008】下記表1は、データベース使用者が入出力
端末2に対して入力するデータベース4を操作するため
の操作を要求する操作命令の具体的な形式の例を示した
ものである。表1において、11はデータベース4を読
出す読出操作命令の形式であり、使用者コード、レコー
ド番号、及び読出データ長、の3つの情報をパラメータ
として指定する。同様に、12はデータベース4に対す
る書込みのための書込操作命令の形式であり、使用者コ
ード、レコード番号、及び書込データの3つの情報をパ
ラメータとして指定する。
[0008] Table 1 below shows an example of a specific format of an operation command for requesting an operation for operating the database 4 input by the database user to the input / output terminal 2. In Table 1, reference numeral 11 is a format of a read operation instruction for reading the database 4, and three pieces of information of a user code, a record number, and a read data length are designated as parameters. Similarly, 12 is a format of a write operation command for writing to the database 4, and three pieces of information of a user code, a record number, and write data are designated as parameters.

【0009】 表 1 読出操作命令“READ”: (使用者コード、レコード番号、読出データ長) ・・・11 書込操作命令“WRITE”: (使用者コード、レコード番号、書込データ) ・・・12 ロック操作命令“LOCK”: (使用者コード、レコード番号) ・・・13 ロック解除操作命令“UNLOCK”: (使用者コード、レコード番号) ・・・14 Table 1 Read operation command "READ": (User code, record number, read data length) ... 11 Write operation command "WRITE": (User code, record number, write data)・ 12 Lock operation command "LOCK": (User code, record number) ・ ・ ・ 13 Lock release operation command "UNLOCK": (User code, record number) ・ ・ ・ 14

【0010】更に、データベースシステム1には、デー
タベース4の更新作業が終了するまでの間、指定したレ
コードを他のデータベース使用者による操作から保護す
るためのロック機能が設けられる。
Further, the database system 1 is provided with a lock function for protecting the designated record from the operation by other database users until the updating work of the database 4 is completed.

【0011】表1において、13はデータベース4に対
するロック操作命令の形式であり、使用者コード及びレ
コード番号をパラメータとして指定する。同様に、14
はデータベース4に対するロック解除操作命令の形式で
あり、使用者コード及びレコード番号をパラメータとし
て指定する。
In Table 1, reference numeral 13 represents a format of a lock operation command for the database 4, which specifies a user code and a record number as parameters. Similarly, 14
Is a format of an unlock operation command for the database 4, and specifies a user code and a record number as parameters.

【0012】図9はデータベース管理部3に設けられ、
ロック操作に関する情報を記憶しておくためのロック情
報テーブルを示す図である。ロック情報テーブルには、
ロック中(ロック状態が設定されている)の場合にのみ
設定されているロック操作を要求したデータベース使用
者の使用者コード16と、レコード番号によって指定し
うる全レコードに対応するロック状態15とが記憶され
る。
FIG. 9 is provided in the database management unit 3,
It is a figure which shows the lock information table for storing the information regarding a lock operation. The lock information table contains
The user code 16 of the database user who requests the lock operation that is set only when the lock is set (the lock state is set) and the lock state 15 corresponding to all the records that can be specified by the record number Remembered.

【0013】以上説明したような従来のデータベースシ
ステム1では、データベース4内のデータを更新する
際、まず、そのデータをロックし、その後、データの書
込操作を行い、データの更新が終了した時点においてそ
のロックを解除するという手順に従ってデータを更新し
ていた。このロック機能により、更新又は変更途中では
そのデータを他のデータベース使用者が読出したり、書
込んだりすることを禁止することができる。
In the conventional database system 1 as described above, when updating the data in the database 4, first, the data is locked, and then the data write operation is performed, and when the data update is completed. The data was updated according to the procedure of unlocking the lock. With this lock function, it is possible to prohibit other database users from reading or writing the data during updating or changing.

【0014】図10は従来のデータベースシステム1に
おけるデータの読出処理を示すフローチャートであり、
図11は従来のデータベースシステム1におけるデータ
の書込処理を示すフローチャートである。すなわち、デ
ータベース管理部3は図10及び図11に示す手順に従
って読出処理及び書込処理を行なう。
FIG. 10 is a flow chart showing a data reading process in the conventional database system 1.
FIG. 11 is a flowchart showing a data writing process in the conventional database system 1. That is, the database management unit 3 performs the reading process and the writing process according to the procedure shown in FIGS.

【0015】以下、図10及び図11に基づき従来のデ
ータベースシステム1による読出処理及び書込処理につ
いて説明する。ログイン手続を終了したデータベース使
用者は表1の11に示すデータの読出操作命令を入出力
端末2から入力する。読出操作命令は読出すべきデータ
が格納されているレコードのレコード番号と、読出すデ
ータのサイズ(データ長)と、データベース使用者の使
用者コードとがパラメータとして含まれている。読出操
作命令はデータベースシステム1内の入出力制御部5を
経由してデータベース管理部3に通知される。
The reading process and the writing process by the conventional database system 1 will be described below with reference to FIGS. 10 and 11. The database user who has completed the login procedure inputs a data read operation command shown in 11 of Table 1 from the input / output terminal 2. The read operation command includes, as parameters, the record number of the record in which the data to be read is stored, the size (data length) of the data to be read, and the user code of the database user. The read operation command is notified to the database management unit 3 via the input / output control unit 5 in the database system 1.

【0016】図10のフローチャートにおいて、読出処
理に入ると、まず、ステップS61(図では、単にS6
1とする、以下同じ)において、読出操作命令を受けた
データベース管理部3は読出操作命令(表1の11)に
よって指定されたレコード番号を使用して、ロック情報
テーブル(図9)のそのレコード番号に該当するロック
状態の項目からそのレコードに対するロック情報を取得
する。そこで、ステップ62へ進み、今取得した該当す
るレコード番号のロック状態の項目にロック中の表示が
あるか否かを検査し、ロック中の表示がなければステッ
プ65へ進み、そこでレコード番号で指定されたデータ
ベース4のレコードからデータを読出し、再び入出力制
御部5を経由して読出したデータを入出力端末2に返送
し、そこで表示させる。更に、操作はステップ66へ進
み、“正常終了”の通知をして処理を終了する。
In the flowchart of FIG. 10, when the reading process is started, first, in step S61 (in the figure, simply S6 is performed).
1), the database management unit 3 that has received the read operation command uses the record number designated by the read operation command (11 in Table 1) to record that record in the lock information table (FIG. 9). The lock information for the record is acquired from the item in the lock status corresponding to the number. Therefore, the process proceeds to step 62, and it is checked whether or not there is a locked display in the item of the lock state of the corresponding record number that has just been acquired. If there is no locked display, the process proceeds to step 65 where the record number is designated. The data is read from the recorded record of the database 4, and the read data is sent back to the input / output terminal 2 via the input / output control unit 5 and displayed there. Further, the operation proceeds to step 66, notifies "normal end", and ends the process.

【0017】ステップ62において、指定されたレコー
ドがロック中であることが判明するとステップ63へ進
み、そこで使用者コードを検査する。使用者コードが自
己のものであれば、そのロックは自らが要求したもので
あるからステップ65へ進み、上記同様、レコード番号
で指定されたデータベース4のレコードからデータを読
出し、再び入出力制御部5を経由して読出したデータを
入出力端末2に返送し、そこで表示させる。操作はステ
ップ66へ進み、“正常終了”の通知をしてその処理を
終了する。
When it is determined in step 62 that the specified record is locked, the process proceeds to step 63, where the user code is checked. If the user code is his / her own, the lock is requested by himself / herself, and therefore the process proceeds to step 65, where the data is read from the record of the database 4 designated by the record number, and the input / output control unit is again executed. The data read via 5 is returned to the input / output terminal 2 and displayed there. The operation proceeds to step 66, notifies "normal end", and ends the processing.

【0018】ステップ63において(指定されたレコー
ドがロック中であることを意味する)、ロックを要求し
たものが他のデータベース使用者であることが判明する
と、ステップ64へ進み、指定されたレコードは“ロッ
ク中であるから読出しできない”ということを示すメッ
セージを入出力制御部5を経由して入出力端末2に通知
して表示させ、その読出操作を終了する。
If it is found in step 63 (meaning that the specified record is locked) that the person requesting the lock is another database user, the process proceeds to step 64 and the specified record is A message indicating that “reading is not possible because the lock is being performed” is notified to the input / output terminal 2 via the input / output control unit 5 to be displayed, and the reading operation is completed.

【0019】次に、図11のフローチャートに示す書込
処理について説明する。この書込処理は図10に示した
読出処理とほとんど同一であるが、ただ、異なる点は、
ステップ75において、レコード番号で指定されたデー
タベースのレコードからデータを読出す(ステップ6
5)代りにそこにデータを書込むことである。従って、
図11のフローチャートの全体的フローの説明は省略す
る。
Next, the writing process shown in the flowchart of FIG. 11 will be described. This writing process is almost the same as the reading process shown in FIG. 10, except that it is different.
In step 75, data is read from the record of the database designated by the record number (step 6
5) Instead, write the data there. Therefore,
Description of the overall flow of the flowchart of FIG. 11 is omitted.

【0020】以下、図12及び図13のフローチャート
に基づき、従来のデータベースシステムのロック処理及
びロック解除処理について説明する。図12において、
ロック処理は、ログイン手続を終了したデータベース使
用者が入出力端末2(図7)からデータのロック操作命
令(表1の13)を入力することにより開始し、ステッ
プ81へ進む。
The lock processing and unlock processing of the conventional database system will be described below with reference to the flowcharts of FIGS. 12 and 13. In FIG.
The locking process starts when the database user who has completed the login procedure inputs a data locking operation command (13 in Table 1) from the input / output terminal 2 (FIG. 7), and proceeds to step 81.

【0021】ロック操作命令は、前述のように、データ
が格納されているレコードのレコード番号と、データベ
ース使用者の使用者コードとを含むパラメータを所持
し、データベースシステム1の入出力制御部5を経由し
てデータベース管理部3に送信される。ロック操作命令
を受けたデータベース管理部5はその操作命令によって
指定されたレコード番号を使用して、ロック情報テーブ
ル(図9)のその番号に該当する項目(ロック状態)か
らロック情報を取得する(ステップ81)。
As described above, the lock operation command has parameters including the record number of the record in which the data is stored and the user code of the database user, and controls the input / output control unit 5 of the database system 1. It is transmitted to the database management unit 3 via the. The database management unit 5 that has received the lock operation instruction uses the record number designated by the operation instruction to acquire the lock information from the item (lock state) corresponding to the number in the lock information table (FIG. 9) ( Step 81).

【0022】そこで、ステップ82へ進み、レコード番
号で指定されたレコードにロック中の表示があるか否か
を検査し、ロック中の表示がなければステップ86へ進
み、図9のロック情報テーブルの指定されたレコード番
号の該当する項目に必要な状態を設定する。例えば、そ
のレコード番号のロック状態の項目に、“ロック中”の
文字又はそれを示す符号を記憶してステップ87へ進
む。ステップ87において、同じレコード番号の使用者
コードの項目にロックを要求した使用者の使用者コード
を記憶してステップ88へ進み、入出力制御部5を経由
してロック処理が“正常終了”したことを示すメッセー
ジを入出力端末2に通知して表示させ、その処理を終了
する。
Therefore, the routine proceeds to step 82, where it is checked whether or not the record designated by the record number has a locked display. If there is no locked display, the routine proceeds to step 86 and the lock information table of FIG. Set the required status for the corresponding item of the specified record number. For example, the character of "locked" or a code indicating the same is stored in the item of the lock state of the record number, and the process proceeds to step 87. In step 87, the user code of the user who requested the lock is stored in the item of the user code of the same record number, the process proceeds to step 88, and the lock process is “normally completed” via the input / output control unit 5. A message indicating that is notified to the input / output terminal 2 to be displayed, and the processing ends.

【0023】ステップ82において、指定されたレコー
ドがロック中であることが判明するとステップ83へ進
み、そこで使用者コードを検査する。使用者コードが自
己のものであれば、そのロックは自らが要求したもので
あるからステップ84へ進み、既に“ロック中”である
ことを示すメッセージを入出力制御部5を経由して入出
力端末2に通知し、そこで表示させる。
When it is determined in step 82 that the designated record is locked, the flow advances to step 83, where the user code is checked. If the user code is his / her own, the lock is requested by himself / herself, and therefore the process proceeds to step 84, where a message indicating that "locking" is already performed is input / output via the input / output control unit 5. Notify the terminal 2 and display it there.

【0024】ステップ83において(指定されたレコー
ドがロック中であることを意味する)、ロックを要求し
たものが他のデータベース使用者であることが判明する
とステップ85へ進み、入出力制御部5を経由して、指
定されたレコードは“他の使用者がロック中”であるこ
とを示すメッセージを入出力端末2に通知して表示さ
せ、その処理を終了する。
In step 83 (meaning that the specified record is locked), if it is found that the person who requested the lock is another database user, the process proceeds to step 85, in which the input / output control unit 5 is set. Via this, the designated record is notified to the input / output terminal 2 to display a message indicating that "another user is locked", and the processing is terminated.

【0025】次に、図13のフローチャートに示すロッ
ク解除処理について説明する。このロック解除処理は図
11に示したロック処理とほとんど同様であるが、次の
点で多少異なる。すなわち、ステップ92において、レ
コード番号で指定されたレコードにロック中の表示がな
い場合はステップ98へ進み、入出力制御部5を経由し
て“ロックされていない”を示すメッセージを入出力端
末2へ通知して表示させ、その処理を終了する。
Next, the unlocking process shown in the flowchart of FIG. 13 will be described. This lock release processing is almost the same as the lock processing shown in FIG. 11, but is slightly different in the following points. That is, in step 92, if the record designated by the record number does not indicate that the record is locked, the process proceeds to step 98, and a message indicating "unlocked" is issued via the input / output control unit 5 to the input / output terminal 2 To notify and display, and the process ends.

【0026】ステップ92において、指定されたレコー
ドがロック中であることが判明するとステップ93へ進
み、そこで使用者コードを検査する。使用者コードが自
己のものであれば、そのロックは自らが要求したもので
あるからステップ95へ進み、レコード番号で指定され
たロック情報テーブルのロック状態の項目における“ロ
ック中”の表示を消去してステップ96へ進む。ステッ
プ96においては、同じレコード番号で指定された使用
者コードの項目を消去してステップ97へ進み、ロック
解除処理が“正常終了”したことを示すメッセージを入
出力端末2に通知して表示させ、その処理を終了する。
When it is found in step 92 that the specified record is locked, the flow advances to step 93, where the user code is checked. If the user code is his own, the lock is requested by himself, so the process proceeds to step 95, and the display of "locked" in the locked item of the lock information table specified by the record number is erased. Then, it proceeds to step 96. In step 96, the user code item designated by the same record number is erased, and the flow advances to step 97 to notify the input / output terminal 2 of a message indicating that the lock release process is “normally completed” and display the message. , The process ends.

【0027】又、ステップ93において、ロックを要求
したものが他のデータベース使用者であることが判明す
ると、ステップ94へ進み、指定されたレコードは“他
の使用者がロック中”であることを示すメッセージを入
出力端末2に通知して表示し、その処理を終了する。
If it is found in step 93 that the person who requested the lock is another database user, the process proceeds to step 94, and the specified record indicates that "the other user is in the lock". The message shown is notified to the input / output terminal 2 and displayed, and the processing ends.

【0028】[0028]

【発明が解決しようとする課題】しかしながら、以上説
明した従来の構成においては、データベース使用者がデ
ータベースの更新等必要な操作を終了した後においても
ロック解除をせず、データベースが長期に亘りロック状
態に放置されたままになったような場合、ロック状態に
指定されたレコードは他のデータベース使用者による読
出し又は書込みができなくなる。そのため処理が遅延
し、場合によってはデータベースシステムがデッドロッ
クする事態となる可能性もあった。又、ロック中におい
ては、書込みをせず、レコードを参照するだけでよいデ
ータベース使用者であっても処理を停止せざるを得ず、
データベースサービスの処理効率を非常に低下させる原
因になるという問題があった。
However, in the conventional configuration described above, the database is not unlocked even after the database user has finished the necessary operation such as updating the database, and the database remains in the locked state for a long time. If left unattended, the record designated as locked cannot be read or written by other database users. Therefore, the processing was delayed, and in some cases, the database system could deadlock. Further, during the lock, even a database user who does not need to write and only needs to refer to the record has to stop the processing.
There is a problem that it causes a great decrease in the processing efficiency of the database service.

【0029】従って、本発明の目的は、データベースの
ロック解除漏れがあった場合にはそれを検出して自動的
(強制的)にロック解除することを可能にし、又、ロッ
ク中であってもデータの参照を可能にして、データサー
ビスの処理効率の低下防止を図ることである。
Therefore, an object of the present invention is to make it possible to detect a lock release omission in the database and automatically (compulsively) release the lock if the lock release omission occurs. This is to make it possible to refer to the data and prevent the deterioration of the processing efficiency of the data service.

【0030】[0030]

【課題を解決するための手段】本発明によるデータベー
スシステムは、上記の目的を達成するため、第1に、デ
ータベースの各レコード番号に対応するレコードのロッ
ク設定からロック解除までの時間を監視するロック時間
監視部を設け、ロック状態のまま所定のロック時間が経
過した後は自動的にロック解除してそれを表示すること
とし、第2に、ロック機能として書込みと読出しの両機
能を禁止する完全ロックと、読出しは可能であり書込み
のみを禁止するライトロックの2つのロック機能を備え
たことを特徴とする。
In order to achieve the above-mentioned object, the database system according to the present invention firstly provides a lock for monitoring the time from the lock setting to the lock release of the record corresponding to each record number in the database. A time monitoring unit is provided to automatically release the lock and display it after a predetermined lock time has elapsed in the locked state. Second, a complete lock function that prohibits both writing and reading functions. It is characterized by having two lock functions, a lock and a write lock that allows reading but prohibits only writing.

【0031】[0031]

【作用】本発明により、データベースの特定のレコード
をロックしたときに時間を指定してタイマを設定し、指
定時間がタイムアウトしたときにそのレコードはロック
解除漏れとみなして自動的にそのロックを解除すること
により、不当に長いロック状態の放置を防止し、更に、
ライトロックを指定することにより、ロック状態中であ
っても他のデータベース使用者からの読出操作を可能に
してデータベースサービスの処理効率の向上を可能にす
る。
According to the present invention, when a particular record in the database is locked, a timer is set by designating the time, and when the designated time expires, the record is regarded as an unlock failure and the lock is automatically released. By doing so, it prevents the lock state from being left unreasonably long, and
By designating the write lock, it is possible to perform a read operation from another database user even in the locked state and improve the processing efficiency of the database service.

【0032】[0032]

【実施例】以下、添付図面に基づき本発明の一実施例に
よるデータベースシステムについて詳細に説明する。図
1は本発明の一実施例によるデータベースシステムの構
成を示すブロック図である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A database system according to an embodiment of the present invention will be described in detail below with reference to the accompanying drawings. FIG. 1 is a block diagram showing the configuration of a database system according to an embodiment of the present invention.

【0033】図1において、31は本発明によるデータ
ベースシステムであり、32はデータベース使用者がデ
ータベースシステム31に対して命令を入力し、データ
ベースシステム31からその応答を受信してそれを表示
する入出力端末である。33はデータベース使用者から
のデータベースに対する操作要求を受けてそれを制御し
処理するデータベース管理部である。
In FIG. 1, 31 is a database system according to the present invention, and 32 is an input / output for a database user to input a command to the database system 31, receive a response from the database system 31 and display it. It is a terminal. Reference numeral 33 is a database management unit that receives a database operation request from a database user and controls and processes it.

【0034】34はデータベース使用者のデータを論理
的に体系化し格納するデータベース、35′はロック操
作命令で指定されたデータベースのレコードのロック開
始からロック操作命令により指定された時間まで刻時す
るロック時間監視タイマ、35は指定されたレコードの
ロック開始から解除までの時間をロック時間監視タイマ
35′で監視し、ロック解除されたときにはその監視を
停止し、指定された時間経過後までロック解除されなか
った場合にはその監視を停止すると共にデータベース管
理部33にそれを通知して強制的にロック解除させるよ
うにするロック時間監視部、36は入出力端末32とデ
ータベース管理部33との間に接続され、その間のデー
タの入出力及び制御を行う入出力制御部である。
Reference numeral 34 is a database which logically systematizes and stores the data of the database user, and 35 'is a lock which keeps time from the lock start of the record of the database designated by the lock operation command to the time designated by the lock operation command. The time monitoring timer 35 monitors the time from the lock start to release of the designated record by the lock time monitoring timer 35 '. When the lock is released, the monitoring is stopped and the lock is released until after the designated time elapses. If not, a lock time monitoring unit for stopping the monitoring and notifying it to the database management unit 33 to forcibly release the lock, 36 is provided between the input / output terminal 32 and the database management unit 33. It is an input / output control unit that is connected and performs input / output and control of data between them.

【0035】本実施例においては、データベース管理部
33、データベース34、ロック時間監視部35及び入
出力制御部36はデータベースシステム31に含まれる
構成とされる。しかし、それらはデータベースシステム
の外部構成としてもよい。更に、データベースシステム
31が具備するロック機能には、書込みと読出しの両機
能を禁止する完全ロックと、読出しは可能であり、書込
みのみを禁止するライトロックの2つのロック機能を備
えている。
In this embodiment, the database management unit 33, the database 34, the lock time monitoring unit 35, and the input / output control unit 36 are included in the database system 31. However, they may be external to the database system. Further, the lock function of the database system 31 has two lock functions: a complete lock that prohibits both writing and reading functions, and a write lock that allows reading but only writing.

【0036】次に、以上のように構成された本発明の一
実施例によるデータベースシステムの動作について説明
する。まず、データベース使用者は前述の従来例と同
様、入出力端末32を使用してログイン手続を実行す
る。このとき、データベース使用者は、ログイン手続を
通して使用者コードを指定し、それをログインする。ロ
グイン手続が終了すると、データベース使用者はデータ
ベースシステムからのデータベースサービスを受けるこ
とができるようになる。
Next, the operation of the database system according to the embodiment of the present invention constructed as described above will be explained. First, the database user uses the input / output terminal 32 to execute the login procedure as in the conventional example described above. At this time, the database user specifies the user code through the login procedure and logs in. When the login procedure is completed, the database user can receive the database service from the database system.

【0037】データベース34は従来例と同様、複数の
レコードから構成されており、例えば、図8に示すよう
な構成としてよい。又、データベース34のデータに対
する書込及び読出操作はレコード番号で指定するレコー
ド単位で行れることなどは前述の従来例と同様である。
The database 34 is composed of a plurality of records as in the conventional example, and may be structured as shown in FIG. 8, for example. Further, the writing and reading operations for the data of the database 34 can be performed in the record unit designated by the record number, as in the above-mentioned conventional example.

【0038】下記表2はデータベース使用者が入出力端
末32に入力するデータベース34の操作を要求する操
作命令の形式を例示したものである。表2において、3
7はデータベース34を読出す読出操作命令の形式であ
り、使用者コード、レコード番号、及び読出データ長、
の3つの情報をパラメータとして指定する。同様に、3
8はデータベース34に対する書込みのための書込操作
命令の形式であり、使用者コード、レコード番号、及び
書込データの3つの情報をパラメータとして指定する。
Table 2 below shows an example of the format of the operation command input to the input / output terminal 32 by the database user to request the operation of the database 34. In Table 2, 3
Reference numeral 7 denotes a read operation command format for reading the database 34, which includes a user code, a record number, and a read data length.
The three types of information are specified as parameters. Similarly, 3
Reference numeral 8 is a format of a write operation command for writing to the database 34, and specifies three pieces of information of a user code, a record number, and write data as parameters.

【0039】 表 2 読出操作命令“READ”: (使用者コード、レコード番号、読出データ長) ・・・37 書込操作命令“WRITE”: (使用者コード、レコード番号、書込データ) ・・・38 ロック操作命令“LOCK”: (使用者コード、レコード番号、ロック方法、ロック時間)・・・39 ロック解除操作命令“UNLOCK”: (使用者コード、レコード番号) ・・・40 Table 2 Read Operation Command "READ": (User Code, Record Number, Read Data Length) ... 37 Write Operation Command "WRITE": (User Code, Record Number, Write Data) ... -38 Lock operation command "LOCK": (User code, record number, locking method, lock time) ... 39 Lock release operation command "UNLOCK": (User code, record number) ... 40

【0040】更に、データベースシステム31にはデー
タベース34の更新作業が終了するまでの間、指定した
レコードを他のデータベース使用者による操作から保護
するためのロック機能が設けられる。本発明によるロッ
ク機能として、以下で説明する実施例で示すように、デ
ータベースシステム31には2つのロック機能が設けら
れる。その1つは、指定したレコードを他のデータベー
ス使用者による操作から保護するために書込みと読出し
の両方を禁止する完全ロックであり、他方は読出しは可
能であるが書込みは禁止するライトロックである。
Further, the database system 31 is provided with a lock function for protecting the designated record from the operation by another database user until the update work of the database 34 is completed. As the lock function according to the present invention, as shown in the embodiments described below, the database system 31 is provided with two lock functions. One is a full lock that prohibits both writing and reading to protect the specified record from manipulation by other database users, and the other is a write lock that allows reading but prohibits writing. .

【0041】その各ロック機能を指定するため、本発明
によるロック操作命令には、2の39で示すようなデ
ータベース34に対するロック操作命令の形式をとる。
このロック操作命令では、使用者コード及びレコード番
号のほか、レコードのロック方法及びロック時間を追加
した4つの情報がパラメータとして指定される。又、4
0はデータベース34に対するロック解除操作命令の形
式であり、使用者コード及びレコード番号をパラメータ
として指定するべきことは前述の従来技術の例と同様で
ある。
In order to specify each of the lock functions, the lock operation instruction according to the present invention takes the form of the lock operation instruction for the database 34 as indicated by 39 in Table 2.
In this lock operation command, in addition to the user code and record number, four pieces of information in which a record lock method and lock time are added are designated as parameters. Again 4
0 is the format of the unlock operation command for the database 34, and the user code and the record number should be specified as parameters, as in the case of the prior art described above.

【0042】図2はデータベース管理部33に設けら
れ、ロック操作に関する情報を記憶しておくためのロッ
ク情報テーブルを示す図である。ロック情報テーブルに
は、レコード番号によって指定しうる全レコードのロッ
ク状態、すなわち、完全ロック中かライトロック中の表
示41と、いずれかのロック中の場合にのみ記録するロ
ック操作を要求したデータベース使用者の使用者コード
42と、本発明によるロック要求の有効時間を示すロッ
ク時間43とが記憶される。
FIG. 2 is a diagram showing a lock information table provided in the database management unit 33 for storing information on lock operations. In the lock information table, the lock status of all the records that can be specified by the record number, that is, a display 41 indicating that the record is completely locked or write locked, and a database requesting a lock operation to be recorded only when either lock is used The user code 42 of the person and the lock time 43 indicating the valid time of the lock request according to the present invention are stored.

【0043】本発明の一実施例によるデータベースシス
テム31では、データベース34内のデータを更新する
際、まず、そのレコード又はデータをロックし、その
後、データの書込操作を行い、データの更新が終了した
時点でそのロックを解除するという処理手順に従ってデ
ータを更新するよう操作する。このロック機能の作用に
より、変更途中のデータに対し他のデータベース使用者
が書き込むことを防止して、そのような防止機能がない
ことによって発生するかもしれないデータの論理矛盾の
発生を防止する。
In the database system 31 according to the embodiment of the present invention, when updating the data in the database 34, first, the record or the data is locked, and then the data write operation is performed to complete the data update. At that time, the data is updated according to the processing procedure of releasing the lock. By the action of this lock function, other database users are prevented from writing to the data that is being changed, and the occurrence of logical inconsistency of data that may occur due to the absence of such a prevention function is prevented.

【0044】図3は本発明の一実施例によるデータベー
スシステム31におけるデータベース34からのデータ
の読出処理を示すフローチャートであり、図4はデータ
ベース34に対するデータの書込処理を示すフローチャ
ートである。すなわち、データベース管理部33は図3
及び図4に示す手順に従って読出処理及び書込処理を実
行する。
FIG. 3 is a flow chart showing a process of reading data from the database 34 in the database system 31 according to one embodiment of the present invention, and FIG. 4 is a flow chart showing a process of writing data to the database 34. That is, the database management unit 33 is shown in FIG.
The read process and the write process are executed according to the procedure shown in FIG.

【0045】以下、図3及び図4のフローチャートに基
づき、本発明の一実施例によるデータベースシステム3
1の読出処理及び書込処理を詳細に説明する。ログイン
手続きを終了したデータベース使用者は表2の37に示
すデータの読出操作命令を入出力端末32から入力す
る。読出操作命令はデータベース34から読出すべきデ
ータが格納されているレコードのレコード番号と、読出
すべきデータのサイズ(データ長)と、データベース使
用者の使用者コードとがパラメータとして含まれてい
る。読出操作命令はデータベースシステム31内の入出
力制御部36を経由してデータベース管理部33に通知
される。
The database system 3 according to one embodiment of the present invention will be described below with reference to the flowcharts of FIGS. 3 and 4.
The reading process and the writing process of No. 1 will be described in detail. The database user who has completed the login procedure inputs a data read operation command shown in 37 of Table 2 from the input / output terminal 32. The read operation command includes, as parameters, the record number of the record in which the data to be read from the database 34 is stored, the size (data length) of the data to be read, and the user code of the database user. The read operation command is notified to the database management unit 33 via the input / output control unit 36 in the database system 31.

【0046】図3のフローチャートにおいて、読出処理
に入ると、まず、読出操作命令を受けたデータベース管
理部33はその読出操作命令(表2の37)によって指
定されたレコード番号を使用して、ロック情報テーブル
(図2)のそのレコード番号に該当するロック状態の項
目(図2の41)からそのレコードに対するロック情報
を取得する(ステップ1)。そこで、ステップ2へ進
み、今取得した該当するレコード番号のロック情報が
“完全ロック中”を示しているか否かを検査する。
In the flow chart of FIG. 3, when the read processing is started, first, the database management unit 33 that has received the read operation command uses the record number designated by the read operation command (37 in Table 2) to perform the lock operation. The lock information for the record is acquired from the locked item (41 in FIG. 2) corresponding to the record number in the information table (FIG. 2) (step 1). Therefore, the process proceeds to step 2 and it is checked whether or not the lock information of the corresponding record number acquired just now indicates "completely locked".

【0047】完全ロック中を示していなければステップ
5へ進み、そこでレコード番号で指定したデータベース
34のレコードからデータを読出し、再び入出力制御部
36を経由して読出したデータを入出力端末32に返送
し、表示させる。更に、操作はステップ6へ進み、“正
常終了”の通知をして処理を終了する。以上の説明から
わかるように、読出操作の場合、本発明の目的により、
ライトロック中の場合には他のデータベース使用者でも
読出操作を実行することができるので、特にライトロッ
ク中か否かの検査をする必要がないため、それを判断す
るステップはない。
If the lock is not completely locked, the process proceeds to step 5, where the data is read from the record in the database 34 designated by the record number, and the read data is again sent to the input / output terminal 32 via the input / output control unit 36. Return and display. Further, the operation proceeds to step 6, notifies "normal end", and ends the process. As can be seen from the above description, in the case of a read operation, according to the purpose of the present invention,
Since the read operation can be executed by another database user during the write lock, it is not necessary to check whether or not the write lock is in effect, and therefore there is no step to judge it.

【0048】ステップ2において、指定されたレコード
が完全ロック中であることが判明するとステップ3へ進
み、そこで使用者コードを検査する。使用者コードが自
己のものであれば、その完全ロックは自らが要求したも
のであるからステップ5へ進み、上記同様、レコード番
号で指定されたデータベース34のレコードからデータ
を読出し、再び入出力制御部36を経由して読出したデ
ータを入出力端末32に返送し、そこで表示させる、更
に、操作はステップ6へ進み、“正常終了”の通知をし
てその処理を終了する。
When it is found in step 2 that the specified record is completely locked, the process proceeds to step 3 where the user code is checked. If the user code is his / her own, the complete lock is requested by himself / herself, and the process proceeds to step 5, where the data is read from the record of the database 34 designated by the record number and the input / output control is performed again. The read data is returned to the input / output terminal 32 via the unit 36 and is displayed there. Further, the operation proceeds to step 6, where a "normal end" is notified and the processing is ended.

【0049】ステップ3において(指定されたレコード
が完全ロック中であることを意味する)、完全ロックを
要求したものが他のデータベース使用者であることが判
明すると、ステップ4へ進み、入出力制御部36を経由
して指定されたレコードは“完全ロック中”であるから
読出しできないということを示すメッセージを入出力端
末32に通知して表示させ、その読出操作を終了する。
When it is found in step 3 (meaning that the specified record is in complete lock) that the user who requested the complete lock is another database user, the process proceeds to step 4 and the I / O control is performed. A message indicating that the record specified via the unit 36 is "completely locked" cannot be read and is displayed on the input / output terminal 32, and the read operation is terminated.

【0050】次に、図4のフローチャートに基づき、レ
コード番号によって指定されたデータベース34に対し
てデータを書込む書込処理について説明する。書込処理
の場合は、前述のように、完全ロック中及びライトロッ
ク中のどちらの場合でもその書込みは禁止される。ま
ず、データベース使用者はログイン手続を終了した後、
入出力端末32から表2の38に示すような書込操作命
令を入力する。
Next, the writing process for writing data in the database 34 designated by the record number will be described with reference to the flowchart of FIG. In the case of the write processing, as described above, the write is prohibited during both the complete lock and the write lock. First, after the database user has completed the login procedure,
From the input / output terminal 32, a write operation command as indicated by 38 in Table 2 is input.

【0051】書込操作命令はそのパラメータとして書込
むデータが格納されるレコード番号と、書込データのサ
イズと、書込むデータと、データベース使用者の使用者
コードとを含む。書込操作命令はデータベースシステム
31の入出力制御部36を経由してデータベース管理部
33へ送信される。
The write operation command includes the record number in which the data to be written is stored as the parameter, the size of the write data, the data to be written, and the user code of the database user. The write operation command is transmitted to the database management unit 33 via the input / output control unit 36 of the database system 31.

【0052】データベース管理部33は書込操作命令を
受けて、図4のステップ11に示すように、図2に示す
ロック情報テーブルからレコード番号で指定されたレコ
ードに対するロック情報(非ロック状態、完全ロック状
態、又はライトロック状態)を取得してステップ12へ
進む。ステップ12及びステップ13において、それぞ
れ、指定されたレコードが完全ロック中でもライトロッ
ク中でもないと判断されると、処理はステップ16へ進
む。ステップ16において、レコード番号で指定された
データベース34のレコードにデータを書込み、ステッ
プ17へ進み、入出力制御部36を経由して“正常終
了”のメッセージを入出力端末32に返送して表示さ
せ、その処理を終了する。
In response to the write operation command, the database management unit 33 receives the lock information (unlocked state, complete lock information) for the record designated by the record number from the lock information table shown in FIG. 2 as shown in step 11 of FIG. The lock state or the light lock state) is acquired and the process proceeds to step 12. If it is determined in step 12 and step 13 that the designated record is neither completely locked nor write locked, the process proceeds to step 16. In step 16, the data is written in the record of the database 34 designated by the record number, and the process proceeds to step 17 to return the "normal end" message to the input / output terminal 32 via the input / output control unit 36 for display. , The process ends.

【0053】指定されたレコードが、ステップ12か又
はステップ13において、完全ロック中か又はライトロ
ック中であると判断されると、処理はステップ14へ進
み、使用者コードの検査を受ける。使用者コードが自己
のものであればそのロックは自らが要求したものである
から書込みを禁止する必要はなく、ステップ16へ進
み、前述同様、指定されたデータベース34のレコード
にデータを書込む。そこで、ステップ17へ進み、入出
力制御部36を経由して“正常終了”を示すメッセージ
を入出力端末32に通知して表示させ、その処理を終了
する。
When the specified record is judged to be completely locked or light locked in step 12 or step 13, the process proceeds to step 14 and the user code is checked. If the user code is his / her own, the lock is requested by himself / herself, so that it is not necessary to prohibit writing, and the process proceeds to step 16, and the data is written in the record of the designated database 34 as described above. Therefore, the process proceeds to step 17, in which the message indicating "normal end" is notified to the input / output terminal 32 via the input / output control unit 36 to be displayed, and the process is ended.

【0054】ステップ14において(指定されたレコー
ドが完全ロック中かライトロック中であることを意味す
る)、その書込操作は他のデータベース使用者が要求し
たものであることがその使用者コードから判明すると、
処理はステップ15へ進み、入出力制御部36を経由し
て指定されたレコードは“ロック中”であるから書込み
ができない旨のメッセージを入出力端末32に通知して
表示させ、その処理を終了する。
In step 14 (meaning that the specified record is in full lock or write lock), it is determined by the user code that the write operation was requested by another database user. Once it turns out,
The process proceeds to step 15, and the record designated via the input / output control unit 36 is "locked", so a message indicating that the record cannot be written is notified to the input / output terminal 32 and displayed, and the process ends. To do.

【0055】次に、図5のフローチャートに基づき、本
発明の一実施例によるデータベースシステムのロック操
作について説明する。データベース使用者はログイン手
続を終了した後、入出力端末32から表2の39に示す
ようなレコードのロック操作命令を入力する。ロック操
作命令は、そのパラメータとして、ロックするデータが
格納されるレコードのレコード番号と、データベース使
用者の使用者コードと、完全ロックかライトロックかを
示すロック方法と、希望するロック時間とを含む。
Next, the lock operation of the database system according to the embodiment of the present invention will be described with reference to the flowchart of FIG. After completing the login procedure, the database user inputs a record lock operation command as shown in 39 of Table 2 from the input / output terminal 32. The lock operation command includes, as its parameters, the record number of the record in which the data to be locked is stored, the user code of the database user, the lock method indicating the complete lock or the light lock, and the desired lock time. .

【0056】図5において、データベース管理部33は
入出力制御部36を経由して入出力端末32から入力し
たロック操作命令を受信すると、ステップ21へ進み、
図2に示すロック情報テーブルからレコード番号で指定
されたレコードに対するロック情報(非ロック状態、完
全ロック状態、又はライトロック状態)を取得してステ
ップ22へ進む。
In FIG. 5, when the database management unit 33 receives the lock operation command input from the input / output terminal 32 via the input / output control unit 36, the process proceeds to step 21.
The lock information (unlocked state, complete lock state, or write lock state) for the record specified by the record number is acquired from the lock information table shown in FIG.

【0057】ステップ22及びステップ23において、
それぞれ指定されたレコードが完全ロック中でもライト
ロック中でもないと判断される(非ロック状態)と、処
理はステップ27へ進む。ステップ27において、デー
タベース管理部33は指定されたレコードのロック時間
監視タイマ35′を起動してステップ28へ進み、図2
に示すロック情報テーブルの該当するレコード番号にお
けるロック時間の項目に指定したロック時間を設定す
る。
In steps 22 and 23,
If it is determined that the respective designated records are neither completely locked nor light locked (non-locked state), the process proceeds to step 27. In step 27, the database management unit 33 activates the lock time monitoring timer 35 'for the designated record, and proceeds to step 28, as shown in FIG.
Set the lock time specified in the lock time item in the corresponding record number of the lock information table shown in.

【0058】次に、処理はステップ29を経由してステ
ップ30へ進み、それぞれ、指定されたレコードの使用
者コードと、そのレコードに希望するロック状態(完全
ロック状態か又はライトロック状態)とをロック情報テ
ーブルの該当する項目へ記憶させて設定した後ステップ
31へ進み、入出力制御部36を経由して処理が“正常
終了”したことを入出力端末32に通知して表示させ、
その処理を終了する。
Next, the process proceeds from step 29 to step 30 to set the user code of the designated record and the desired lock state (complete lock state or light lock state) of the record. After storing and setting in the corresponding item of the lock information table, the process proceeds to step 31, and the input / output terminal 32 is notified and displayed via the input / output control unit 36 that the process is “normally completed”.
The process ends.

【0059】指定されたレコードがステップ22か又は
ステップ23において、完全ロック中か又はライトロッ
ク中であると判断されると、処理はステップ24へ進
み、使用者コードが検査される。使用者コードが自己の
ものであれば、そのロックは自らが要求したものである
からステップ25へ進み、入出力制御部36を経由して
指定されたレコードは“既にロック中”である旨のメッ
セージを入出力端末32に通知して表示させ、その処理
を終了する。
If it is determined in step 22 or step 23 that the designated record is completely locked or light locked, the process proceeds to step 24, and the user code is checked. If the user code is his own, the lock is requested by himself, so the process proceeds to step 25, and the record designated via the input / output control unit 36 is "already locked". The message is notified to the input / output terminal 32 to be displayed, and the processing ends.

【0060】ステップ24において(指定されたレコー
ドは完全ロック中か又はライトロック中であることを意
味する)、そのロック状態は他のデータベース使用者が
ロックしたものであるということが判明するとステップ
26へ進み、入出力制御部36を経由して指定されたレ
コードは“他のデータベース使用者がロック中”である
旨のメッセージを入出力端末32に通知して表示させ、
その処理を終了する。
At step 24 (meaning that the specified record is in full lock or write lock), it is found that the lock state is locked by another database user. Then, the record designated via the input / output control unit 36 is notified to the input / output terminal 32 to display a message that "the other database user is locked", and is displayed.
The process ends.

【0061】次に、図6に基づき、本発明の一実施例に
よるデータベースシステムのロック解除操作について説
明する。データベース使用者はログイン手続を終了した
後、入出力端末32から表2の40に示すようなデータ
のロック解除操作命令を入力する。ロック解除操作命令
は、そのパラメータとして、ロック解除するデータが格
納されているレコードのレコード番号とデータベース使
用者の使用者コードとを含む。
Next, the unlocking operation of the database system according to the embodiment of the present invention will be described with reference to FIG. After completing the login procedure, the database user inputs a data unlock operation command as shown by 40 in Table 2 from the input / output terminal 32. The unlock operation command includes, as its parameters, the record number of the record storing the data to be unlocked and the user code of the database user.

【0062】図6において、データベース管理部33は
入出力制御部36を経由して入出力端末32から入力し
たロック解除操作命令を受信すると、ステップ41へ進
み、図2に示すロック情報テーブルからレコード番号で
指定されたレコードに対するロック情報(非ロック状
態、完全ロック状態、又はライトロック状態)を取得し
てステップ42へ進む。
In FIG. 6, when the database management unit 33 receives the lock release operation command input from the input / output terminal 32 via the input / output control unit 36, the process proceeds to step 41 and records from the lock information table shown in FIG. The lock information (non-lock state, complete lock state, or write lock state) for the record designated by the number is acquired, and the process proceeds to step 42.

【0063】ステップ42及びステップ43において、
それぞれ指定されたレコードが完全ロック中でもライト
ロック中でもない(非ロック状態)と判断されると、処
理はステップ51へ進む。ステップ51において、デー
タベース管理部33は入出力制御部36を経由して指定
されたレコードは“ロックされていない”旨を示すメッ
セージを入出力端末32に通知して表示させ、その処理
を終了する。
In steps 42 and 43,
If it is determined that the designated records are neither completely locked nor light locked (non-locked state), the process proceeds to step 51. In step 51, the database management unit 33 notifies the input / output terminal 32 of a message indicating that the designated record is “unlocked” via the input / output control unit 36, and displays the message, and the processing ends. .

【0064】指定されたレコードがステップ42か又は
ステップ43において、完全ロック中か又はライトロッ
ク中であると判断されると、処理はステップ44へ進
み、使用者コードが検査される。使用者コードが自己の
ものであれば、そのロックは自らが要求したものである
からステップ46へ進み、更に順次ステップ47、ステ
ップ48、及びステップ49を経由して、それぞれ指定
されたレコードのロック時間監視タイマを解除し、ロッ
ク情報テーブルの指定されたレコードに対するロック時
間を消去し、指定されたレコードの使用者コードを消去
し、指定されたレコードのロック方法を消去してステッ
プ50へ進む。ステップ50において、入出力制御部3
6を経由してロック解除処理が“正常終了”した旨を示
すメッセージを入出力端末32に通知して表示させ、処
理を終了する。
If it is determined in step 42 or step 43 that the designated record is completely locked or light locked, the process proceeds to step 44, and the user code is checked. If the user code is his / her own, the lock is requested by himself / herself, and therefore, the process proceeds to step 46, and the lock of each designated record is sequentially passed through step 47, step 48 and step 49. The time monitoring timer is released, the lock time for the specified record in the lock information table is deleted, the user code of the specified record is deleted, the locking method of the specified record is deleted, and the process proceeds to step 50. In step 50, the input / output control unit 3
A message indicating that the unlocking process is “normally completed” is notified to the input / output terminal 32 via 6 and displayed, and the process ends.

【0065】ステップ44において(指定されたレコー
ドは完全ロック中か又はライトロック中であることを意
味する)、そのロック状態は他のデータベース使用者が
ロックしたものであるということが判明するとステップ
45へ進み、入出力制御部36を経由して指定されたレ
コードは“他の使用者がロック”したものであり、ロッ
ク解除することはできない旨のメッセージを入出力端末
32に通知して表示させ、その処理を終了する。
At step 44 (meaning that the specified record is in full lock or write lock), it is found that the lock state is locked by another database user. The record designated via the input / output control unit 36 is “locked by another user”, and the input / output terminal 32 is notified of the message indicating that the record cannot be unlocked and displayed. , The process ends.

【0066】前述したように、指定されたレコードに対
するロック状態がロック開始から指定された時間(ロッ
ク操作命令39により指定されたロック時間監視タイマ
35′の設定時間)ロック解除されないまま放置される
と、ロック時間監視タイマ35′がタイムアウトする。
このタイムアウトが発生すると、ロック時間監視部35
はロックを要求したデータベース使用者がログインした
入出力端末32に対し、強制的にロック状態が解除され
た旨を示すメッセージを通知して表示させ、ロック情報
テーブルの指定されたレコードに対する該当項目を消去
する。このようにして、放置されたロック状態は所定の
時間経過後自動的に解除されて、如何なるデータベース
使用者に対しても読出し及び書込み共に自由となり、処
理効率の低下を防止する。
As described above, when the lock state of the specified record is left unlocked for the specified time (the setting time of the lock time monitoring timer 35 'specified by the lock operation command 39) from the start of locking. The lock time monitoring timer 35 'times out.
When this timeout occurs, the lock time monitoring unit 35
Notifies and displays a message indicating that the locked state has been forcibly released to the input / output terminal 32 to which the database user who requested the lock has logged in, and displays the corresponding item for the specified record in the lock information table. to erase. In this way, the neglected lock state is automatically released after a lapse of a predetermined time, and any database user can freely read and write, thus preventing a decrease in processing efficiency.

【0067】[0067]

【発明の効果】本発明は、以上説明したように構成し、
特にロック設定時にロック解除タイマを所定の時間に設
定し、それがタイムアウトしたときに強制的にロック解
除するようにしたことにより、ロック解除漏れが発生せ
ず、データベースシステムのデッドロックを回避するこ
とが可能となった。更に、本発明は、データベースのレ
コードの読出し及び書込みをロックするロック機能とし
て、書込み及び読出しの両方共ロックする完全ロックの
他、書込みのみを禁止して読出しを可能とするライトロ
ック機能を設定可能にして、読出要求に対しては必要以
上にデータをロックせず、ロック解除までの待合せ時間
を除去しうるようにしたことにより、データベースの更
新処理等において生ずるかもしれないデータベースサー
ビスの処理効率の低下を防止することが可能となった。
The present invention is configured as described above,
In particular, the lock release timer is set to a specified time when setting the lock, and the lock release is forcibly released when it times out, so that the lock release omission does not occur and the deadlock of the database system is avoided. Became possible. Further, according to the present invention, as the lock function for locking the reading and writing of the record of the database, a complete lock for locking both the writing and the reading, and a write lock function for prohibiting only the writing and enabling the reading can be set. In this way, the data is not locked more than necessary for the read request, and the waiting time until the lock is released can be eliminated, so that the processing efficiency of the database service that may occur in the database update processing etc. It became possible to prevent the decrease.

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

【図1】本発明の一実施例によるデータベースシステム
の構成を示すブロック図
FIG. 1 is a block diagram showing a configuration of a database system according to an embodiment of the present invention.

【図2】本発明の一実施例によるデータベースシステム
に設定されるロック情報テーブルの構成図
FIG. 2 is a configuration diagram of a lock information table set in a database system according to an embodiment of the present invention.

【図3】本発明の一実施例のデータベース管理部による
読出処理を示すフローチャート
FIG. 3 is a flowchart showing a reading process by a database management unit according to an embodiment of the present invention.

【図4】本発明の一実施例のデータベース管理部による
書込処理を示すフローチャート
FIG. 4 is a flowchart showing a writing process by the database management unit according to the embodiment of this invention.

【図5】本発明の一実施例のデータベース管理部による
ロック処理を示すフローチャート
FIG. 5 is a flowchart showing lock processing by the database management unit according to the embodiment of this invention.

【図6】本発明の一実施例のデータベース管理部による
ロック解除処理を示すフローチャート
FIG. 6 is a flowchart showing lock release processing by the database management unit according to the embodiment of this invention.

【図7】従来のデータベースシステムの構成を示すブロ
ック図
FIG. 7 is a block diagram showing the configuration of a conventional database system.

【図8】従来のデータベースの内部構成を示す模式図FIG. 8 is a schematic diagram showing the internal structure of a conventional database.

【図9】従来のデータベースシステムに設定されるロッ
ク情報テーブルの構成図
FIG. 9 is a configuration diagram of a lock information table set in a conventional database system.

【図10】従来のデータベース管理部の読みだし処理を
示すフローチャート
FIG. 10 is a flowchart showing a reading process of a conventional database management unit.

【図11】従来のデータベース管理部の書き込み処理を
示すフローチャート
FIG. 11 is a flowchart showing a writing process of a conventional database management unit.

【図12】従来のデータベース管理部のロック処理を示
すフローチャート
FIG. 12 is a flowchart showing lock processing of a conventional database management unit.

【図13】従来のデータベース管理部のロック解除処理
を示すフローチャート
FIG. 13 is a flowchart showing lock release processing of a conventional database management unit.

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

1 データベースシステム 2 入出力端末 3 データベース管理部 4 データベース 5 入出力制御部 6 レコードテーブル 7、8、9、10、N データ領域 31 データベースシステム 32 入出力端末 33 データベース管理部 34 データベース 35 ロック時間監視部 36 入出力制御部 1 database system 2 input / output terminal 3 database management unit 4 database 5 input / output control unit 6 record table 7, 8, 9, 10, N data area 31 database system 32 input / output terminal 33 database management unit 34 database 35 lock time monitoring unit 36 I / O controller

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】データベースと、データベース使用者から
の前記データベースに対する少くとも書込要求、読出要
求、ロック要求、及びロック解除要求を受けて処理する
データベース管理部とを含むデータベースシステムであ
って、前記ロック要求により指定された前記データベー
スのレコードのロック開始から前記ロック要求により指
定された時間まで刻時するロック時間監視タイマと、前
記ロック時間監視タイマを監視して前記レコードのロッ
ク中にタイムアウトしたときはそれを前記データベース
管理部に通知して、前記ロック要求により設定されたロ
ック状態を解除しそれを表示させるロック時間監視部と
を含むことを特徴とするデータベースシステム。
1. A database system comprising: a database; and a database management unit for processing in response to a write request, a read request, a lock request, and an unlock request for the database from a database user. When a lock time monitoring timer that clocks from the lock start of the record of the database specified by the lock request to the time specified by the lock request, and when the lock time monitoring timer is monitored to time out while the record is locked And a lock time monitoring unit for notifying the database management unit of this and releasing the lock state set by the lock request and displaying the lock state.
【請求項2】前記ロック要求は指定されたレコードに対
する書込み及び読出しを禁止する完全ロック機能と、書
込みのみ禁止し読出し可能であるライトロック機能と
を、前記ロック要求に際し選択指定することを特徴とす
る請求項1記載のデータベースシステム。
2. The lock request selectively specifies a complete lock function of prohibiting writing and reading of a designated record and a write lock function of prohibiting only writing and being readable in the lock request. The database system according to claim 1.
JP5049905A 1993-02-17 1993-02-17 Data base system Pending JPH06243014A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5049905A JPH06243014A (en) 1993-02-17 1993-02-17 Data base system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5049905A JPH06243014A (en) 1993-02-17 1993-02-17 Data base system

Publications (1)

Publication Number Publication Date
JPH06243014A true JPH06243014A (en) 1994-09-02

Family

ID=12844031

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5049905A Pending JPH06243014A (en) 1993-02-17 1993-02-17 Data base system

Country Status (1)

Country Link
JP (1) JPH06243014A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6185563B1 (en) 1997-09-11 2001-02-06 Kabushiki Kaisha Toshiba Document management method and apparatus for ensuring consistency of document contents
JP2007299261A (en) * 2006-05-01 2007-11-15 Fujitsu Ltd Medical system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6185563B1 (en) 1997-09-11 2001-02-06 Kabushiki Kaisha Toshiba Document management method and apparatus for ensuring consistency of document contents
JP2007299261A (en) * 2006-05-01 2007-11-15 Fujitsu Ltd Medical system

Similar Documents

Publication Publication Date Title
EP1624375A2 (en) Apparatus, method and program to handle an abnormality in a distributed information processing system
US8245026B1 (en) Securing the contents of data storage devices within a computer
JP2999651B2 (en) Telephone switching system with user controlled data memory access system and method
US7127462B2 (en) Method and apparatus for managing a database and processing program therefor
JPH06314227A (en) Rocking mechanism for version object
JP2005510809A (en) Method and system for scheduling media export
JPH06243014A (en) Data base system
Cisco Managing Jobs
Cisco Managing Jobs
Cisco Managing Jobs
US7318147B2 (en) Method for delaying and executing system administration operations in unattended mode
JPH0437916A (en) Information processor
JP2000076085A (en) Information processor, resource lack reporting method and recording medium
JPH0713603A (en) Process monitor controller
JP3524270B2 (en) Parallel processing system
JPH0283732A (en) Control system for program executing time limit
JP2007052477A (en) Local account integrated management system and management method, and program therefor
JP3605675B2 (en) Automatic starter for user registration process corresponding to power outage / recovery
JP2978520B2 (en) POS system environment setting method
JPH04205042A (en) Memory area control method
JPS60252966A (en) File access possible time advance notice processing system
JPH05233497A (en) Buffer chain destruction detection device
JPH0827752B2 (en) Resource status holding device
JP2002175192A (en) Program loading method, and recording medium with program for execution of the method recorded thereon
JPH10228423A (en) Electronic device