[go: up one dir, main page]

JP2012198829A - Computer system - Google Patents

Computer system Download PDF

Info

Publication number
JP2012198829A
JP2012198829A JP2011063474A JP2011063474A JP2012198829A JP 2012198829 A JP2012198829 A JP 2012198829A JP 2011063474 A JP2011063474 A JP 2011063474A JP 2011063474 A JP2011063474 A JP 2011063474A JP 2012198829 A JP2012198829 A JP 2012198829A
Authority
JP
Japan
Prior art keywords
control means
instruction
relational database
cobol program
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2011063474A
Other languages
Japanese (ja)
Other versions
JP5664389B2 (en
Inventor
Natsumi Okamoto
奈津実 岡本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2011063474A priority Critical patent/JP5664389B2/en
Publication of JP2012198829A publication Critical patent/JP2012198829A/en
Application granted granted Critical
Publication of JP5664389B2 publication Critical patent/JP5664389B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To solve the problem in which performance is lowered when accessing a database after converting a READ command into the SQL sentence whenever the READ command is sent from the COBOL program.SOLUTION: First control means 120 has a function of converting a READ command sent to a table of a relational database 110 into a command in an SQL sentence referring to the table and then issuing the command to the relational database 110. Second control means 220, having cache memory means 230, obtains the table through the first control means 120, stores the table in the cache memory means 230, and returns the first record of the table to a COBOL program 210 when a READ command is sent from the COBOL program 210 to the table of the relational database 110 and when the READ command is the first command to the table. The second control means 220 reads out second or subsequent records on the table from the cache memory means 230 and returns the second or subsequent records to the COBOL program 210 when the READ command is the second or later command.

Description

本発明は計算機システムに関し、特にCOBOLプログラムからリレーショナルデータベースのテーブルに対して出されたREAD命令をSQL文による命令に変換して発行する機能を有する計算機システムに関する。   The present invention relates to a computer system, and more particularly to a computer system having a function of converting a READ instruction issued from a COBOL program to a relational database table into an instruction using an SQL statement and issuing it.

メインフレームからデータベースアクセスを行うCOBOLプログラムの動作に、データの入出力を行うための命令としてREAD/WRITE命令でファイルアクセスする方法がある。オープンサーバ上で動作するDBMSが提供するアクセス方法は主にSQLであり、READ/WRITE命令でのアクセス方法は提供していない。このため、マイグレーションとして、メインフレームのデータベースからオープンサーバ環境にあるデータベースに移行する場合、SQLを使用するように改修するか、READ/WRITE命令をエミュレーションしアクセスできる方法を提供する必要がある。前者の方法については、例えば特許文献1に記載される技術が知られている。後者については、例えば特許文献2〜4に記載される技術が知られている。本発明は後者の方法の改良に関する。   There is a method of accessing a file with READ / WRITE instruction as an instruction to input / output data in the operation of the COBOL program that accesses the database from the mainframe. Access methods provided by DBMS running on an open server are mainly SQL, and access methods using READ / WRITE instructions are not provided. For this reason, when migrating from a mainframe database to a database in an open server environment, it is necessary to provide a method that can be modified to use SQL or emulate and access a READ / WRITE instruction. As for the former method, for example, a technique described in Patent Document 1 is known. For the latter, for example, techniques described in Patent Documents 2 to 4 are known. The present invention relates to an improvement of the latter method.

特許文献2〜4に記載される技術は何れも、COBOLプログラムからデータベースにREAD命令が出されると、そのREAD命令をSQL文に変換してデータベースに発行し、該当するテーブルの1レコードを取得してCOBOLプログラムに返却する。   In any of the technologies described in Patent Documents 2 to 4, when a READ instruction is issued from the COBOL program to the database, the READ instruction is converted into an SQL statement and issued to the database, and one record of the corresponding table is acquired. And return it to the COBOL program.

特開2000-181697号公報JP 2000-181697 特開2000-194588号公報Japanese Unexamined Patent Publication No. 2000-194588 特開2006-127337号公報JP 2006-127337 A 特開平11-259294号公報Japanese Patent Laid-Open No. 11-259294

しかしながら、COBOLプログラムからREAD命令が出される毎にREAD命令からSQL文への変換およびデータベースへの発行を行うと、COBOLプログラムがREAD命令を出してから結果を受け取るまでの時間が長くなり、性能が低下する。   However, every time a READ instruction is issued from a COBOL program, conversion from a READ instruction to an SQL statement and issuance to the database increases the time from when the COBOL program issues a READ instruction until the result is received, resulting in improved performance. descend.

本発明の目的は、上述した課題、すなわち、COBOLプログラムからREAD命令が出される毎にSQL文に変換してデータベースをアクセスすると性能が低下する、という課題を解決する計算機システムを提供することにある。   An object of the present invention is to provide a computer system that solves the above-described problem, that is, the performance is deteriorated when a database is accessed by converting to a SQL statement every time a READ instruction is issued from a COBOL program. .

本発明の一形態にかかる計算機システムは、
リレーショナルデータベースのテーブルに対して出されたREAD命令を、上記テーブルを参照するSQL文による命令に変換して上記リレーショナルデータベースに発行する第1の制御手段と、
上記テーブルを一時的に記憶するキャッシュ記憶手段を有し、COBOLプログラムから上記リレーショナルデータベースの上記テーブルに対してREAD命令が出されたとき、上記テーブルに対する1回目のREAD命令であれば、上記第1の制御手段を通じて上記テーブルを取得して上記キャッシュ記憶手段に記憶すると共に上記テーブルの1つ目のレコードを上記COBOLプログラムに返却し、2回目以降のREAD命令であれば、上記キャッシュ記憶手段から上記テーブルの2つ目以降のレコードを読み出して上記COBOLプログラムに返却する第2の制御手段と
を有する、といった構成を採る。
A computer system according to an aspect of the present invention is:
A first control means for converting a READ instruction issued to a relational database table into an instruction by an SQL statement that refers to the table and issuing the instruction to the relational database;
The cache storage means for temporarily storing the table, and when a READ instruction is issued from the COBOL program to the table of the relational database, if the first READ instruction for the table is used, the first The above table is acquired through the control means and stored in the cache storage means, and the first record of the table is returned to the COBOL program. The second control means for reading the second and subsequent records in the table and returning them to the COBOL program is adopted.

本発明は上述したような構成を有するため、2つ目以降のREAD命令より、COBOLプログラムがREAD命令を出してから結果を受け取るまでの時間を短縮でき、性能が向上する。   Since the present invention has the above-described configuration, the time from when the COBOL program issues a READ instruction until the result is received can be shortened from the second and subsequent READ instructions, and the performance is improved.

本発明の第1の実施形態のブロック図である。1 is a block diagram of a first embodiment of the present invention. 本発明の第2の実施形態のブロック図である。FIG. 6 is a block diagram of a second embodiment of the present invention. 本発明の第3の実施形態のブロック図である。FIG. 6 is a block diagram of a third embodiment of the present invention. 本発明の第3の実施形態における返却データ管理手段の結果データの管理フラグの種類と意味を示す図である。It is a figure which shows the kind and meaning of the management flag of the result data of the return data management means in the 3rd Embodiment of this invention. 本発明の第3の実施形態における返却データ管理手段の結果データを管理するテーブルの構成例を示す図である。It is a figure which shows the structural example of the table which manages the result data of the return data management means in the 3rd Embodiment of this invention. 本発明の第3の実施形態においてCOBOLプログラムがREAD命令を出した際の動作を示す図である。FIG. 10 is a diagram showing an operation when a COBOL program issues a READ instruction in the third embodiment of the present invention. 本発明の第3の実施形態においてCOBOLプログラムがWRITE命令を出した際の動作を示す図である。It is a figure which shows operation | movement when the COBOL program issues the WRITE instruction in the 3rd Embodiment of this invention. 本発明の第3の実施形態におけるデータベース更新発生時の動作説明図である。FIG. 10 is an operation explanatory diagram when a database update occurs in the third embodiment of the present invention. 本発明の第3の実施形態におけるデータベース更新発生時の別の動作説明図である。FIG. 10 is another operation explanatory diagram when a database update occurs in the third embodiment of the present invention. 本発明の第3の実施形態における更新レコード受信処理のフローチャートである。14 is a flowchart of an update record reception process in the third embodiment of the present invention. 本発明の第3の実施形態における更新確定処理のフローチャートである。10 is a flowchart of an update confirmation process in the third embodiment of the present invention. 本発明の第4の実施形態のブロック図である。FIG. 6 is a block diagram of a fourth embodiment of the present invention.

次に本発明の実施の形態について図面を参照して詳細に説明する。
[第1の実施形態]
図1を参照すると、本発明の第1の実施形態にかかる計算機システムは、相互に通信可能は第1の計算機100と第2の計算機200とから構成される。
Next, embodiments of the present invention will be described in detail with reference to the drawings.
[First embodiment]
Referring to FIG. 1, the computer system according to the first embodiment of the present invention includes a first computer 100 and a second computer 200 that can communicate with each other.

第1の計算機100は、リレーショナルデータベース(RDB)110と第1の制御手段120とを有する。また、第2の計算機200は、第2の制御手段220を有し、COBOLプログラム210が動作する。   The first computer 100 includes a relational database (RDB) 110 and first control means 120. The second computer 200 has second control means 220, and the COBOL program 210 operates.

第1の制御手段120は、第2の制御手段220からリレーショナルデータベース110のテーブルに対して出されたREAD命令を、そのテーブルを参照するSQL文による命令に変換してリレーショナルデータベース110に発行し、取得したテーブルを第2の制御手段220に返却する機能を有する。また、第1の制御手段120は、リレーショナルデータベース110のテーブルに対して出されたWRITE命令を、そのテーブルを更新するSQL文による命令に変換してリレーショナルデータベース110に発行する機能を有していてもよい。   The first control unit 120 converts the READ instruction issued from the second control unit 220 to the table of the relational database 110 into an instruction by an SQL statement that refers to the table, and issues it to the relational database 110. It has a function of returning the acquired table to the second control means 220. The first control unit 120 has a function of converting a WRITE instruction issued to a table of the relational database 110 into an instruction by an SQL statement for updating the table and issuing the instruction to the relational database 110. Also good.

第2の制御手段220は、リレーショナルデータベース110から取得したテーブルを一時的に記憶するキャッシュ記憶手段230を有する。また、第2の制御手段220は、COBOLプログラム210からリレーショナルデータベース110のテーブルに対してREAD命令が出されたとき、そのテーブルに対する1回目のREAD命令であれば、第1の制御手段120を通じて上記テーブルを取得してキャッシュ記憶手段230に記憶すると共に、そのテーブルの1つ目のレコードをCOBOLプログラム210に返却する機能を有する。また、2回目以降のREAD命令であれば、キャッシュ記憶手段230に記憶されている上記テーブルの2つ目以降のレコードを読み出し、COBOLプログラムに返却する機能を有する。ここで、何回目のREAD命令であるかは、例えば、COBOLプログラム210の動作開始後あるいはテーブルのオープン後、何回目のREAD命令であるかによってカウントする。また、第2の制御手段220は、COBOLプログラム210からリレーショナルデータベース110のテーブルに対してWRITE命令が出されたとき、そのWRITE命令を第1の制御手段120に送信して処理させるようにしてもよい。   The second control unit 220 includes a cache storage unit 230 that temporarily stores a table acquired from the relational database 110. In addition, when the second control unit 220 issues a READ instruction to the table of the relational database 110 from the COBOL program 210, if the first READ instruction is for the table, the second control unit 220 passes the first control unit 120 through the first control unit 120. The table is acquired and stored in the cache storage means 230, and the first record of the table is returned to the COBOL program 210. If it is the second and subsequent READ instructions, the second and subsequent records in the above table stored in the cache storage means 230 are read and returned to the COBOL program. Here, the number of READ instructions is counted by, for example, the number of READ instructions after the operation of the COBOL program 210 is started or the table is opened. In addition, when the WRITE instruction is issued from the COBOL program 210 to the table of the relational database 110, the second control means 220 transmits the WRITE instruction to the first control means 120 for processing. Good.

次に本実施形態の動作を説明する。   Next, the operation of this embodiment will be described.

第2の計算機200でCOBOLプログラム210が動作を開始し、リレーショナルデータベース110に対して最初のREAD命令を出力すると、第2の制御手段220は、そのREAD命令を第1の計算機100の第1の制御手段120へ送信する。   When the COBOL program 210 starts operating on the second computer 200 and outputs the first READ instruction to the relational database 110, the second control means 220 sends the READ instruction to the first computer 100 of the first computer 100. It transmits to the control means 120.

第1の制御手段120は、受信したREAD命令を、リード対象となるテーブルを参照するSQL文による命令に変換してリレーショナルデータベース110に発行する。そして、取得したテーブルを第2の計算機200の第2の制御手段220に返却する。   The first control means 120 converts the received READ command into an SQL statement command that references a table to be read and issues it to the relational database 110. Then, the acquired table is returned to the second control means 220 of the second computer 200.

第2の制御手段220は、受信したテーブルをキャッシュ記憶手段230に記憶すると共に、そのテーブルの1つ目のレコードをCOBOLプログラム210に返却する。   The second control means 220 stores the received table in the cache storage means 230 and returns the first record of the table to the COBOL program 210.

続いてCOBOLプログラム210が、同じテーブルに対して2回目のREAD命令を出すと、第2の制御手段220は、キャッシュ記憶手段230に記憶されているテーブルの2つ目のレコードを読み出し、COBOLプログラム210に返却する。COBOLプログラム210が、同じテーブルに対して3回目以降のREAD命令を出した場合も同様に、第2の制御手段220は、キャッシュ記憶手段230に記憶されているテーブルの3つ目以降のレコードを読み出し、COBOLプログラム210に返却する。   Subsequently, when the COBOL program 210 issues a second READ instruction to the same table, the second control means 220 reads the second record in the table stored in the cache storage means 230, and the COBOL program Return to 210. Similarly, when the COBOL program 210 issues the third and subsequent READ instructions for the same table, the second control means 220 also records the third and subsequent records in the table stored in the cache storage means 230. Read and return to COBOL program 210.

このように本実施形態によれば、2つ目以降のREAD命令より、SQL文への変換およびリレーショナルデータベース110へのSQL文の発行の処理を省くことができ、COBOLプログラム210がREAD命令を出してから結果を受け取るまでの時間を大幅に短縮することができる。また、第1および第2の計算機間の通信の頻度を少なくすることができる。   As described above, according to this embodiment, it is possible to omit the conversion to the SQL statement and the issue of the SQL statement to the relational database 110 from the second and subsequent READ instructions, and the COBOL program 210 issues the READ instruction. The time from receiving the result to receiving the result can be greatly reduced. In addition, the frequency of communication between the first and second computers can be reduced.

[第2の実施形態]
上記の第1の実施形態では、COBOLプログラムが参照しているリレーショナルデータベースは、そのCOBOLプログラムや他のプログラムから更新されないような動作環境を想定した。これに対して、本実施形態は、参照中のテーブルが同じCOBOLプログラムや他のプログラムから更新される動作環境を前提とする。
[Second Embodiment]
In the first embodiment, the relational database referred to by the COBOL program is assumed to be an operating environment in which the COBOL program and other programs are not updated. On the other hand, this embodiment is based on an operating environment in which the table being referenced is updated from the same COBOL program or another program.

図2を参照すると、本発明の第2の実施形態にかかる計算機システムは、相互に通信可能は第1の計算機300と第2の計算機400とから構成される。   Referring to FIG. 2, the computer system according to the second embodiment of the present invention includes a first computer 300 and a second computer 400 that can communicate with each other.

第1の計算機300は、リレーショナルデータベース310と第1の制御手段320とを有する。また、第2の計算機400は、第2の制御手段420を有し、COBOLプログラム410が動作する。   The first computer 300 includes a relational database 310 and first control means 320. The second computer 400 has second control means 420, and the COBOL program 410 operates.

第1の制御手段320は、第2の制御手段420からリレーショナルデータベース310のテーブルに対して出されたREAD命令を、そのテーブルを参照するSQL文による命令に変換してリレーショナルデータベース310に発行し、取得したテーブルを第2の制御手段420に返却する機能を有する。また、第1の制御手段320は、リレーショナルデータベース310のテーブルに対して出されたWRITE命令を、そのテーブルを更新するSQL文による命令に変換してリレーショナルデータベース310に発行する機能を有していてもよい。   The first control means 320 converts the READ instruction issued to the table of the relational database 310 from the second control means 420 into an instruction by an SQL statement that refers to the table, and issues it to the relational database 310. It has a function of returning the acquired table to the second control means 420. The first control means 320 has a function of converting a WRITE command issued to a table of the relational database 310 into a command by an SQL statement for updating the table and issuing the command to the relational database 310. Also good.

さらに第1の制御手段320は、第2の制御手段420に返却したテーブルを記憶する返却データ記憶手段330を有する。また第1の制御手段320は、返却データ記憶手段330に記憶されているテーブルのオリジナルがリレーショナルデータベース310上で更新されたときに、返却データ記憶手段330に記憶されているテーブルを更新すると共に、第2の計算機400の第2の制御手段420に更新通知を送信する機能を有する。ここで、「更新されたとき」は、COMMITにより更新が確定したときであってもよいし、COMMIT前の更新時であってもよい。   Further, the first control means 320 has return data storage means 330 for storing the table returned to the second control means 420. The first control means 320 updates the table stored in the return data storage means 330 when the original of the table stored in the return data storage means 330 is updated on the relational database 310, It has a function of transmitting an update notification to the second control means 420 of the second computer 400. Here, “when updated” may be when update is confirmed by COMMIT, or may be when updated before COMMIT.

また第1の制御手段320は、第2の制御手段420から更新後のデータが要求された際に、返却データ記憶手段330に記憶されているテーブルから更新後のデータを読み出して返却する機能を有する。第1の制御手段320は、レコード単位で更新の有無を管理し、第2の制御手段420から更新後のデータが要求されたときに、更新されたレコードだけを更新後のデータとして返却する。あるいは、第1の制御手段320は、テーブル単位で更新の有無を管理し、第2の制御手段420から更新後のデータが要求されたときは、更新されたテーブルを更新後のデータとして返却してもよい。   The first control unit 320 has a function of reading and returning the updated data from the table stored in the return data storage unit 330 when the updated data is requested from the second control unit 420. Have. The first control unit 320 manages the presence or absence of update in units of records, and when updated data is requested from the second control unit 420, only the updated record is returned as updated data. Alternatively, the first control unit 320 manages the presence / absence of update in units of tables, and when the updated data is requested from the second control unit 420, the updated table is returned as the updated data. May be.

第2の制御手段420は、リレーショナルデータベース310から取得したテーブルを一時的に記憶するキャッシュ記憶手段430を有する。また、第2の制御手段420は、COBOLプログラム410からリレーショナルデータベース310のテーブルに対してREAD命令が出されたとき、そのテーブルに対する1回目のREAD命令であれば、第1の制御手段320を通じて上記テーブルを取得してキャッシュ記憶手段430に記憶すると共に、そのテーブルの1つ目のレコードをCOBOLプログラム410に返却する機能を有する。また、2回目以降のREAD命令であれば、キャッシュ記憶手段430に記憶されている上記テーブルの2つ目以降のレコードを読み出し、COBOLプログラム410に返却する機能を有する。また、第2の制御手段420は、COBOLプログラム410からリレーショナルデータベース310のテーブルに対してWRITE命令が出されたとき、そのWRITE命令を第1の制御手段320に送信して処理させるようにしてもよい。   The second control unit 420 includes a cache storage unit 430 that temporarily stores a table acquired from the relational database 310. In addition, when the second control means 420 issues a READ instruction to the table of the relational database 310 from the COBOL program 410, if the first READ instruction is for the table, the second control means 420 passes through the first control means 320 to The table is acquired and stored in the cache storage means 430, and the first record of the table is returned to the COBOL program 410. In addition, if it is the second and subsequent READ instructions, it has a function of reading the second and subsequent records of the table stored in the cache storage means 430 and returning them to the COBOL program 410. In addition, when the WRITE instruction is issued from the COBOL program 410 to the table of the relational database 310, the second control means 420 transmits the WRITE instruction to the first control means 320 for processing. Good.

さらに第2の制御手段420は、キャッシュ記憶手段430に記憶されているテーブルのうち第1の制御手段320から更新通知のあったテーブルを更新中状態として管理し、更新中状態のテーブルに対してCOBOLプログラム410からREAD命令が出されたときは、第1の制御手段320に対して要求を出して取得した更新後のデータをキャッシュ記憶手段430のテーブルに反映した後に読み出しを行う機能を有する。   Further, the second control unit 420 manages the table notified of the update from the first control unit 320 among the tables stored in the cache storage unit 430 as an updating state, and for the table in the updating state When a READ instruction is issued from the COBOL program 410, it has a function of performing a read operation after reflecting the updated data acquired by issuing a request to the first control unit 320 in the table of the cache storage unit 430.

次に本実施形態の動作を説明する。   Next, the operation of this embodiment will be described.

第2の計算機400でCOBOLプログラム410が動作を開始し、リレーショナルデータベース310に対して最初のREAD命令を出力すると、第2の制御手段420は、そのREAD命令を第1の計算機300の第1の制御手段320へ送信する。   When the COBOL program 410 starts operating on the second computer 400 and outputs the first READ instruction to the relational database 310, the second control means 420 sends the READ instruction to the first computer 300 of the first computer 300. It transmits to the control means 320.

第1の制御手段320は、受信したREAD命令を、リード対象となるテーブルを参照するSQL文による命令に変換してリレーショナルデータベース310に発行する。そして、取得したテーブルを返却データ記憶手段330に記憶すると共に、第2の計算機400の第2の制御手段420に返却する。   The first control means 320 converts the received READ command into an SQL statement command that references a table to be read and issues it to the relational database 310. Then, the acquired table is stored in the return data storage means 330 and returned to the second control means 420 of the second computer 400.

第2の制御手段420は、受信したテーブルをキャッシュ記憶手段430に記憶すると共に、そのテーブルの1つ目のレコードをCOBOLプログラム410に返却する。   The second control unit 420 stores the received table in the cache storage unit 430, and returns the first record of the table to the COBOL program 410.

続いてCOBOLプログラム410が、同じテーブルに対して2回目のREAD命令を出すと、第2の制御手段420は、キャッシュ記憶手段430に記憶されているテーブルの2つ目のレコードを読み出し、COBOLプログラム410に返却する。   Subsequently, when the COBOL program 410 issues a second READ instruction to the same table, the second control means 420 reads the second record of the table stored in the cache storage means 430, and the COBOL program Return to 410.

次に、COBOLプログラム410がREADしている上記テーブルのオリジナルがリレーショナルデータベース310上で更新されたとする。このとき、第1の制御手段320は、返却データ記憶手段330に記憶されているテーブルを更新すると共に、第2の制御手段420に更新通知を送信する。第2の制御手段420は、この更新通知を受信すると、キャッシュ記憶手段430に記憶されているテーブルのうち更新通知のあったテーブルを更新中状態として管理する。更新中状態か否かは、例えばテーブルに対応するフラグを設け、フラグを点灯する等の任意の方法でよい。   Next, it is assumed that the original of the table read by the COBOL program 410 is updated on the relational database 310. At this time, the first control means 320 updates the table stored in the return data storage means 330 and transmits an update notification to the second control means 420. When receiving the update notification, the second control means 420 manages the table for which the update notification has been made among the tables stored in the cache storage means 430 as an updating state. Whether or not it is in the updating state may be any method such as providing a flag corresponding to the table and turning on the flag.

続いてCOBOLプログラム410が上記テーブルに対して3回目のREAD命令を出すと、第2の制御手段420は、上記テーブルが更新中状態として管理されているので、当該READ命令の処理を一時保留する。そして、第2の制御手段420は、第1の制御手段320に対して、上記テーブルを特定する情報を添えて更新後データを要求する。   Subsequently, when the COBOL program 410 issues a third READ instruction to the table, the second control unit 420 temporarily holds the processing of the READ instruction because the table is managed as being updated. . Then, the second control unit 420 requests the updated data with the information specifying the table from the first control unit 320.

第1の制御手段320は、上記の要求を受信すると、返却データ記憶手段330から更新後のデータを読み出し、第2の制御手段420へ返却する。   When receiving the above request, the first control means 320 reads the updated data from the return data storage means 330 and returns it to the second control means 420.

第2の制御手段420は、第1の制御手段320から更新後データを受信すると、受信した更新後のデータをキャッシュ記憶手段430の上記テーブルに反映する。また、更新中状態を解除する。そして、上記保留したREAD命令の処理を再開し、上記テーブルの3つ目のレコードを読み出してCOBOLプログラム410へ返却する。   When receiving the updated data from the first control means 320, the second control means 420 reflects the received updated data in the table of the cache storage means 430. Also, the updating state is released. Then, the processing of the held READ instruction is resumed, and the third record in the table is read and returned to the COBOL program 410.

このように本実施形態によれば、2つ目以降のREAD命令より、SQL文への変換およびリレーショナルデータベース310へのSQL文の発行の処理を省くことができ、COBOLプログラム410がREAD命令を出してから結果を受け取るまでの時間を大幅に短縮することができる。また、第1および第2の計算機間の通信の頻度を少なくすることができる。   As described above, according to the present embodiment, it is possible to omit the conversion to the SQL statement and the issue of the SQL statement to the relational database 310 from the second and subsequent READ instructions, and the COBOL program 410 issues the READ instruction. The time from receiving the result to receiving the result can be greatly reduced. In addition, the frequency of communication between the first and second computers can be reduced.

さらに、READしているテーブルが更新された際には、更新前のテーブルでなく更新後のテーブルをREAD対象とすることができる。   Further, when the table being read is updated, the updated table can be set as the READ target instead of the table before the update.

なお、以上の第1および第2の実施形態は、COBOLプログラムが動作する計算機とリレーショナルデータベースが存在する計算機とが異なる計算機システムに本発明を適用した。しかし、本発明は、同じ計算機上にCOBOLプログラムとリレーショナルデータベースが存在する場合にも適用可能である。   In the first and second embodiments described above, the present invention is applied to a computer system in which a computer in which a COBOL program operates and a computer in which a relational database exists are different. However, the present invention is also applicable when a COBOL program and a relational database exist on the same computer.

[第3の実施形態]
[概要]
本実施形態は、メインフレーム上で動作するCOBOLプログラムにおいて、既存のアクセス方法であるREAD/WRITE命令を使って、オープンサーバ上のデータベースに対して効率的にアクセスする方法を提供する。また本実施形態は、データベースのテーブルに更新があったとき、更新レコードの更新項目について、更新前と更新後の内容を管理し、メインフレーム側が必要とする値のみ転送することで、転送回数と転送量を抑え、処理を効率化する。また本実施形態は、上記のシステムにおいて、メインフレーム上のCOBOLプログラムのREAD/WRITE命令とオープンサーバ上で作成されるSQL文の対応関係をR/W・SQL管理テーブルに記憶しておき、同じREAD、WRITE命令が実行された場合は再変換せずSQLを再利用することを可能にする。
[Third embodiment]
[Overview]
The present embodiment provides a method for efficiently accessing a database on an open server using a READ / WRITE instruction, which is an existing access method, in a COBOL program operating on a mainframe. Also, in this embodiment, when the database table is updated, the update items of the update record are managed before and after the update, and only the values required by the mainframe are transferred, so that the number of transfers Reduce the amount of transfer and improve processing efficiency. In this embodiment, in the above system, the correspondence between the READ / WRITE instruction of the COBOL program on the mainframe and the SQL statement created on the open server is stored in the R / W / SQL management table. When READ and WRITE commands are executed, SQL can be reused without re-conversion.

[構成]
図3は本実施形態の構成を示している。メインフレーム1は、COBOL言語で作成したプログラム11、12を動作させることができ、COBOLプログラム11、12は共有データベース(DB)27へのアクセスをREAD/WRITE命令で行う。
[Constitution]
FIG. 3 shows the configuration of this embodiment. The mainframe 1 can run programs 11 and 12 created in the COBOL language, and the COBOL programs 11 and 12 access the shared database (DB) 27 by READ / WRITE instructions.

メインフレーム1には、データアクセス位置管理手段13、結果データ管理手段14、COBOLプログラム1の結果データ15、COBOLプログラム2の結果データ16が含まれている。   The mainframe 1 includes data access position management means 13, result data management means 14, result data 15 of COBOL program 1, and result data 16 of COBOL program 2.

結果データは、COBOLプログラムがオープンサーバ上のデータベースにアクセスを行った結果のデータを格納し、COBOLプログラム別にプログラム実行開始時に作成され、プログラムの実行終了時に消滅する。結果データは、第1および第2の実施形態におけるキャッシュ記憶手段に相当する。   The result data stores the data of the result of the COBOL program accessing the database on the open server, created for each COBOL program at the start of program execution, and disappears at the end of program execution. The result data corresponds to the cache storage means in the first and second embodiments.

データアクセス位置管理手段13は、COBOLプログラムが読み込み中のレコードの現在位置を管理し、読み込みの中断や再読み込みが発生した時、適切な位置から処理を再開することができる。   The data access position management means 13 manages the current position of the record being read by the COBOL program, and can resume processing from an appropriate position when reading is interrupted or reread.

結果データ管理手段14は、各COBOLプログラムの結果データを管理し、該当するデータの格納や取り出しを行う。また、オープンサーバから更新通知を受信したときは、対象となる結果データを更新中状態とし、次のREAD要求で古いデータを読み込まないように動作を中断させる。次のREAD要求があったときには、オープンサーバ2の返却データ管理手段28に更新データの転送を要求し、データの転送完了後(反映完了後)に、読込を再開させる。   The result data management means 14 manages the result data of each COBOL program, and stores and retrieves the corresponding data. When the update notification is received from the open server, the target result data is set to the updating state, and the operation is interrupted so that the old data is not read by the next READ request. When there is a next READ request, the return data management means 28 of the open server 2 is requested to transfer the update data, and the reading is resumed after the data transfer is completed (after the reflection is completed).

メインフレーム1は、オープンサーバ上のR/W・SQL管理手段21に含まれるRW-SQL変換手段22と返却データ管理手段28に含まれる結果データ転送手段30と、更新管理手段31に含まれる更新通知手段34と通信が可能となっている。   Mainframe 1 includes RW-SQL conversion means 22 included in R / W / SQL management means 21 on the open server, result data transfer means 30 included in return data management means 28, and update included in update management means 31 Communication with the notification means 34 is possible.

COBOLプログラムが動作するメインフレーム1と、READ/WRITE命令とSQLの変換を行うR/W-SQL管理手段21は、全て同一マシン上でも、別マシン上でも、または一部が別マシン上であってもよい。   The mainframe 1 on which the COBOL program runs and the R / W-SQL management means 21 that performs the conversion of READ / WRITE instructions and SQL are all on the same machine, on different machines, or partly on different machines. May be.

オープンサーバ2のR/W-SQL管理手段21は、R/W-SQL変換手段22、R/W-SQL変換保存手段23、SQL発行手段24、結果保存手段25、R/W命令SQL管理テーブル26から構成される。   The R / W-SQL management means 21 of the open server 2 includes an R / W-SQL conversion means 22, an R / W-SQL conversion storage means 23, an SQL issue means 24, a result storage means 25, an R / W instruction SQL management table. Consists of 26.

R/W-SQL変換手段22は、メインフレーム1のCOBOLプログラムからのREAD、WRITE命令を受信し、SQL文に変換する手段である。変換前のR/W命令とSQL文の対応は、R/W-SQL変換保存手段23によってR/W命令SQL管理テーブル26に記憶する。2回目以降の要求の場合、R/W-SQL変換手段22は、R/W命令SQL管理テーブル26に記憶されている変換結果を取得する。   The R / W-SQL conversion means 22 is means for receiving READ and WRITE instructions from the COBOL program of the mainframe 1 and converting them into SQL statements. The correspondence between the R / W instruction before conversion and the SQL statement is stored in the R / W instruction SQL management table 26 by the R / W-SQL conversion storage means 23. In the case of the second and subsequent requests, the R / W-SQL conversion means 22 acquires the conversion result stored in the R / W instruction SQL management table 26.

SQL発行手段24は、R/W-SQL変換手段22で変換した結果のSQL文を共有DB27に対して発行し、結果を受け取る。共有DB27はメインフレーム1以外からのアクセも受け付ける、オープンサーバ上で動作するリレーショナルデータベースである。   The SQL issuing means 24 issues the SQL statement resulting from the conversion by the R / W-SQL conversion means 22 to the shared DB 27 and receives the result. The shared DB 27 is a relational database that operates on an open server that accepts accesses from other than the mainframe 1.

結果保存手段25は、共有DB27にSQLアクセスした結果をSQL発行手段24から受け取り、結果データ29に保存する。結果保存手段25は、READ命令の結果のみ結果データに保存する。   The result storage means 25 receives the result of SQL access to the shared DB 27 from the SQL issuing means 24 and stores it in the result data 29. The result storage means 25 stores only the result of the READ command in the result data.

返却データ管理手段28は、結果データ29、結果データ転送手段30から構成される。   The return data management means 28 includes result data 29 and result data transfer means 30.

結果データ29は、R/W・SQL管理手段21の結果保存手段25によって、共有DB27のアクセス結果が保存される。結果データ29は、図5に示される管理テーブルでレコード単位に状態管理を行う。結果データ29における、管理テーブル内の状態管理フラグの種類と意味を図4に示す。   In the result data 29, the access result of the shared DB 27 is stored by the result storage unit 25 of the R / W / SQL management unit 21. The result data 29 is state-managed for each record in the management table shown in FIG. The types and meanings of the status management flags in the management table in the result data 29 are shown in FIG.

図5に示されるように、レコードには主キーとしてレコードの登録順に値が振られている。また、結果データの状態を管理するフラグは、メインフレーム1の結果データと返却データ管理手段28の結果データ29を比較したときのデータの状態を表している。図4に示されるように、管理フラグは、ACTIVE/INACTIVE状態のどちらかになる。ACTIVEの場合、メインフレームの結果データは返却データ管理手段28で管理している結果データ29と同じ内容であり、最新の状態となっている。INACTIVEの場合、メインフレームの結果データと返却データ管理手段の結果データは異なり、メインフレームの結果データは、更新結果転送前の状態のデータになっている。INACTIVEは、どの手段でデータが更新されたかを表すUPDATE/INSERT/DELETEの3種類に分けられる。返却データ管理手段28の結果データはレコード単位に状態管理フラグで管理する。結果データ転送手段30は、メインフレーム1の結果データ管理手段14に対して、結果データ29に保存されたデータのうち、更新状態のレコードのみ転送する。   As shown in FIG. 5, values are assigned to records in the order of record registration as primary keys. The flag for managing the state of the result data represents the state of the data when the result data of the main frame 1 and the result data 29 of the return data management means 28 are compared. As shown in FIG. 4, the management flag is in either the ACTIVE / INACTIVE state. In the case of ACTIVE, the main frame result data has the same contents as the result data 29 managed by the return data management means 28, and is in the latest state. In the case of INACTIVE, the result data of the main frame and the result data of the return data management unit are different, and the result data of the main frame is data in a state before the update result is transferred. INACTIVE is divided into three types of UPDATE / INSERT / DELETE that indicate which means the data is updated. The result data of the return data management means 28 is managed by the status management flag for each record. The result data transfer means 30 transfers only the record in the updated state among the data stored in the result data 29 to the result data management means 14 of the main frame 1.

更新管理手段31は、更新結果記憶手段32、更新確定手段33、更新通知手段34から構成される。   The update management unit 31 includes an update result storage unit 32, an update confirmation unit 33, and an update notification unit 34.

更新結果記憶手段32は、共有DB27のテーブルの行が更新された場合(すなわち、DBから行の更新が通知された場合)、共有DB27から更新されたレコードの主キーと更新後の値を受け取り、更新レコードの情報を自手段32内の更新結果一時記憶領域に一時的に記憶しておく。更新されたテーブルが、メインフレームのCOBOLプログラムが使用していないテーブルの場合、何も記憶しない。COBOLプログラムから使用しているテーブルの場合は、更新が完了するまで、レコード内容を更新する。更新が連続で起こる場合は、全ての更新処理が完了するまで値を上書きする。   The update result storage means 32 receives the primary key of the record updated from the shared DB 27 and the updated value when the row of the table of the shared DB 27 is updated (that is, when the row update is notified from the DB). The information of the update record is temporarily stored in the update result temporary storage area in the means 32. If the updated table is not used by the mainframe COBOL program, nothing is stored. In the case of a table used from a COBOL program, the record contents are updated until the update is completed. If updates occur continuously, the value is overwritten until all update processes are completed.

更新確定手段33は、全ての更新完了時(すなわち、DBからCOMMITが通知された場合)、図9に示すように、上記更新結果一時記憶領域に一時的に記憶している更新内容を結果データ29に反映する。このとき、更新結果記憶手段32の主キーから、結果データ29の更新前の値と比較し、既にあるレコードの場合はUPDATE、追加されたレコードの場合はINSERT、削除されたレコードの場合はDELETEの状態管理フラグを設定する。なお、更新が破棄された場合(すなわち、DBからROLLBACKが通知された場合)は、更新結果一時記憶領域を消去し、結果データ29の更新は行わない。   The update confirmation means 33, when all the updates are completed (that is, when COMMIT is notified from the DB), as shown in FIG. 9, the update contents temporarily stored in the update result temporary storage area as result data Reflect in 29. At this time, from the primary key of the update result storage means 32, it compares with the value before update of the result data 29, UPDATE for the existing record, INSERT for the added record, DELETE for the deleted record Set the state management flag. When the update is discarded (that is, when ROLLBACK is notified from the DB), the update result temporary storage area is erased and the result data 29 is not updated.

更新通知手段34は、共有DBからの更新を受信した後、その更新レコードが結果データ29に該当するレコードの場合は、メインフレーム1の結果データ管理手段14に更新通知を送信する。更新通知は、結果データ単位で送信され、結果データ管理手段14は対象となる結果データ15、16に対してデータ更新状態フラグをセットする。   After receiving the update from the shared DB, the update notification unit 34 transmits an update notification to the result data management unit 14 of the main frame 1 when the update record corresponds to the result data 29. The update notification is transmitted in units of result data, and the result data management means 14 sets a data update state flag for the target result data 15 and 16.

<結果データ29の保存項目>
オープンサーバ上の結果データ29に保存する項目として、結果保存手段25から受信するSQL発行結果であるレコードデータ、結果データ状態管理フラグがある。これらは図5に示すように、主キーによってデータベースのレコードと対応づけられている。
<Items to save result data 29>
Items to be stored in the result data 29 on the open server include record data that is an SQL issuance result received from the result storage unit 25 and a result data state management flag. As shown in FIG. 5, these are associated with records in the database by primary keys.

<更新結果記憶手段32の保存項目>
更新結果記憶手段32に保存する項目として、テーブル名、主キー、レコード情報(列名、値)がある。これらの項目から、更新すべき結果データ29のレコードを特定する。
<Items stored in the update result storage means 32>
Items stored in the update result storage means 32 include a table name, primary key, and record information (column name, value). From these items, the record of the result data 29 to be updated is specified.

<COBOLプログラム11、12の結果データの保存項目>
COBOLプログラム11、12単位に結果データ15、16が作成され、各結果データに含まれる項目は、オープンサーバ2上でのSQLアクセスの結果であるレコード、データ更新状態フラグとなる。データ更新状態フラグは、オープンサーバで管理しているレコード単位のフラグとは異なり、テーブル単位で管理する。データ更新状態フラグは、オープンサーバ上の共有DB27で更新が発生した場合、即座に更新通知手段34から通知され、更新状態となる。COBOLプログラムから更新状態の結果データに読み込みが発生した場合は、新しい結果データをオープンサーバ上の結果データ29から取得する。読み込み中に更新状態になった場合は、読み込みを一時中断し、更新処理が完了した後、更新後の結果データを結果データ転送手段30から転送する。
<Items to save result data of COBOL programs 11 and 12>
Result data 15 and 16 are created for each COBOL program 11 and 12, and the items included in each result data are records and data update status flags that are the results of SQL access on the open server 2. The data update status flag is managed in units of tables, unlike the record unit flags managed in the open server. When an update occurs in the shared DB 27 on the open server, the data update status flag is immediately notified from the update notification means 34 and becomes an update status. When the update result data is read from the COBOL program, new result data is acquired from the result data 29 on the open server. When the update state is reached during reading, the reading is temporarily interrupted, and after the update process is completed, the updated result data is transferred from the result data transfer means 30.

[動作]
メインフレーム1が、オープンサーバ上のデータベースにREADアクセスを行う場合の動作を図6に示す。
[Operation]
FIG. 6 shows the operation when the mainframe 1 performs READ access to the database on the open server.

メインフレーム1上のCOBOLプログラム11から1回目のREAD命令が発行されたとき、データアクセス位置管理手段13はオープンサーバ2上のR/W-SQL変換手段22にREAD要求を出す。   When the first READ instruction is issued from the COBOL program 11 on the mainframe 1, the data access location management means 13 issues a READ request to the R / W-SQL conversion means 22 on the open server 2.

R/W-SQL変換手段22は、受け取ったREAD命令と同じデータ(テーブル)が取得できるSQL文を生成する。以前に同じREAD命令を実行している場合、変換は実行せず、R/W命令SQL管理テーブル26からREAD命令に該当するSQL文を取得する。新規に変換を行った場合は、R/W-SQL変換保存手段23がR/W命令SQL管理テーブルに変換内容としてREAD命令とSQL文の組み合わせを保存する。SQL発行手段24は、READ命令の変換結果であるSQL文を、共有DB27に発行し、結果を受け取る。受け取った結果は、結果保存手段25によって、結果データ29に保存される。結果データ29に格納されたデータは、結果データ転送手段30によってメインフレーム1の結果データ管理手段14に転送される。   The R / W-SQL conversion means 22 generates an SQL statement that can acquire the same data (table) as the received READ instruction. If the same READ instruction has been executed before, the conversion is not executed, and the SQL statement corresponding to the READ instruction is acquired from the R / W instruction SQL management table 26. When a new conversion is performed, the R / W-SQL conversion storage unit 23 stores a combination of a READ instruction and an SQL sentence as conversion contents in the R / W instruction SQL management table. The SQL issuing means 24 issues an SQL statement, which is the conversion result of the READ instruction, to the shared DB 27 and receives the result. The received result is stored in the result data 29 by the result storage unit 25. The data stored in the result data 29 is transferred to the result data management means 14 of the main frame 1 by the result data transfer means 30.

結果データ管理手段14は、該当するCOBOLプログラムの結果データ15にデータを格納し、COBOLプログラムに先頭レコードを返却する。READ命令で次のレコードを読み込むときは、COBOLプログラム11は、自分の結果データ15に対してREAD命令を発行し、データを読み込む。データアクセス位置管理手段13は、読み込み位置を判断し、前回読み込んだ次のレコードから読み込めるよう管理する。   The result data management means 14 stores the data in the result data 15 of the corresponding COBOL program, and returns the first record to the COBOL program. When reading the next record with the READ instruction, the COBOL program 11 issues a READ instruction to its own result data 15 and reads the data. The data access position management means 13 determines the reading position and manages it so that it can be read from the next record read last time.

メインフレーム1が、オープンサーバ上のデータベースにWRITEアクセスを行う場合の動作を図7に示す。   FIG. 7 shows the operation when the mainframe 1 performs WRITE access to the database on the open server.

COBOLプログラム11からWRITE命令があったとき、WRITE命令はデータアクセス位置管理手段13を経由し、オープンサーバ2のR/W-SQL変換手段22で、SQL文に変換される。初回の変換時には、R/W-SQL変換保存手段23によって変換後のSQL文とWRITE命令の対応が保存される。SQL発行手段24は、共有DB27に対して、SQLを発行し、更新結果をメインフレームに返却する。   When there is a WRITE instruction from the COBOL program 11, the WRITE instruction is converted into an SQL statement by the R / W-SQL conversion means 22 of the open server 2 via the data access position management means 13. At the first conversion, the correspondence between the converted SQL statement and the WRITE instruction is stored by the R / W-SQL conversion storage unit 23. The SQL issuing means 24 issues SQL to the shared DB 27 and returns the update result to the mainframe.

メインフレーム1のCOBOLプログラムの結果データ15に存在するデータに対応する、共有DBのレコードが更新された場合の動作を図8、図9、図10に示す。   The operation when the shared DB record corresponding to the data existing in the result data 15 of the COBOL program of the mainframe 1 is updated is shown in FIGS.

図8は、共有DBが更新された後の動作についての説明図である。既にCOBOLプログラムがREAD命令で共有DBにアクセスしたことがあり、結果データ管理手段14の結果データにREAD命令のデータが保存されている状態であるとする。この状態で、共有DBに対して更新が行われた場合(前記のCOBOLプログラム11からのWRITE要求により共有DBが更新された場合も含む)、更新管理手段31は更新されたレコードの属するテーブルや主キー、新旧値の情報を受信し、そのレコードが結果データ管理手段の結果データに含まれているテーブルとレコードかどうかを判断する。   FIG. 8 is an explanatory diagram of the operation after the shared DB is updated. Assume that the COBOL program has already accessed the shared DB with the READ instruction, and the READ instruction data is stored in the result data of the result data management means 14. In this state, when the shared DB is updated (including the case where the shared DB is updated by the WRITE request from the COBOL program 11), the update management unit 31 stores the table to which the updated record belongs. The primary key and new / old value information is received, and it is determined whether or not the record is a table and a record included in the result data of the result data management means.

含まれている場合、更新結果記憶手段32が、行の更新を契機として、共有DBから受け取った更新されたレコード情報を更新結果一時記憶領域に保存する。次に、DBから更新確定が通知されると、更新確定手段33が、更新結果一時記憶領域の中の新旧レコードの値を参照し、結果データ29を更新後の値で更新する。更新対象のレコードの判別は、レコードの生成順に設定された主キーで行い、該当する結果データのレコードの値の更新やレコードの追加、削除を行い、各レコードの更新状態フラグに対して、UPDATE、INSERT、DELETEのどれによって更新されたかを設定する。どのフラグを設定するかは、新旧の値を比較した結果で決定する。新旧両方の値が存在する場合はUPDATE、新しい値だけ存在する場合はINSERT、新しい値が存在しない場合はDELETEを設定する。続いて、結果データ29の更新後、更新通知手段34はメインフレームに更新通知を行い、該当するCOBOLプログラムの結果データに対して、結果データの内容が最新状態ではないことを通知する。   If it is included, the update result storage unit 32 saves the updated record information received from the shared DB in the update result temporary storage area when the row is updated. Next, when update confirmation is notified from the DB, the update confirmation means 33 refers to the values of the new and old records in the update result temporary storage area and updates the result data 29 with the updated values. The record to be updated is determined by the primary key set in the order of record generation, the record value of the corresponding result data is updated, the record is added, and the record is updated, and the update status flag of each record is updated. Sets whether updated by, INSERT, or DELETE. Which flag is set is determined by comparing the old and new values. Set UPDATE if both old and new values exist, INSERT if only new values exist, and DELETE if no new values exist. Subsequently, after updating the result data 29, the update notification means 34 notifies the mainframe of the update, and notifies the result data of the corresponding COBOL program that the content of the result data is not the latest state.

メインフレームは通知を受け取った後、対象となるメインフレームの結果データのデータ更新状態フラグを設定する。このフラグが設定されているときは、プログラムはデータの読み込みを一時中断する。   After receiving the notification, the main frame sets a data update state flag of the result data of the target main frame. When this flag is set, the program temporarily stops reading data.

更新レコードの確定方法と転送の動作を図9を参照して説明する。   An update record determination method and transfer operation will be described with reference to FIG.

更新結果としてオープンサーバの結果データ29に反映されたレコードは、メインフレームで次のREADが実行されたとき、メインフレームの結果データ管理手段14からの要求によりメインフレームに送信される。このとき、状態管理フラグの種類によって、メインフレーム側結果データの反映方法が異なる。UPDATEフラグのレコードの場合、既存レコードに値を上書きする。INSERTフラグのレコードの場合、新規レコードとして後ろに追加する。DELETEフラグのレコードの場合、既存レコードを削除する。この反映方法により、メインフレームのデータベースに対するREAD命令でのアクセス方法と同様の結果が得られる。   The record reflected in the result data 29 of the open server as an update result is transmitted to the main frame in response to a request from the result data management means 14 of the main frame when the next READ is executed on the main frame. At this time, the reflection method of the main frame side result data differs depending on the type of the state management flag. In the case of a record with the UPDATE flag, the value is overwritten on the existing record. In the case of a record with the INSERT flag, it is added as a new record. If the record is a DELETE flag, the existing record is deleted. By this reflection method, the same result as the access method by the READ instruction to the mainframe database can be obtained.

更新開始から終了までの流れを図10、図11のフローチャートに示す。図10は、共有DBから更新されたレコードを受け取り、更新結果記憶手段の一時記憶領域に保存するまでの流れである。図11は、一時記憶領域に記憶されたレコードの、結果データへの反映処理の流れである。   The flow from the start to the end of the update is shown in the flowcharts of FIGS. FIG. 10 is a flow from receiving the updated record from the shared DB to storing it in the temporary storage area of the update result storage means. FIG. 11 is a flow of a process for reflecting the record stored in the temporary storage area to the result data.

[効果]
本実施形態によれば、必要なデータのみメインフレームに転送することができるため、データの転送量や転送回数を削減することができ、効率的なデータ転送を行うことができる。また、SQLアクセスを最小限にすることで、冗長なデータベースアクセスを防ぐことができ、データベースに対する負担を軽減する効果がある。
[effect]
According to the present embodiment, since only necessary data can be transferred to the mainframe, the amount of data transfer and the number of transfers can be reduced, and efficient data transfer can be performed. In addition, by minimizing SQL access, redundant database access can be prevented, and the burden on the database can be reduced.

[第4の実施形態]
本実施形態では、更新をレコード単位で管理せず、再度SQL文を発行してデータを更新する。図12は本実施形態のブロック図である。
[Fourth embodiment]
In this embodiment, the update is not managed in units of records, but the SQL statement is issued again to update the data. FIG. 12 is a block diagram of the present embodiment.

データベースの更新時に、レコード単位ではなく、テーブル単位で更新を検出し、再度SQLを発行しデータベースからデータを取得する。共有DB27は、テーブル単位で更新を検出し、結果データ更新手段35に更新されたテーブルを通知する。結果データ更新手段35は、更新されたテーブルが、結果データ29に格納されているかどうかを調べ、格納されている場合はSQL発行手段24にSQL文の再発行要求を出す。SQL発行手段24は、共有DB27にアクセスし、受信したデータを結果データ29に格納する。結果データ転送手段30は、結果データ管理手段14から更新後データが要求されると、更新されたテーブルを返却する。   When updating the database, update is detected in table units, not in record units, and SQL is issued again to acquire data from the database. The shared DB 27 detects the update in units of tables and notifies the result data update unit 35 of the updated table. The result data updating means 35 checks whether or not the updated table is stored in the result data 29, and if it is stored, issues a SQL statement reissue request to the SQL issuing means 24. The SQL issuing means 24 accesses the shared DB 27 and stores the received data in the result data 29. When the updated data is requested from the result data management unit 14, the result data transfer unit 30 returns the updated table.

本実施形態によれば、レコード単位で更新内容を管理する必要がなく、結果の反映が簡略化できる。   According to this embodiment, it is not necessary to manage the update contents in units of records, and the reflection of the results can be simplified.

以上本発明の実施の形態について説明したが、本発明は以上の実施の形態にのみ限定されず、その他各種の付加変更が可能である。また、本発明は、その有する機能をハードウェア的に実現することは勿論、コンピュータとプログラムとで実現することができる。プログラムは、磁気ディスクや半導体メモリ等のコンピュータ可読記録媒体に記録されて提供され、コンピュータの立ち上げ時などにコンピュータに読み取られ、そのコンピュータの動作を制御することにより、そのコンピュータを前述した各実施の形態における第1および第2の制御手段として機能させる。   Although the embodiment of the present invention has been described above, the present invention is not limited to the above embodiment, and various other additions and modifications can be made. In addition, the present invention can be realized by a computer and a program as well as by realizing the functions of the hardware. The program is provided by being recorded on a computer-readable recording medium such as a magnetic disk or a semiconductor memory, and is read by the computer at the time of starting up the computer, etc. It functions as the first and second control means in the embodiment.

本発明は、リレーショナルデータベース等のデータベースにアクセスするCOBOLプログラムが稼働する計算機に利用できる。   The present invention can be used for a computer that runs a COBOL program that accesses a database such as a relational database.

100、300…第1の計算機
110、310…リレーショナルデータベース
120、320…第1の制御手段
200、400…第2の計算機
210、410…COBOLプログラム
220、420…第2の制御手段
230、430…キャッシュ記憶手段
330…返却データ記憶手段
100, 300 ... 1st calculator
110, 310 ... Relational database
120, 320 ... first control means
200, 400 ... second calculator
210, 410 ... COBOL program
220, 420 ... second control means
230, 430 ... Cache storage means
330 ... Return data storage means

Claims (7)

リレーショナルデータベースのテーブルに対して出されたREAD命令を、前記テーブルを参照するSQL文による命令に変換して前記リレーショナルデータベースに発行する第1の制御手段と、
前記テーブルを一時的に記憶するキャッシュ記憶手段を有し、COBOLプログラムから前記リレーショナルデータベースの前記テーブルに対してREAD命令が出されたとき、前記テーブルに対する1回目のREAD命令であれば、前記第1の制御手段を通じて前記テーブルを取得して前記キャッシュ記憶手段に記憶すると共に前記テーブルの1つ目のレコードを前記COBOLプログラムに返却し、2回目以降のREAD命令であれば、前記キャッシュ記憶手段から前記テーブルの2つ目以降のレコードを読み出して前記COBOLプログラムに返却する第2の制御手段と
を有する計算機システム。
A first control means for converting a READ instruction issued to a table of the relational database into an instruction by an SQL statement referring to the table and issuing the instruction to the relational database;
The cache storage means for temporarily storing the table, and when a READ instruction is issued from the COBOL program to the table of the relational database, if the first READ instruction for the table, the first The table is acquired through the control means and stored in the cache storage means, and the first record of the table is returned to the COBOL program. A computer system having a second control means for reading the second and subsequent records of the table and returning them to the COBOL program.
前記リレーショナルデータベースと前記第1の制御手段とを有する第1の計算機と、
前記第1の計算機と通信可能に接続され、前記第2の制御手段を有し、前記COBOLプログラムが動作する第2の計算機と
から構成される
ことを特徴とする請求項1に記載の計算機システム。
A first computer having the relational database and the first control means;
2. The computer system according to claim 1, wherein the computer system is configured to be connected to the first computer so as to be communicable, includes the second control unit, and includes a second computer on which the COBOL program operates. .
前記第1の制御手段は、前記第2の制御手段に返却した前記テーブルを記憶する返却データ記憶手段を有し、前記返却データ記憶手段に記憶されている前記テーブルのオリジナルが前記リレーショナルデータベース上で更新されたときに前記返却データ記憶手段に記憶されている前記テーブルを更新すると共に前記第1の計算機に更新通知を送信し、前記第2の制御手段から更新後のデータが要求された際に前記返却データ記憶手段に記憶されている前記テーブルから更新後のデータを読み出して返却し、
前記第2の制御手段は、前記キャッシュ記憶手段に記憶されている前記テーブルのうち前記更新通知のあったテーブルを更新中状態として管理し、更新中状態のテーブルに対して前記COBOLプログラムからREAD命令が出されたときは、前記第1の制御手段に対して要求を出して取得した更新後のデータを前記キャッシュ記憶手段の前記テーブルに反映した後に読み出しを行う
ことを特徴とする請求項2に記載の計算機システム。
The first control means has return data storage means for storing the table returned to the second control means, and the original of the table stored in the return data storage means is stored on the relational database. When updated, the table stored in the return data storage means is updated and an update notification is sent to the first computer, and updated data is requested from the second control means. Read and return the updated data from the table stored in the return data storage means,
The second control unit manages the table notified of the update among the tables stored in the cache storage unit as an updating state, and reads a READ instruction from the COBOL program on the table in the updating state. 3. The method according to claim 2, wherein when the data is issued, the updated data acquired by issuing a request to the first control unit is reflected in the table of the cache storage unit, and then read out. The computer system described.
前記第1の制御手段は、レコード単位で更新の有無を管理し、前記第2の制御手段から更新後のデータが要求されたときは、更新されたレコードだけを前記更新後のデータとして返却する
ことを特徴とする請求項3に記載の計算機システム。
The first control means manages the presence or absence of update in units of records, and when updated data is requested from the second control means, only the updated record is returned as the updated data. The computer system according to claim 3.
前記第1の制御手段は、テーブル単位で更新の有無を管理し、前記第2の制御手段から更新後のデータが要求されたときは、更新されたテーブルを前記更新後のデータとして返却する
ことを特徴とする請求項3に記載の計算機システム。
The first control means manages the presence / absence of update in units of tables, and when updated data is requested from the second control means, the updated table is returned as the updated data. The computer system according to claim 3.
第1の制御手段と、キャッシュ記憶手段と、第2の制御手段とを有する計算機システムが実行する制御方法であって、
前記第1の制御手段が、リレーショナルデータベースのテーブルに対して出されたREAD命令を、前記テーブルを参照するSQL文による命令に変換して前記リレーショナルデータベースに発行し、
前記第2に制御手段が、COBOLプログラムから前記リレーショナルデータベースの前記テーブルに対してREAD命令が出されたとき、前記テーブルに対する1回目のREAD命令であれば、前記第1の制御手段を通じて前記テーブルを取得して前記キャッシュ記憶手段に記憶すると共に前記テーブルの1つ目のレコードを前記COBOLプログラムに返却し、2回目以降のREAD命令であれば、前記キャッシュ記憶手段から前記テーブルの2つ目以降のレコードを読み出して前記COBOLプログラムに返却する
ことを特徴とする計算機システムの制御方法。
A control method executed by a computer system having a first control means, a cache storage means, and a second control means,
The first control means converts the READ instruction issued to the table of the relational database into an instruction by an SQL statement that refers to the table, and issues the instruction to the relational database.
The second control means, when a READ command is issued to the table of the relational database from a COBOL program, if the first READ instruction for the table, the table is stored through the first control means. Acquire and store in the cache storage means and return the first record of the table to the COBOL program, and if it is the second or later READ instruction, the cache storage means from the second or later of the table A computer system control method characterized by reading a record and returning it to the COBOL program.
リレーショナルデータベースと記憶手段とを有し、COBOLプログラムが動作するコンピュータを、
前記リレーショナルデータベースのテーブルに対して出されたREAD命令を、前記テーブルを参照するSQL文による命令に変換して前記リレーショナルデータベースに発行する第1の制御手段と、
前記テーブルを一時的に記憶するキャッシュ記憶手段を有し、前記COBOLプログラムから前記リレーショナルデータベースの前記テーブルに対してREAD命令が出されたとき、前記テーブルに対する1回目のREAD命令であれば、前記第1の制御手段を通じて前記テーブルを取得して前記キャッシュ記憶手段に記憶すると共に前記テーブルの1つ目のレコードを前記COBOLプログラムに返却し、2回目以降のREAD命令であれば、前記キャッシュ記憶手段から前記テーブルの2つ目以降のレコードを読み出して前記COBOLプログラムに返却する第2の制御手段と
して機能させるためのプログラム。
A computer that has a relational database and storage means and runs COBOL programs.
First control means for converting a READ instruction issued to the table of the relational database into an instruction by an SQL statement referring to the table and issuing the instruction to the relational database;
A cache storage means for temporarily storing the table, and when a READ instruction is issued from the COBOL program to the table of the relational database, the first instruction is the first READ instruction for the table; The table is acquired through the control means 1 and stored in the cache storage means, and the first record of the table is returned to the COBOL program, and if it is a second or subsequent READ instruction, the cache storage means A program for functioning as a second control means for reading the second and subsequent records of the table and returning them to the COBOL program.
JP2011063474A 2011-03-23 2011-03-23 Computer system Expired - Fee Related JP5664389B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011063474A JP5664389B2 (en) 2011-03-23 2011-03-23 Computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011063474A JP5664389B2 (en) 2011-03-23 2011-03-23 Computer system

Publications (2)

Publication Number Publication Date
JP2012198829A true JP2012198829A (en) 2012-10-18
JP5664389B2 JP5664389B2 (en) 2015-02-04

Family

ID=47180959

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011063474A Expired - Fee Related JP5664389B2 (en) 2011-03-23 2011-03-23 Computer system

Country Status (1)

Country Link
JP (1) JP5664389B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5640550A (en) * 1994-04-15 1997-06-17 Coker; Drake Computer system for generating SQL statements from COBOL code
JPH10289133A (en) * 1997-04-11 1998-10-27 Mitsubishi Electric Corp Data base access method
JP2004094289A (en) * 2002-08-29 2004-03-25 Toshiba Tec Corp Heterogeneous database access method and office computer using the method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5640550A (en) * 1994-04-15 1997-06-17 Coker; Drake Computer system for generating SQL statements from COBOL code
JPH10289133A (en) * 1997-04-11 1998-10-27 Mitsubishi Electric Corp Data base access method
JP2004094289A (en) * 2002-08-29 2004-03-25 Toshiba Tec Corp Heterogeneous database access method and office computer using the method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CSND199800540002; 千田淳: '重要性増す性能問題の解決策' 日経コンピュータ 第338号, 19940530, 日経BP社 *
JPN6014033250; 千田淳: '重要性増す性能問題の解決策' 日経コンピュータ 第338号, 19940530, 日経BP社 *

Also Published As

Publication number Publication date
JP5664389B2 (en) 2015-02-04

Similar Documents

Publication Publication Date Title
CN101046821B (en) Generic database manipulator
JP6181290B2 (en) Transaction ordering
US8589361B2 (en) Reduced disk space standby
CN101364217B (en) Data maintenance method, device and system in database
KR102119258B1 (en) Technique for implementing change data capture in database management system
JP4282030B2 (en) Data duplex control method and duplex storage subsystem
US7457921B2 (en) Write barrier for data storage integrity
CN109992628B (en) Data synchronization method, device, server and computer readable storage medium
US7698319B2 (en) Database system management method, database system, database device, and backup program
JP2010134522A (en) Method, program and device for management of database
KR20200056357A (en) Technique for implementing change data capture in database management system
WO2016192496A1 (en) Data migration processing method and device
CN111538463A (en) A Method for Realizing In-Memory Database Persistence
EP4170509A1 (en) Method for playing back log on data node, data node, and system
WO2022127866A1 (en) Data processing method and apparatus, and electronic device and storage medium
CN102945251A (en) Method for optimizing performance of disk database by memory database technology
CN102521028B (en) Transactional memory system under distributed environment
WO2023197404A1 (en) Object storage method and apparatus based on distributed database
US9002796B2 (en) Database management method, database management system and database management program
US8140493B2 (en) Changing metadata without invalidating cursors
CN108280123B (en) HBase column polymerization method
US20110106760A1 (en) Synchronizing database and non-database resources without a commit coordinator
JP5664389B2 (en) Computer system
US7251660B2 (en) Providing mappings between logical time values and real time values in a multinode system
CN116226128A (en) An optimization method for cold and hot separation of OLAP engine using object storage as cold storage

Legal Events

Date Code Title Description
RD07 Notification of extinguishment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7427

Effective date: 20120719

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140207

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140728

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140812

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141002

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: 20141111

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141124

R150 Certificate of patent or registration of utility model

Ref document number: 5664389

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees