JP2006040064A - Database access apparatus - Google Patents

Database access apparatus Download PDF

Info

Publication number
JP2006040064A
JP2006040064A JP2004220812A JP2004220812A JP2006040064A JP 2006040064 A JP2006040064 A JP 2006040064A JP 2004220812 A JP2004220812 A JP 2004220812A JP 2004220812 A JP2004220812 A JP 2004220812A JP 2006040064 A JP2006040064 A JP 2006040064A
Authority
JP
Japan
Prior art keywords
generation
query
database
transaction
client
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
JP2004220812A
Other languages
Japanese (ja)
Inventor
Takashi Matsuura
俊 松浦
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 JP2004220812A priority Critical patent/JP2006040064A/en
Publication of JP2006040064A publication Critical patent/JP2006040064A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To access a generation management type database by using a query, which is not defined so as to specify a generation number, and further to perform reference and alteration many times regarding the generation management type database during one transaction. <P>SOLUTION: A client interface part 122 receives a query described by an SQL (Structured Query Language) from a client 110 and provides the client 110 with an interface such as a JDBC (Java Database Connectivity). A query converting part 124 converts the query obtained from the client 110 through the client interface part 122 into a query of a generation control type database native. A transaction management part 126 has a transaction management table 128 for managing a series of queries from the client 110 as a transaction and a generation control table 130 for controlling the generation numbers to be related to the respective queries in the transaction. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、データベースアクセス装置に関し、特に、世代や版といった単位でデータ管理を行うデータベースに対して、データの参照や更新などのアクセスを行うための装置に関する。   The present invention relates to a database access apparatus, and more particularly to an apparatus for performing access such as data reference and update to a database that manages data in units such as generations and editions.

図21(A)および図21(B)は、データベースアクセスの概念を説明するための図である。   FIG. 21A and FIG. 21B are diagrams for explaining the concept of database access.

図21(A)に示すように、データベース1に接続されたクライアント3からデータベース1に対してデータの参照を行う問い合わせ(クエリ)を発行すると、データベース1は、クエリで示された条件に合致するデータを問い合わせの結果としてクライアント3に返信する。   As shown in FIG. 21A, when a client 3 connected to the database 1 issues an inquiry (query) for referring to data to the database 1, the database 1 matches the condition indicated by the query. Data is returned to the client 3 as a result of the inquiry.

また、図21(B)に示すように、データベース1に対してデータの更新、追加、削除のようなデータの変更を行うクエリを発行すると、データベース1は、クエリに示された条件に合致するデータの更新、追加、削除を行い、問い合わせの結果をクライアント3に返信する。このとき、データベース1が世代や版といった単位でデータ管理を行うデータベース(世代管理型データベース)の場合、データの変更を行うクエリをデータベース1が受け付けることにより、変更後の新たなデータベース状態を示すための「世代」と呼ばれる情報が作成される。   Further, as shown in FIG. 21B, when a query for changing data such as data update, addition, or deletion is issued to the database 1, the database 1 meets the conditions indicated in the query. Data is updated, added, or deleted, and the result of the inquiry is returned to the client 3. At this time, when the database 1 is a database that manages data in units such as generations and editions (generation management type database), the database 1 accepts a query for changing data, thereby indicating a new database state after the change. Information called “generation” is created.

より詳細に説明すると、世代管理型データベースでは、任意の時点のデータベース状態は、その管理単位である世代の番号(世代番号)により指定することができる。世代番号の指定は、クエリに世代番号を付与することで可能である。たとえば、データ変更を行うクエリを受け付ける前のデータベース状態を示す世代に対して、当該世代を示す世代番号を指定して検索を行った場合は、当然ながら変更内容を反映したデータベース状態での問い合わせ結果を得ることはできない。一方、変更後のデータベース状態を示す世代を示す世代番号を指定して検索を行った場合は、データの変更内容を反映したデータベース状態での問い合わせ結果を得ることができる。クエリに世代番号を付与することは、世代管理型データベースの実装にもよるが、クエリに世代番号を付与しなかった場合は、通常、現在の最新世代を示す世代番号が指定されたものと同じ作用をする。   More specifically, in the generation management database, the database state at an arbitrary time can be specified by the generation number (generation number) that is the management unit. The generation number can be specified by assigning a generation number to the query. For example, for a generation that shows the database status before accepting a query to change data, if you specify a generation number that indicates the generation and perform a search, the query result in the database status that reflects the change is naturally Can't get. On the other hand, when a search is performed by specifying a generation number indicating a generation indicating the database state after the change, an inquiry result in the database state reflecting the data change content can be obtained. Assigning a generation number to a query depends on the implementation of the generation management database, but if a generation number is not assigned to a query, it is usually the same as the generation number indicating the current latest generation. Works.

このように、世代管理型データベースでは、クエリに世代番号を指定することで、その世代番号が示すデータベース状態に対してクエリを発行することができる。すなわち、任意のデータベース状態に対する参照(検索)、任意のデータベース状態に対する変更(更新、追加、削除)が可能である。特に、変更の場合は、変更後のデータベース状態を示す新たな世代およびその状態を示す世代番号が作成される。   As described above, in the generation management database, by specifying the generation number in the query, the query can be issued for the database state indicated by the generation number. That is, reference (search) to any database state and change (update, addition, deletion) to any database state are possible. In particular, in the case of a change, a new generation indicating the database state after the change and a generation number indicating the state are created.

さらに、世代管理型データベースには、世代間の差分に対して問い合わせを行うクエリを発行できるものも多い。たとえば、一日の終わりに「本日の売り上げ」を集計するためには、集計時の状態(最新世代番号)と本日の開始時点の状態(開店直後の世代番号)の2つの世代の差に対して、売り上げ情報を問い合わせるようなクエリを発行すればよい。   In addition, many generation management databases can issue queries for inquiring about differences between generations. For example, in order to count “Today's sales” at the end of the day, the difference between the two generations, the status at the time of aggregation (latest generation number) and the status at the start of the day (generation number immediately after opening the store) Then, a query for inquiring sales information may be issued.

このような世代管理型データベースに対し、非世代管理型のデータベース(リレーショナルデータベース管理システム:RDBMS(Relational Data Base Management System))があり、データベース市場で大きなシェアを有している。加えて、データベースに対するクエリ記述言語として構造化問い合わせ言語(SQL:Structured Query Language)が業界標準として広く普及しており(非特許文献1)、また、SQLを用いるためのリソースも数多く存在する。ほかにも、Java(登録商標)アプリケーションからデータベースを操作するAPI(Application Programming Interface)として、JDBC(Java Database Connectivity)なども広く用いられている(非特許文献2)。   In contrast to such a generation management database, there is a non-generation management database (relational database management system: RDBMS (Relational Data Base Management System)), which has a large share in the database market. In addition, Structured Query Language (SQL) is widely used as an industry standard as a query description language for databases (Non-Patent Document 1), and there are many resources for using SQL. In addition, as an API (Application Programming Interface) for operating a database from a Java (registered trademark) application, a JDBC (Java Database Connectivity) is widely used (Non-patent Document 2).

RDBMSには、複数のユーザーが同時にデータベース操作を行う際に、データベースに対する複数の操作(参照、更新、追加、削除など)を実行している途中でエラーなどが発生したとしても、データの不整合が起きないことを保証するための「トランザクション」と呼ばれるメカニズムが存在する。また、SQLやJDBCなどは、その規格として、自分のトランザクションと他のトランザクションとの隔離性(アイソレーションレベル:Isolation Level)を設定することができる。   RDBMS has data inconsistency even if an error occurs during the execution of multiple operations (reference, update, addition, deletion, etc.) on the database when multiple users perform database operations simultaneously. There is a mechanism called “transaction” to ensure that no occurrence occurs. In addition, SQL, JDBC, etc. can set isolation (isolation level) between their own transaction and other transactions as its standard.

これらトランザクション機構やアイソレーションレベルの概念により、RDBMSは安全性、信頼性、柔軟性、高速性を兼ね備えたものとなっている。
Martin Gruber, "SQL 92/99標準リファレンスブック", 株式会社ドキュメントシステム "Java(TM) JDBC(TM) Data Access API Specification ("Specification")", Version 3.0, page 63-64
RDBMS combines safety, reliability, flexibility, and high speed with these transaction mechanism and isolation level concepts.
Martin Gruber, "SQL 92/99 Standard Reference Book", Document System Inc. "Java (TM) JDBC (TM) Data Access API Specification (" Specification ")", Version 3.0, page 63-64

しかしながら、SQLやJDBCなどは、非世代管理型データベースであるRDBMSを基準に規格化されているため、上記のように世代番号を指定するような規定がなされていない。一方、世代管理型データベースは、上記のようにクエリに世代番号を付与することが必要になるために、クエリに関するAPI仕様が独自性の高いものとなっている。また、RDBMSで基本として使用されているトランザクション機構も概念的として存在しない。   However, since SQL, JDBC, etc. are standardized based on RDBMS, which is a non-generation management database, there is no provision for designating a generation number as described above. On the other hand, since the generation management database needs to give a generation a generation number as described above, the API specification related to the query is highly unique. There is also no conceptual transaction mechanism used as a basis in RDBMS.

そのため、世代管理型データベースでは、データベースシステムの構築などの際に、RDBMSで豊富に存在するリソースの活用、他システムとの結合や連携が容易ではなかった。   For this reason, in the generation management database, it is not easy to use resources abundantly in RDBMS and to link or link with other systems when constructing a database system.

本発明は、かかる点に鑑みてなされたものであり、SQLやJDBCなどのように、世代番号を指定するような規定がなされていないクエリを用いて世代管理型データベースにアクセスし、ひいては、世代管理型データベースに対して一トランザクション内で参照、変更を複数回行うことができるトランザクション機構を備えたデータベースアクセス装置を提供することを目的とする。   The present invention has been made in view of the above points, and accesses a generation management database using a query that does not specify a generation number, such as SQL or JDBC. It is an object of the present invention to provide a database access apparatus having a transaction mechanism that can refer to and change a managed database within a transaction multiple times.

本発明に係るデータベースアクセス装置は、クライアントからのクエリ(たとえば、SQLなどで記述された)を受け付けるとともに、クライアントに対してデータベースアクセスを行うためのインタフェース(たとえば、JDBCなど)を提供するクライアントインタフェース部と、前記クライアントインタフェース部から得たクエリを世代管理型データベースのネイティブ形式のクエリに変換するクエリ変換部と、を有する構成を採る。好ましくは、当該データベースアクセス装置は、クライアントごとに発行された一連のクエリを一トランザクションとして管理するためのトランザクション管理テーブルと、各トランザクションを構成する各クエリに関連付けるべき世代番号、当該クエリにより適応される変更情報、および当該トランザクションのコミット状態を管理する世代管理テーブルとを有するトランザクション管理部をさらに有し、クライアントごとにトランザクションを構成することを可能にしている。すなわち、トランザクション管理部は、各クエリの発行前後のそれぞれにおけるデータベースの最新世代番号を把握し、クエリ変換部におけるネイティブ形式へのクエリ変換の際に付与すべき世代番号をクエリ変換部に提示する。また、好ましくは、トランザクション管理部は、クエリ変換部に提示すべき世代番号を、トランザクションごとに設定されているアイソレーションレベルに応じて行う。   A database access device according to the present invention receives a query (for example, written in SQL or the like) from a client and provides an interface (for example, JDBC or the like) for performing database access to the client. And a query conversion unit that converts a query obtained from the client interface unit into a query in a native format of a generation management database. Preferably, the database access device is adapted by a transaction management table for managing a series of queries issued for each client as one transaction, a generation number to be associated with each query constituting each transaction, and the query. It further includes a transaction management unit having change information and a generation management table for managing the commit state of the transaction, and makes it possible to configure a transaction for each client. That is, the transaction management unit grasps the latest generation number of the database before and after the issuance of each query, and presents the generation number to be given to the query conversion unit when the query conversion unit converts the query to the native format. Preferably, the transaction management unit performs the generation number to be presented to the query conversion unit according to the isolation level set for each transaction.

本発明によれば、SQLやJDBCなどのように、世代番号を指定するような規定がなされていないクエリを用いて世代管理型データベースにアクセスし、ひいては、世代管理型データベースに対して一トランザクション内で参照、更新を複数回行うことができる。また、トランザクションごとにアイソレーションレベルを設定することが可能となる。さらには、従来の世代管理型データベースに対して、安全性、信頼性、柔軟性、高速性を兼ね備えることが可能となる。   According to the present invention, a generation management database is accessed using a query that does not specify a generation number such as SQL or JDBC, and as a result, within one transaction for the generation management database. Can be referenced and updated multiple times. It is also possible to set an isolation level for each transaction. Furthermore, it becomes possible to combine safety, reliability, flexibility, and high speed with a conventional generation management database.

以下、本発明の実施の形態について、図面を参照して詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

(実施の形態1)
図1は、本発明の実施の形態1に係るデータベースアクセス装置を含むデータベースシステムの構成を示すブロック図である。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of a database system including a database access apparatus according to Embodiment 1 of the present invention.

図1に示すデータベースシステム100は、大別して、クライアント110、データベースアクセス装置120、およびデータベース140を有する。   The database system 100 shown in FIG. 1 roughly includes a client 110, a database access device 120, and a database 140.

クライアント110は、SQLなどの問い合わせ言語を用いて表記されたクエリの発行や、JDBCなどのAPI呼び出しを行い、データベースアクセス装置120を経由してデータベース140にアクセスする。データベース140では、クエリの内容に従った処理を行い、結果をクライアント110に返す。データベース140は、世代管理型データベースである。データベースアクセス装置120は、クライアントインタフェース部122、クエリ変換部124、およびトランザクション管理部126を有する。トランザクション管理部126には、トランザクション管理テーブル128と世代管理テーブル130が設けられている。   The client 110 issues a query written using a query language such as SQL, calls an API such as JDBC, and accesses the database 140 via the database access device 120. The database 140 performs processing according to the contents of the query and returns the result to the client 110. The database 140 is a generation management database. The database access device 120 includes a client interface unit 122, a query conversion unit 124, and a transaction management unit 126. The transaction management unit 126 is provided with a transaction management table 128 and a generation management table 130.

ここで、図2(A)〜図2(C)を用いて、本実施の形態におけるクライアント、データベースアクセス装置、およびデータベースの構成例を示す。   Here, a configuration example of the client, the database access device, and the database in this embodiment will be described with reference to FIGS.

図2(A)において、データベースアクセス装置120は、アプリケーションソフトウェア150がデータベース140にアクセスを行うためのドライバソフトウェアとして実装されており、クライアント110aにドライバソフトウェアのインストールを行うことにより動作する。アプリケーションソフトウェア150は、データベース140内の情報を利用したアプリケーションロジックを有し、必要に応じてドライバソフトウェアのインタフェースを呼び出すことによりデータベース140にアクセスし、必要な情報を取得する。   In FIG. 2A, the database access device 120 is implemented as driver software for the application software 150 to access the database 140, and operates by installing the driver software in the client 110a. The application software 150 has application logic that uses information in the database 140, and accesses the database 140 by calling an interface of the driver software as necessary, and acquires necessary information.

図2(B)において、データベースアクセス装置120は、Webサーバ152上で動作するサーブレットと呼ばれるアプリケーションソフトウェア154から呼び出されるライブラリとして実装されている。クライアント110b上ではWebサーバ152にアクセスを行うためのブラウザ156が動作しており、必要に応じてサーブレット154を呼び出す(またはサーブレット154を呼び出すためのURLをWebサーバ152に対して発行する)。サーブレット154は、データベース140内の情報を利用したアプリケーションロジックを有し、必要に応じてライブラリであるデータベースアクセス装置120のインタフェースを呼び出すことによりデータベース140にアクセスし、必要な情報を取得する。   In FIG. 2B, the database access device 120 is implemented as a library called from application software 154 called a servlet operating on the Web server 152. A browser 156 for accessing the Web server 152 is operating on the client 110b, and calls the servlet 154 as necessary (or issues a URL for calling the servlet 154 to the Web server 152). The servlet 154 has application logic that uses information in the database 140, and accesses the database 140 by calling an interface of the database access device 120, which is a library, as necessary, and acquires necessary information.

図2(C)において、データベースアクセス装置120は、データベース140a上で動作するデーモンプロセスのようなソフトウェアとして実装されており、データベース140a上にデーモンプロセスソフトウェアのインストールを行うことにより動作する。アプリケーションソフトウェア158は、データベース140a内の情報を利用したアプリケーションロジックを有し、必要に応じてデーモンプロセスに接続するためのAPIを呼び出すことによりデータベース140aにアクセスし、必要な情報を取得する。   In FIG. 2C, the database access device 120 is implemented as software such as a daemon process that operates on the database 140a, and operates by installing daemon process software on the database 140a. The application software 158 has application logic using the information in the database 140a, and accesses the database 140a by calling an API for connecting to the daemon process as necessary, and acquires necessary information.

なお、本実施の形態では、データベースアクセス装置120をソフトウェアとして構成した場合を示したが、これに限られるわけではなく、クライアント110、Webサーバ152、データベース140などに装着するハードウェアボードのようなハードウェアとして構成してもよい。   In this embodiment, the database access device 120 is configured as software. However, the present invention is not limited to this, and a hardware board mounted on the client 110, the Web server 152, the database 140, or the like is not limited thereto. You may comprise as hardware.

図1において、クライアントインタフェース部122は、図2(A)〜図2(C)におけるアプリケーションソフトウェア150、154、158からSQLなどの問い合わせ言語を用いて表記されたクエリを受け付けたり、アプリケーションソフトウェアに対してJDBCなどのインタフェースの提供を行ったりする。また、データベース140の処理結果をアプリケーションソフトウェアに返すためのインタフェースも提供する。クライアントインタフェース部122は、受け付けたクエリやインタフェース経由で取得した情報(付属情報)をクエリ変換部124に渡す。クライアントインタフェース部122は、複数のクライアントからのクエリを受け付けることができ、これらのクエリはそれぞれ固有のクライアントIDという値で識別することが可能である。クライアントインタフェース部122を含む、データベースアクセス装置120を構成するすべての要素122〜126、および、各要素間のインタフェースは、それぞれ、クライアントIDを処理したり伝達させることが可能であり、必要に応じてクライアントIDごとに要素および要素間インタフェースの構成数を増減することが可能である。   In FIG. 1, the client interface unit 122 accepts a query written using a query language such as SQL from the application software 150, 154, 158 in FIGS. Provide interfaces such as JDBC. It also provides an interface for returning the processing results of the database 140 to the application software. The client interface unit 122 passes the received query and information (attached information) acquired via the interface to the query conversion unit 124. The client interface unit 122 can accept queries from a plurality of clients, and each of these queries can be identified by a unique client ID value. All the elements 122 to 126 constituting the database access device 120 including the client interface unit 122, and the interfaces between the elements can process and transmit the client ID, respectively. It is possible to increase or decrease the number of elements and inter-element interfaces for each client ID.

クエリ変換部124は、クライアントインタフェース部122から受けたクエリおよび付属情報を、世代管理型データベースであるデータベース140のネイティブな記述をされたクエリに変換する。クライアントインタフェース部122から受けた変換前のクエリ等には、世代番号などの世代管理型データベース固有の情報は含まれていない。一方、変換後のクエリは、変換前のクエリと意味的に等価で、世代番号などの世代管理型データベース固有の情報が付与されたものとなる。   The query conversion unit 124 converts the query and attached information received from the client interface unit 122 into a query in which the native description of the database 140 that is a generation management database is written. The pre-conversion query received from the client interface unit 122 does not include information unique to the generation management database such as the generation number. On the other hand, the post-conversion query is semantically equivalent to the pre-conversion query and is given information unique to the generation management database such as a generation number.

トランザクション管理部126は、クライアントIDごとに発行された一連のクエリを一トランザクションとして管理するためのトランザクション管理テーブル128と、各トランザクションを構成する各クエリに関連付けるべき世代番号などを管理する世代管理テーブル130とを有する。クエリ変換部124は、クエリの変換に際し、トランザクション管理部126に対して、クエリに付与すべき世代番号などの情報の要求を行う。この要求に対し、トランザクション管理部126は、トランザクション管理テーブル128および世代管理テーブル130を参照し、クエリに付与するために必要な世代番号などの情報をクエリ変換部124に返す。   The transaction management unit 126 manages a series of queries issued for each client ID as one transaction, and a generation management table 130 that manages generation numbers to be associated with each query constituting each transaction. And have. When the query is converted, the query conversion unit 124 requests the transaction management unit 126 for information such as a generation number to be given to the query. In response to this request, the transaction management unit 126 refers to the transaction management table 128 and the generation management table 130, and returns information such as a generation number necessary for giving to the query to the query conversion unit 124.

クエリ変換部124によりデータベース140のネイティブな記述に変換されたクエリは、データベース140に渡される。データベース140では、データベースの基幹部分である検索処理部142が動作しており、クエリの内容に応じた処理(検索、更新、追加、削除など)を行う。この処理の結果はクエリ変換部124に渡される。この処理結果には、検索の結果となるレコード集合や処理成否のほか、データベースが提供する情報(ログ、統計情報、頻度情報、関連度情報、データベースステータス、処理前後のデータベース上の世代番号など)を含むことができる。   The query converted into the native description of the database 140 by the query conversion unit 124 is passed to the database 140. In the database 140, a search processing unit 142, which is a basic part of the database, operates and performs processing (search, update, addition, deletion, etc.) according to the contents of the query. The result of this processing is passed to the query converter 124. The processing results include the record set that results from the search and the success or failure of the processing, as well as information provided by the database (logs, statistical information, frequency information, relevance information, database status, generation numbers on the database before and after processing, etc.) Can be included.

なお、クエリ変換部124は、クライアント110からの1つのクエリに対して、必ずしも1つの変換後クエリをデータベース140に渡すわけではなく、必要に応じて任意のタイミングで、データベース140に対して独自のクエリを作成し、処理結果を得るようにしてもよい。たとえば、データベース140上の最新世代番号の場合は、最新世代番号を取得するための、データベース140にネイティブなクエリを作成し、これにより、データベース140から最新世代番号を取得することが可能である。   Note that the query conversion unit 124 does not necessarily pass one converted query to the database 140 for one query from the client 110, and is unique to the database 140 at an arbitrary timing as necessary. A query may be created to obtain a processing result. For example, in the case of the latest generation number on the database 140, it is possible to create a native query in the database 140 for acquiring the latest generation number, and thereby acquire the latest generation number from the database 140.

クエリ変換部124は、検索処理部142から受け取った処理結果を、世代番号などの世代管理型データベース固有の情報を取り除いた形式に変換し、クライアントインタフェース部122を経由して、クエリ発行元であるアプリケーションソフトウェア150、154、158に返す。   The query conversion unit 124 converts the processing result received from the search processing unit 142 into a format from which information unique to the generation management database such as a generation number is removed, and is a query issuer via the client interface unit 122. Return to the application software 150, 154, 158.

以下、各部の動作を詳細に説明する。   Hereinafter, the operation of each unit will be described in detail.

まず、アイソレーションレベルが「SERIALIZABLE(直列化可能)」の場合を説明する。アイソレーションレベルの指定は、クライアントインタフェース部122に対して、たとえば、図3で示すような入力を行えばよい。図3は、SQLおよびJDBCによるアイソレーションレベルの設定記述例を示す図である。   First, the case where the isolation level is “SERIALIZABLE” is described. For specifying the isolation level, for example, an input as shown in FIG. FIG. 3 is a diagram illustrating an example of setting description of an isolation level by SQL and JDBC.

図3に示すように、SQLおよびJDBCには「SERIALIZABLE(直列化可能)」、「READ UNCOMMITED(非コミット読み取り)」、「READ COMMITED(コミット済読み取り)」、「REPEATABLE_READ(再読み込み可能読み取り)」の4種類のアイソレーションレベルが存在する。   As shown in Figure 3, SQL and JDBC have "SERIALIZABLE", "READ UNCOMMITED (uncommitted read)", "READ COMMITED (committed read)", "REPEATABLE_READ (rereadable read)" There are four types of isolation levels.

それぞれのアイソレーションレベルが意味するところは、図3中の表に示す「Dirty Read」、「Non-Repeatable Read」、「Phantom Read」の3種類の読み込み状態がそれぞれ発生する(「あり」と表記)か発生しない(「なし」と表記)かの組み合わせである。   The meaning of each isolation level means that each of the three types of reading states “Dirty Read”, “Non-Repeatable Read”, and “Phantom Read” shown in the table of FIG. ) Or not (denoted as “none”).

「Dirty Read」とは、あるトランザクションがテーブルに書き込みを行っている最中に別のトランザクションが同じテーブルから読み込みを行うと、後者のトランザクションはまだ確定(コミット)されていない内容を読み込む可能性があることを示す。   “Dirty Read” means that if one transaction is reading from the same table while another transaction is writing to the table, the latter transaction may read content that has not yet been committed (committed). Indicates that there is.

「Non-Repeatable Read」とは、あるトランザクションがテーブルから読み込んだ後に別のトランザクションが同じテーブルの内容を更新してコミットを行うと、前者のトランザクションが再度同じテーブルを読み込んだ際、最初とは異なる内容を読み込む可能性があることを示す。   “Non-Repeatable Read” is different from the first when a transaction reads from the table and then another transaction updates the contents of the same table and commits. Indicates that the contents may be read.

「Phantom Read」とは、あるトランザクションがテーブルから読み込んだ後に別のトランザクションが、同じテーブルについて前者のトランザクションがテーブルを読み込んだ際の条件に符合するような行を変更・挿入・削除を行うと、前者のトランザクションが再度同じテーブルを読み込むと予期せぬ見せ掛けだけの内容を読み込む可能性があることを示す。   "Phantom Read" means that after a transaction reads from a table, another transaction changes, inserts, or deletes a row that matches the conditions when the former transaction reads the table for the same table. If the former transaction reads the same table again, it indicates that there is a possibility of reading only the contents of an unexpected appearance.

上記のように、複数のクライアントまたはアプリケーションソフトウェアは、クライアントIDによりそれぞれ一意に識別可能である。クライアントIDの例として、たとえば、IDアドレスやポート番号、サーブレットコンテナが発行管理するセッションID、クライアントから別途送られた認証情報により得られる認証情報などがある。本実施の形態では、あるクライアントにおいて1つのアプリケーションソフトウェアが動作し、そのアプリケーションソフトウェアに対して1つのクライアントIDが割り当てられている場合について説明するが、実際の実装はこれに限定されない。   As described above, a plurality of clients or application software can be uniquely identified by the client ID. Examples of the client ID include an ID address and a port number, a session ID issued and managed by the servlet container, and authentication information obtained from authentication information separately sent from the client. In this embodiment, a case is described in which one application software operates in a certain client and one client ID is assigned to the application software, but actual implementation is not limited to this.

クライアントインタフェース部122を経由して指定されたアイソレーションレベルは、クエリ変換部124を経由してトランザクション管理部126に設定される。   The isolation level specified via the client interface unit 122 is set in the transaction management unit 126 via the query conversion unit 124.

図4は、本実施の形態におけるトランザクション管理テーブル128の詳細構成およびトランザクション管理テーブル128への登録方法を示す図である。   FIG. 4 is a diagram showing a detailed configuration of the transaction management table 128 and a registration method in the transaction management table 128 according to the present embodiment.

トランザクション管理部126は、トランザクション管理テーブル128のクライアントIDの中に、アプリケーションソフトウェアと対応付けられたクライアントIDがあるかを探す。図4の例では、クライアントIDが「A」と「B」の場合が存在するため、一致したクライアントIDに対応するアイソレーションレベルの値を指定されたアイソレーションレベルに設定する。新規クライアント(クライアントID=C)の場合は、トランザクション管理テーブル128には該当するクライアントIDが存在しないため、新規にトランザクション管理テーブル128にレコードを追加する。この際、追加レコードのクライアントIDには新規クライアントのクライアントIDである「C」を、アイソレーションレベルにはデフォルトである「READ_COMMITED」をそれぞれ設定する。当然のことながら、アイソレーションレベルのほかにも、クライアントIDと1対1に対応可能な情報をトランザクション管理テーブル128に追加して管理するようにしてもよい。また、アイソレーションレベルのデフォルトの値は「READ_COMMITED」に限定されるわけではない。以上の動作によって、トランザクション管理部126は、クライアントIDとトランザクションとの対応、および、各トランザクションとアイソレーションレベルとの対応をそれぞれ管理することができる。   The transaction management unit 126 searches the client IDs in the transaction management table 128 for a client ID associated with the application software. In the example of FIG. 4, since there are cases where the client IDs are “A” and “B”, the value of the isolation level corresponding to the matched client ID is set to the designated isolation level. In the case of a new client (client ID = C), since the corresponding client ID does not exist in the transaction management table 128, a record is newly added to the transaction management table 128. At this time, “C” that is the client ID of the new client is set as the client ID of the additional record, and “READ_COMMITED” that is the default is set as the isolation level. As a matter of course, in addition to the isolation level, information that can correspond one-to-one with the client ID may be added to the transaction management table 128 for management. Further, the default value of the isolation level is not limited to “READ_COMMITED”. With the above operation, the transaction management unit 126 can manage the correspondence between the client ID and the transaction and the correspondence between each transaction and the isolation level.

次に、クライアントインタフェース部122に対して検索、更新、追加、変更を示す操作が行われた場合について説明する。   Next, a case where an operation indicating search, update, addition, or change is performed on the client interface unit 122 will be described.

図5は、本実施の形態におけるデータベースアクセスの第1の操作例を示す図である。
まず、時刻T00において、データベース140上の最新の世代番号は01である。
FIG. 5 is a diagram showing a first operation example of database access in the present embodiment.
First, at time T00, the latest generation number on the database 140 is 01.

そして、時刻T01において、クライアントID=Aから検索操作を行う。   At time T01, a search operation is performed from client ID = A.

そして、時刻T02において、クライアントID=BからB1を変更する操作を行い、その結果、最新の世代番号が02になる。ここで、「B1」とは、世代01のデータベースを変更するための具体的な変更内容を示している。   At time T02, an operation of changing B1 from client ID = B is performed, and as a result, the latest generation number becomes 02. Here, “B1” indicates the specific change contents for changing the generation 01 database.

そして、時刻T03において、クライアントID=CからC1を変更する操作を行い、その結果、最新の世代番号が03になる。ここで、「C1」とは、世代02のデータベースを変更するための具体的な変更内容を示している。   At time T03, an operation of changing C1 from client ID = C is performed. As a result, the latest generation number becomes 03. Here, “C1” indicates a specific change content for changing the generation 02 database.

そして、時刻T04において、クライアントID=Bから検索操作を行う。   At time T04, a search operation is performed from client ID = B.

そして、時刻T05において、クライアントID=BからB2を変更する操作を行い、その結果、最新の世代番号が04になる。ここで、「B2」とは、世代03のデータベースを変更するための具体的な変更内容を示している。   At time T05, an operation for changing B2 from client ID = B is performed. As a result, the latest generation number becomes 04. Here, “B2” indicates specific change contents for changing the generation 03 database.

そして、時刻T06において、クライアントID=CからC2を変更する操作を行い、その結果、最新の世代番号が05になる。ここで、「C2」とは、世代04のデータベースを変更するための具体的な変更内容を示している。さらに、クライアントID=Cはコミット操作を行う。ここで、「コミット操作」とは、この時刻(T06)以前にID=Cのクライアントが行ったデータベースへの変更内容(C1、C2)について、データベースへの反映を確定するための操作をいう。   At time T06, an operation of changing C2 from client ID = C is performed, and as a result, the latest generation number becomes 05. Here, “C2” indicates a specific change content for changing the generation 04 database. Further, the client ID = C performs a commit operation. Here, the “commit operation” refers to an operation for confirming that the database changes (C1, C2) made by the client with ID = C before this time (T06) are reflected in the database.

そして、時刻T07において、クライアントID=AからA1を変更する操作を行う。ここで、「A1」とは、世代05のデータベースを変更するための具体的な変更内容を示している。その結果、最新の世代番号が06になる。さらに、クライアントID=Aはコミット操作を行う。   At time T07, an operation of changing A1 from client ID = A is performed. Here, “A1” indicates the specific change contents for changing the generation 05 database. As a result, the latest generation number becomes 06. Further, the client ID = A performs a commit operation.

そして、時刻T08において、クライアントID=BからB3を変更する操作を行う。ここで、B3とは、世代06のデータベースを変更するための具体的な変更内容を示している。その結果、最新の世代番号が07になる。   At time T08, an operation of changing B3 from client ID = B is performed. Here, B3 indicates a specific change content for changing the generation 06 database. As a result, the latest generation number becomes 07.

そして、時刻T09において、クライアントID=Bがロールバック操作を行う。ここで、「ロールバック操作」とは、該当トランザクションで行ったデータベースに対する一連の操作を取り消すことを意味する。   At time T09, client ID = B performs a rollback operation. Here, “rollback operation” means canceling a series of operations on the database performed in the transaction.

トランザクションは、最初のアクセスまたは前回のトランザクション終了後の次のアクセスから開始し、コミットまたはロールバックにより終了する。したがって、クライアントID=AはT01からT07まで、クライアントID=BはT02からT09まで、クライアントID=CはT03からT06までをそれぞれ一トランザクションとして持つ。   A transaction begins with the first access or the next access after the end of the previous transaction and ends with a commit or rollback. Therefore, client ID = A has one transaction from T01 to T07, client ID = B has one transaction from T02 to T09, and client ID = C has one transaction from T03 to T06.

変更操作によりデータベース140上の最新の世代番号は上記のように遷移するため、各変更操作で使用した変更情報は、それぞれ、B1は「02−01」、C1は「03−02」、B2は「04−03」、C2は「05−04」、A1は「06−05」、B3は「07−06」として世代番号の演算を行うことにより求めることができる。ここで、例えば、「02―01」とは、世代02のデータベースの内容から世代01のデータベースの内容を差し引いた差分内容を意味する。一方、検索操作の場合は、検索の前後で最新の世代番号は変化しない。   Since the latest generation number on the database 140 is changed as described above by the change operation, the change information used in each change operation is “02-01” for B1, “03-02” for C1, and B2 for B2, respectively. “04-03”, C2 is “05-04”, A1 is “06-05”, B3 is “07-06”, and can be obtained by calculating the generation number. Here, for example, “02-01” means the difference contents obtained by subtracting the contents of the generation 01 database from the contents of the generation 02 database. On the other hand, in the case of a search operation, the latest generation number does not change before and after the search.

図6は、本実施の形態におけるクエリ変換部124およびトランザクション管理部126の動作の一例(「SERIALIZABLE」の場合)を示すフローチャートである。また、図7(A)〜図7(C)は、本実施の形態における世代管理テーブル130の一例を示す図である。図7(A)は、図5の時刻T00の時点における世代管理テーブル130の内容を示す図であり、テーブル内のレコード(テーブルの各行を意味する)が空であることを示している。世代管理テーブル130のレコードは、レコードに関連付けられているとトランザクション(クライアントIDで識別可能)と、変更操作を行う際の変更情報と、検索操作や変更操作などの操作の処理を行う前後におけるデータベース140上の最新の世代番号と、当該レコードに対応する操作がコミット済みであるかを示すフラグとを保持している。図7(B)は、図5の時刻T04の時点における世代管理テーブル130の内容を示す図であり、図7(C)は、図5の時刻T09の時点における世代管理テーブル130の内容を示す図である。   FIG. 6 is a flowchart showing an example of operations of the query conversion unit 124 and the transaction management unit 126 (in the case of “SERIALIZABLE”) in the present embodiment. FIGS. 7A to 7C are diagrams illustrating an example of the generation management table 130 according to the present embodiment. FIG. 7A is a diagram showing the contents of the generation management table 130 at time T00 in FIG. 5, and shows that the records in the table (meaning each row in the table) are empty. The records in the generation management table 130 are associated with the records (identified by client ID), change information when performing a change operation, and a database before and after performing operations such as a search operation and a change operation. 140 holds the latest generation number on 140 and a flag indicating whether or not the operation corresponding to the record has been committed. FIG. 7B shows the contents of the generation management table 130 at the time T04 in FIG. 5, and FIG. 7C shows the contents of the generation management table 130 at the time T09 in FIG. FIG.

以下、図6および図7(A)〜図7(C)を用いて、世代管理テーブル130の制御方法も含めて、クエリ変換部124およびトランザクション管理部126の動作について説明する。   Hereinafter, the operations of the query conversion unit 124 and the transaction management unit 126 including the control method of the generation management table 130 will be described with reference to FIGS. 6 and 7A to 7C.

まず、図6を用いて、クエリ変換部124およびトランザクション管理部126の動作について説明する。   First, the operations of the query conversion unit 124 and the transaction management unit 126 will be described with reference to FIG.

ステップS1000では、クエリ変換部124は、クライアントインタフェース部122から受けたクエリおよび付属情報を解析し、操作種別が検索操作、変更操作(更新、追加、削除)、その他の操作(ロールバック、コミットなど)のいずれであるかを判別する。   In step S1000, the query conversion unit 124 analyzes the query and attached information received from the client interface unit 122, and the operation type is a search operation, a change operation (update, addition, deletion), and other operations (rollback, commit, etc.). ).

そして、ステップS1100では、ステップS1000の判定結果がロールバック操作であるか否かを判断する。この判断の結果としてロールバック操作である場合は(S1000:YES)、ステップS1200に進み、ロールバック操作でない場合は(S1000:NO)、ステップS1500に進む。   In step S1100, it is determined whether or not the determination result in step S1000 is a rollback operation. If the result of this determination is a rollback operation (S1000: YES), the process proceeds to step S1200, and if it is not a rollback operation (S1000: NO), the process proceeds to step S1500.

ステップS1200では、トランザクション管理部126は、データベース140に対して、その時点での最新の世代番号を取得するような操作を発行する。   In step S1200, the transaction management unit 126 issues an operation for acquiring the latest generation number at that time to the database 140.

そして、ステップS1300では、ロールバック用の世代演算式を算出する。ロールバック用世代演算式は、たとえば、
世代演算式=(最新の世代番号)−(自トランザクションの未コミット分)
で与えられる。
In step S1300, a rollback generation calculation formula is calculated. The generation formula for rollback is, for example,
Generation formula = (Latest generation number)-(Uncommitted for local transaction)
Given in.

そして、ステップS1400では、クエリ変換部124は、ステップS1300で算出されたロールバック用世代演算式を付与したクエリをデータベース140に対して発行した後、ステップS1600に進む。   In step S1400, the query conversion unit 124 issues a query to which the rollback generation arithmetic expression calculated in step S1300 is assigned to the database 140, and then proceeds to step S1600.

一方、ステップS1500では、ステップS1000の判定結果がコミット操作であるか否かを判断する。この判断の結果としてコミット操作である場合は(S1500:YES)、ステップS1600に進み、コミット操作でない場合は(S1500:NO)、ステップS1800に進む。コミット操作でない場合は、検索操作と変更操作のいずれかである。   On the other hand, in step S1500, it is determined whether or not the determination result in step S1000 is a commit operation. If the result of this determination is a commit operation (S1500: YES), the process proceeds to step S1600, and if it is not a commit operation (S1500: NO), the process proceeds to step S1800. If it is not a commit operation, it is either a search operation or a change operation.

ステップS1600では、ロールバック操作またはコミット操作を行ったクライアントIDをトランザクション管理部126に送信した後、クエリ変換部124は、動作を終了する。   In step S1600, after transmitting the client ID that has performed the rollback operation or commit operation to the transaction management unit 126, the query conversion unit 124 ends the operation.

そして、ステップS1700では、トランザクション管理部126は、世代管理テーブル130の中から、クエリ変換部124から渡されたクライアントIDを持つ全レコードについて、コミット済フラグのフィールドの値を「Yes」にする。このようにコミット済フラグフィールドの値を「Yes」にすることは、当該クライアントIDのトランザクションを終了させるという意味を持つ。   In step S 1700, the transaction management unit 126 sets the value of the field of the committed flag to “Yes” for all records having the client ID passed from the query conversion unit 124 from the generation management table 130. Thus, setting the value of the committed flag field to “Yes” means that the transaction of the client ID is ended.

一方、ステップS1800では、クエリ変換部124は、ステップS1000の判定結果が検索操作であるか否かを判断する。この判断の結果として検索操作である場合は(S1800:YES)、ステップS1900に進み、検索操作でない場合、つまり、変更操作である場合は(S1800:NO)、ステップS2100に進む。   On the other hand, in step S1800, the query conversion unit 124 determines whether the determination result in step S1000 is a search operation. If it is a search operation as a result of this determination (S1800: YES), the process proceeds to step S1900. If it is not a search operation, that is, if it is a change operation (S1800: NO), the process proceeds to step S2100.

ステップS1900では、トランザクション管理部126は、当該クライアントIDが世代管理テーブル130に存在するか否かを判断する。この判断の結果として、当該クライアントIDが世代管理テーブル130に存在する場合は(S1900:YES)、ステップS2000に進み、当該クライアントIDが世代管理テーブル130に存在しない場合は(S1900:NO)、ステップS2100に進む。   In step S1900, the transaction management unit 126 determines whether the client ID exists in the generation management table 130. As a result of this determination, if the client ID exists in the generation management table 130 (S1900: YES), the process proceeds to step S2000. If the client ID does not exist in the generation management table 130 (S1900: NO), step The process proceeds to S2100.

ステップS2000では、検索操作用の世代演算式を算出する。この算出は、たとえば、次の3つの段階をとる。まず、第一段階として、世代管理テーブル130から、当該クライアントIDに関して直近に登録された世代番号を取得する。次に、第二段階として、当該トランザクションの開始以降のレコードから、上記直近に登録されたレコードの間で、当該トランザクション以外のレコードを求める。そして、最後の第三段階で、第一段階で求めた世代番号のデータベースの内容から第二段階で求めた各レコードの変更情報を差し引いたものを算出し、これを検索操作用の世代演算式とする。検索操作用世代演算式の算出が終了すると、ステップS2300に進む。   In step S2000, a generation operation formula for search operation is calculated. This calculation takes, for example, the following three stages. First, as the first stage, the generation number registered most recently with respect to the client ID is acquired from the generation management table 130. Next, as a second step, a record other than the transaction is obtained between the records registered immediately after the start of the transaction. Then, in the final third stage, calculate the result of subtracting the change information of each record obtained in the second stage from the contents of the generation number database obtained in the first stage, and use this to calculate the generation formula for the search operation And When the calculation of the generation expression for search operation is completed, the process proceeds to step S2300.

一方、ステップS2100では、データベース140に対して、その時点での最新の世代番号を取得するような操作を発行する。   On the other hand, in step S2100, an operation for obtaining the latest generation number at that time is issued to the database 140.

そして、ステップS2200では、データベース140から取得した世代管理番号を世代管理テーブル130に登録した後、ステップS2300に進む。ここで、ステップS2100およびステップS2200における一連の処理は、当該クライアントIDに対応するトランザクションの開始時におけるデータベース140上の最新世代番号を記録するという意味を持つ。   In step S2200, the generation management number acquired from the database 140 is registered in the generation management table 130, and the process proceeds to step S2300. Here, the series of processing in steps S2100 and S2200 has a meaning of recording the latest generation number on the database 140 at the start of the transaction corresponding to the client ID.

ステップS2300では、クエリ変換部124は、クライアントインタフェース部122から受けたクエリの変換を行う。このとき、ステップS2000で算出された世代演算式またはステップS2100で取得した世代番号を変換後のクエリに付与するように処理を行う。   In step S2300, the query conversion unit 124 converts the query received from the client interface unit 122. At this time, processing is performed so that the generation formula calculated in step S2000 or the generation number acquired in step S2100 is added to the converted query.

そして、ステップS2400では、ステップS1800の判断結果として変更操作であったか否かを判断する。この判断の結果として変更操作であった場合は(S2400:YES)、ステップS2500に進み、変更操作でなかった場合、つまり、検索操作であった場合は(S2400:NO)、ただちに動作を終了する。   In step S2400, it is determined whether or not the change operation is a determination result in step S1800. If the result of this determination is a change operation (S2400: YES), the process proceeds to step S2500. If it is not a change operation, that is, if it is a search operation (S2400: NO), the operation is immediately terminated. .

ステップS2500では、トランザクション管理部126は、ステップS2100と同様に、データベース140から、その時点での最新世代番号を取得する。   In step S2500, the transaction management unit 126 acquires the latest generation number at that time from the database 140, as in step S2100.

そして、ステップS2600では、ステップS2200で登録したレコードの処理後の世代番号のフィールドに、ステップS2500で取得した世代管理番号を記録する。そして、一連の動作がすべて終了する。   In step S2600, the generation management number acquired in step S2500 is recorded in the generation number field after processing of the record registered in step S2200. Then, all the series of operations are completed.

次いで、図5および図7(A)〜図7(C)を用いて具体的な動作の一例を説明する。   Next, an example of a specific operation will be described with reference to FIGS. 5 and 7A to 7C.

クエリ変換部124は、クライアントインタフェース部122から受けたクエリおよび付属情報を解析し、操作種別が検索操作、変更操作(更新、追加、削除)、その他の操作(ロールバック、コミットなど)のいずれであるかを判別する(S1000)。   The query conversion unit 124 analyzes the query and attached information received from the client interface unit 122, and the operation type is any of search operation, change operation (update, addition, deletion), and other operations (rollback, commit, etc.). It is determined whether it exists (S1000).

図5の時刻T01では、クライアントID=Aから検索操作が行われているため、ステップS1800の判定で「YES」の方に、つまり、ステップS1900に進む。   At time T01 in FIG. 5, since the search operation is performed from the client ID = A, the determination in step S1800 is “YES”, that is, the process proceeds to step S1900.

ステップS1900では、世代管理テーブル130にクライアントID=A、かつ、コミット済フラグ=「No」を満たすものが存在するかをチェックする。存在する場合には「YES」の方に進むが、現時点では、図7(A)に示すように、世代管理テーブル130は空であるため、ステップS1900の判定で「NO」の方に、つまり、ステップS2100に進む。   In step S1900, the generation management table 130 is checked to see if there is a client that satisfies the client ID = A and the committed flag = “No”. If it exists, the process proceeds to “YES”. At this time, as shown in FIG. 7A, the generation management table 130 is empty, so that it is determined to be “NO” in the determination in step S1900, that is, The process proceeds to step S2100.

ステップS2100では、トランザクション管理部126は、データベース140に対して、その時点での最新の世代番号を取得するような操作を発行する。そして、ステップS2200では、データベース140から取得した世代管理番号を世代管理テーブル130に登録する(図7(B):(1))。ステップS2200の時点では、世代管理テーブル130の処理後世代番号フィールドには「null」を設定する。同様に、検索操作の場合は、変更情報も存在しないため、変更情報フィールドにも「null」を設定する。これらステップS2100およびステップS2200における一連の処理は、クライアントID=Aに対応するトランザクションの開始時におけるデータベース140の最新世代番号を記録するという意味を持つ。   In step S2100, the transaction management unit 126 issues an operation for acquiring the latest generation number at that time to the database 140. In step S2200, the generation management number acquired from the database 140 is registered in the generation management table 130 (FIG. 7B: (1)). At the time of step S2200, “null” is set in the post-processing generation number field of the generation management table 130. Similarly, since there is no change information in the case of a search operation, “null” is also set in the change information field. The series of processes in steps S2100 and S2200 has a meaning of recording the latest generation number of the database 140 at the start of the transaction corresponding to the client ID = A.

その後、ステップS2300では、クエリ変換部124は、クライアントインタフェース部122から受けたクエリの変換を行う。この際、ステップS2100で取得した世代番号を変換後のクエリに付与するように処理を行う。これにより、時刻T01の検索操作に対して、データベース140上の現在の世代番号に対する検索を適切に行うことが可能になる。   Thereafter, in step S2300, the query conversion unit 124 converts the query received from the client interface unit 122. At this time, processing is performed so that the generation number acquired in step S2100 is given to the converted query. This makes it possible to appropriately perform a search for the current generation number on the database 140 for the search operation at time T01.

次に、図5の時刻T02では、クライアントID=Bから変更操作が行われているため、ステップS1800の判定で「NO」の方に、つまり、ただちにステップS2100に進む。変更操作の場合は、ステップS2100およびステップS2200にて最新の世代番号を取得して、世代管理テーブル130に登録する(図7(B):(2))。この場合のステップS2100およびステップS2200における一連の処理は、変更操作を行う前段階におけるデータベース140上の最新世代番号を記録するという意味を持つ。加えて、時刻T02の場合、クライアントID=Bがまだ世代管理テーブル130には存在しないため、クライアントID(=B)に対応するトランザクションの開始時におけるデータベース130上の最新世代番号を記録するという意味を兼ねている。   Next, at time T02 in FIG. 5, since the change operation is performed from the client ID = B, the process proceeds to “NO” in the determination of step S1800, that is, immediately proceeds to step S2100. In the case of a change operation, the latest generation number is acquired and registered in the generation management table 130 in steps S2100 and S2200 (FIG. 7B: (2)). In this case, a series of processes in step S2100 and step S2200 has a meaning of recording the latest generation number on the database 140 in the stage before the change operation is performed. In addition, since the client ID = B does not yet exist in the generation management table 130 at time T02, it means that the latest generation number on the database 130 at the start of the transaction corresponding to the client ID (= B) is recorded. Doubles as

その後、ステップS2300では、時刻T01の検索操作の場合と同様に、ステップS2100で取得した世代番号を変更操作クエリに付与し、データベース140に対して変換後クエリを発行する。   Thereafter, in step S2300, as in the case of the search operation at time T01, the generation number acquired in step S2100 is assigned to the change operation query, and a post-conversion query is issued to the database 140.

そして、ステップS2400では、変更操作であるために「YES」の方に、つまり、ステップS2500に進む。ステップS2500では、ステップS2100と同様に、データベース140からその時点での最新世代番号を取得する。そして、ステップS2600にて、ステップS2200で登録したレコード(図7(B):(2))の処理後の世代番号のフィールドに、ステップS2500で取得した世代番号を記録する。   In step S2400, since the operation is a change operation, the process proceeds to “YES”, that is, to step S2500. In step S2500, as in step S2100, the latest generation number at that time is acquired from the database 140. In step S2600, the generation number acquired in step S2500 is recorded in the generation number field after processing of the record registered in step S2200 (FIG. 7B: (2)).

次に、図5の時刻T03の場合も、クライアントID=Cについて、時刻T02の場合と同様の処理を行い、世代管理テーブル130に登録する(図7(B):(3))。   Next, also at time T03 in FIG. 5, the same processing as at time T02 is performed for client ID = C and registered in the generation management table 130 (FIG. 7B: (3)).

次に、図5の時刻T04では、クライアントID=Bから検索操作が行われているため、ステップS1800の判定で「YES」の方に、つまり、ステップS1900に進む。また、クライアントID=Bはすでに世代管理テーブル130に存在し、かつ、コミット済フラグ=「No」である(図7(B):(2))ため、ステップS1900の判定で「YES」の方に、つまり、ステップS2000に進む。   Next, at time T04 in FIG. 5, since the search operation is performed from the client ID = B, the determination in step S1800 is “YES”, that is, the process proceeds to step S1900. Further, since the client ID = B already exists in the generation management table 130 and the committed flag = “No” (FIG. 7B: (2)), “YES” is determined in step S1900. In other words, the process proceeds to step S2000.

ステップS2000では、ステップS2300においてクエリ変換部124が変換後のクエリに付与すべき検索操作用の世代演算式を算出する。算出は、第一段階として、世代管理テーブル130から、当該クライアントID=Bに関して直近に登録された世代番号を取得する。たとえば、時刻T04では、図7(B)の(2)のレコードが直近に登録されたレコードである。このとき、当該レコードの処理前世代番号および処理後世代番号の各フィールドのうち、処理後世代番号が「null」でない場合は、処理後世代番号を取得する。一方、処理後世代番号が「null」の場合は、当該レコードの処理前世代番号を取得する。したがって、ステップS2000では、まず図7(B)の(2)の処理後世代番号=02を取得する。次に、第二段階として、当該トランザクションの開始以降のレコードから、上記直近に登録されたレコードの間で、当該トランザクション以外のレコードを求める。先の例では、クライアントID=Bからのトランザクションの開始レコードは図7の(2)であり、直近に登録されたレコードも図7(B)の(2)であるため、その間のクライアントID=B以外のレコードは存在しない。そして、最後の第三段階で、第一段階で求めた世代番号(02)のデータベースの内容から第二段階で求めた各レコードの変更情報(null)を差し引いたものを算出し、これを検索操作用の世代演算式とする。先の例では、検索操作用の世代演算式は世代番号02であり、ステップS2300ではこの世代番号02をクエリに付与することになる。   In step S2000, in step S2300, the query conversion unit 124 calculates a generation operation expression for search operation to be given to the converted query. As the first step, the generation number registered most recently for the client ID = B is acquired from the generation management table 130. For example, at time T04, the record (2) in FIG. 7B is the record registered most recently. At this time, if the post-process generation number is not “null” among the pre-process generation number and post-process generation number fields of the record, the post-process generation number is acquired. On the other hand, if the post-processing generation number is “null”, the pre-processing generation number of the record is acquired. Therefore, in step S2000, first, the post-processing generation number = 02 in (2) of FIG. 7B is acquired. Next, as a second step, a record other than the transaction is obtained between the records registered immediately after the start of the transaction. In the previous example, the transaction start record from client ID = B is (2) in FIG. 7, and the most recently registered record is also (2) in FIG. 7B. There is no record other than B. Then, in the final third stage, the contents of the generation number (02) database obtained in the first stage are subtracted from the change information (null) of each record obtained in the second stage, and this is searched. It is a generation expression for operation. In the previous example, the generation operation expression for the search operation is the generation number 02. In step S2300, this generation number 02 is given to the query.

仮に図5の時刻T08で、クライアントID=BがB3の変更操作の代わりに検索操作を行った場合には、上記第一段階で求められるレコードは図7(C)の(4)のレコードとなり、直近に登録された世代番号は04となる。次に、上記第二段階で求められるクライアントID=Bからのトランザクションの開始レコードは図7(C)の(2)となり、直近に登録されたレコードは図7(C)の(4)となり、その間の他のレコードは図7(C)の(3)となる。図7(C)の(3)は変更情報C1を使用した変更操作であるため、検索操作用の世代演算式は、
世代演算式=04−C1
=04−(03−02)
となる。
If the client ID = B performs a search operation instead of the change operation of B3 at time T08 in FIG. 5, the record obtained in the first stage is the record (4) in FIG. 7C. The most recently registered generation number is 04. Next, the transaction start record from client ID = B obtained in the second stage is (2) in FIG. 7C, and the most recently registered record is (4) in FIG. 7C. The other records in the meantime are (3) in FIG. Since (3) in FIG. 7C is a change operation using the change information C1, the generation operation expression for the search operation is
Generation formula = 04-C1
= 04- (03-02)
It becomes.

各クライアントIDに対応するトランザクションがどのアイソレーションレベルに設定されているかは、トランザクション管理テーブル128を参照することによりわかる。図4から、クライアントID=Bのトランザクションのアイソレーションレベルは、「SERIALIZABLE(直列化可能)」であるとわかる。時刻T04の場合、クライアントID=Bから、クライアントID=Cが行ったC1の変更は見えてはならないが、以上のような処理を行うことにより、世代02を付与した検索クエリを発行することになり、アイソレーションレベルを考慮した検索を行うことが可能となる。同様に、時刻T08で検索操作を行った場合、B2更新直後の世代04からクライアントID=Cが行ったC2の変更が見えないような世代演算式を求めているため、適切な検索を行うことが可能となる。   It can be understood by referring to the transaction management table 128 which isolation level is set for the transaction corresponding to each client ID. From FIG. 4, it can be seen that the isolation level of the transaction with client ID = B is “SERIALIZABLE”. At time T04, the change of C1 made by client ID = C should not be seen from client ID = B, but by performing the above processing, a search query assigned generation 02 is issued. Thus, it is possible to perform a search in consideration of the isolation level. Similarly, when a search operation is performed at time T08, a generation operation formula that does not show the change of C2 made by client ID = C is obtained from the generation 04 immediately after the update of B2, and therefore an appropriate search is performed. Is possible.

次に、図5の時刻T06および時刻T07のように、コミット操作が行われている場合には、ステップS1500の判定で「YES」の方に進む。その後、クエリ変換部124は、コミット操作を行ったクライアントIDをトランザクション管理部126へ渡す(S1600)。トランザクション管理部126は、世代管理テーブル130の中から、渡されたクライアントIDを持つレコードのすべてのコミット済フラグフィールドの値を「Yes」にすることで、当該レコードに関連する操作がコミットされたことを保持する(S1700)。ステップS1700においてコミット済フラグフィールドの値を「Yes」にすることは、当該クライアントIDのトランザクションを終了させるという意味を持つ。   Next, when the commit operation is performed as at time T06 and time T07 in FIG. 5, the determination in step S1500 proceeds to “YES”. Thereafter, the query conversion unit 124 passes the client ID that has performed the commit operation to the transaction management unit 126 (S1600). The transaction management unit 126 sets the values of all committed flag fields of the record having the passed client ID from the generation management table 130 to “Yes”, so that the operation related to the record is committed. (S1700). In step S1700, setting the value of the committed flag field to “Yes” means that the transaction of the client ID is terminated.

次に、図5の時刻T09のように、クライアントID=Bにおいてロールバック操作が行われた場合には、ステップS1100の判定で「YES」の方に、つまり、ステップS1200に進む。ステップS1200では、トランザクション管理部126は、データベース140に対して、その時点での最新の世代番号を取得するような操作を発行する。   Next, when a rollback operation is performed at the client ID = B as at time T09 in FIG. 5, the determination in step S1100 proceeds to “YES”, that is, the process proceeds to step S1200. In step S1200, the transaction management unit 126 issues an operation for acquiring the latest generation number at that time to the database 140.

そして、ステップS1300で、トランザクション管理部126は、世代管理テーブル130の中から、渡されたクライアントIDを持ち、変更情報フィールドが「null」でなく、かつ、コミット済フラグが「No」であるレコードを探す。時刻T09の時点では、世代管理テーブル130の内容は図7(C)のようになっているため、該当するレコードは図7(C)の(2)、(4)、(7)となる。ここで、ステップS1200で取得したロールバック時点(時刻T09)での最新世代番号(世代07)から、クライアントID=Bの変更分(B1、B2、B3)を除けば、適切なロールバックを行うことになる。各レコードの変更情報は、「B1=02−01」、「B2=04−03」、「B3=07−06」として算出可能であるため、ステップS1300で求められるロールバック用の世代演算式は、
世代演算式=(最新の世代番号)−(自トランザクションの未コミット分)
=07−(B1+B2+B3)
=07+01−02+03−04+06−07
となる。
In step S 1300, the transaction management unit 126 records from the generation management table 130 that has the passed client ID, the change information field is not “null”, and the committed flag is “No”. Search for. Since the contents of the generation management table 130 are as shown in FIG. 7C at time T09, the corresponding records are (2), (4), and (7) in FIG. 7C. Here, appropriate rollback is performed by excluding the change (B1, B2, B3) of client ID = B from the latest generation number (generation 07) at the rollback time (time T09) acquired in step S1200. It will be. Since the change information of each record can be calculated as “B1 = 0-02-01”, “B2 = 04-03”, “B3 = 07-06”, the generation equation for rollback obtained in step S1300 is ,
Generation formula = (Latest generation number)-(Uncommitted for local transaction)
= 07- (B1 + B2 + B3)
= 07 + 01-02 + 03-04 + 06-07
It becomes.

そして、ステップS1400では、上記ロールバック用世代演算式を付与したクエリをデータベース140に対して発行する。データベース140は、クライアントID=Bのトランザクションによる一連の変更操作(B1、B2、B3)を取り除いた最新世代番号=08を作成することになる。ロールバック操作により一連のトランザクションは終了することになるため、ステップS1600およびステップS1700を行うことにより、当該クライアントIDのトランザクションが終了した状態になるように世代管理テーブル130の内容を変更する。具体的には、該当するクライアントIDのレコードを削除する(S1700)。   In step S1400, a query to which the rollback generation formula is added is issued to the database 140. The database 140 creates the latest generation number = 08 from which a series of change operations (B1, B2, B3) by the transaction with the client ID = B is removed. Since a series of transactions is terminated by the rollback operation, the contents of the generation management table 130 are changed by performing steps S1600 and S1700 so that the transaction of the client ID is completed. Specifically, the corresponding client ID record is deleted (S1700).

以上のように構成することで、世代管理型データベースに対して、アイソレーションレベルが「SERIALIZABLE(直列化可能)」となるような世代番号を付与したクエリを生成することが可能となり、さらには、SQLやJDBCなどのように、世代番号を指定するような規定がなされていないクエリ言語等を用いて世代管理型データベースにアクセスすることが可能となる。また、世代管理型データベースに対して、トランザクション機構を備えたデータベースアクセス方式およびアクセス装置を提供することが可能となる。また、従来の非世代管理型データベースで「SERIALIZABLE(直列化可能)」を実現する際に行っていたロック機構(排他制御)が不要となる。   By configuring as described above, it is possible to generate a query with a generation number assigned to the generation management database with an isolation level of “SERIALIZABLE (serializable)”. It becomes possible to access the generation management database using a query language or the like that does not have a rule for specifying a generation number, such as SQL or JDBC. In addition, it is possible to provide a database access method and an access device having a transaction mechanism for a generation management database. In addition, the lock mechanism (exclusive control) that is used when “SERIALIZABLE (serializable)” is realized in a conventional non-generation management database becomes unnecessary.

次いで、アイソレーションレベルが「READ UNCOMMITED(非コミット読み取り)」の場合について説明する。これまでの説明と共通する部分については、同一の記号と参照番号を使用し、その説明を省略する。   Next, a case where the isolation level is “READ UNCOMMITED (uncommitted read)” will be described. About the part which is common in the description so far, the same symbol and reference number are used, and the description is omitted.

アイソレーションレベルが「READ UNCOMMITED(非コミット読み取り)」の場合は、他のトランザクションでコミットをしていない状態のものも読み込むことになる。たとえば、図5の時刻T04では、クライアントID=BからクライアントID=Cが行ったC1の変更は見えることになる。   When the isolation level is “READ UNCOMMITED (uncommitted read)”, data in a state in which another transaction is not committed is read. For example, at time T04 in FIG. 5, the change of C1 made by client ID = C from client ID = B is visible.

このためには、検索操作時において、常に最新の状態を示す世代番号をクエリに付与するようにクエリ変換部124が動作すればよい。   For this purpose, the query conversion unit 124 only needs to operate so that a generation number indicating the latest state is always given to a query during a search operation.

図8は、本実施の形態におけるクエリ変換部124およびトランザクション管理部126の動作の他の例(「READ UNCOMMITED」の場合)を示すフローチャートである。ここでは、図8のステップS2010において、データベース140から最新の世代番号を取得するようにし、この世代番号をもってステップS2300で変換されたクエリによる検索操作を行うように構成している。より具体的には、その時点での世代管理テーブル130の最下欄の「処理後世代番号」を取得することにより、最新の世代のデータベースで検索することが可能になる。   FIG. 8 is a flowchart showing another example of the operations of the query conversion unit 124 and the transaction management unit 126 (in the case of “READ UNCOMMITED”) in the present embodiment. Here, in step S2010 in FIG. 8, the latest generation number is acquired from the database 140, and the search operation is performed by the query converted in step S2300 using this generation number. More specifically, by acquiring the “post-processing generation number” in the lowest column of the generation management table 130 at that time, it becomes possible to search the latest generation database.

以上のように構成することで、世代管理型データベースに対して、アイソレーションレベルが「READ UNCOMMITED(非コミット読み取り)」となるような世代番号を付与したクエリを生成することが可能となる。   With the configuration as described above, it is possible to generate a query with a generation number assigned to the generation management database so that the isolation level is “READ UNCOMMITED (uncommitted read)”.

次いで、アイソレーションレベルが「READ COMMITED(コミット済読み取り)」の場合について説明する。これまでの説明と共通する部分については、同一の記号と参照番号を使用し、その説明を省略する。   Next, a case where the isolation level is “READ COMMITED” will be described. About the part which is common in the description so far, the same symbol and reference number are used, and the description is omitted.

アイソレーションレベルが「READ COMMITED(コミット済読み取り)」の場合は、他のトランザクションでコミット済みのものであれば読み込みが行われることになる。たとえば、図5の時刻T07で、クライアントID=AがA1の変更操作およびコミット操作を行う代わりに検索操作を行ったとする。この場合、クライアントID=Aからは、クライアントID=Cにより行われたC1、C2の変更は、コミット操作済であるため、クライアントID=Aからは見えることになるが、クライアントID=Bにより行われたB1、B2は、コミット操作がまだ行われていないため、見えない。   When the isolation level is “READ COMMITED”, reading is performed if it has been committed in another transaction. For example, assume that at time T07 in FIG. 5, the client ID = A performs a search operation instead of performing the change operation and the commit operation of A1. In this case, since the change of C1 and C2 performed by the client ID = C from the client ID = A has been committed, it can be seen from the client ID = A, but the change by the client ID = B. B1 and B2 are not visible because the commit operation has not yet been performed.

このためには、検索操作時において、その時点におけるデータベース140の最新状態(最新の世代番号)から、自トランザクション以外で未コミットの変更分を差し引いた状態に対して検索処理を行うようにし、そのような世代演算式をクエリに付与するようにクエリ変換部124が動作すればよい。   For this purpose, at the time of the search operation, the search processing is performed for the state in which the uncommitted changes other than the own transaction are subtracted from the latest state (latest generation number) of the database 140 at that time. It suffices for the query conversion unit 124 to operate so as to give such a generation formula to the query.

図9は、本実施の形態における世代管理テーブル130の他の例を示す図である。図9は、時刻T07での世代管理テーブル130の内容を示している。図9に示すように、世代管理テーブル130の変更情報フィールドが「null」でなく、自トランザクション(クライアントID=A)以外のもので、かつ、コミット済フラグフィールドの値が「No」であるのは、図9の(2)、(4)のレコードで示される。すなわち、先の例では、自トランザクション以外で未コミットの変更分となる変更情報は、図9の(2)のB1、図9の(4)のB2となる。また、時刻T07の時点での最新の世代番号は世代05である。   FIG. 9 is a diagram showing another example of the generation management table 130 in the present embodiment. FIG. 9 shows the contents of the generation management table 130 at time T07. As shown in FIG. 9, the change information field of the generation management table 130 is not “null”, but other than the own transaction (client ID = A), and the value of the committed flag field is “No”. Is indicated by records (2) and (4) in FIG. That is, in the previous example, the change information that is an uncommitted change other than the own transaction is B1 in FIG. 9 (2) and B2 in FIG. 9 (4). The latest generation number at time T07 is generation 05.

したがって、時刻T07でアイソレーションレベルが「READ COMMITED(コミット済読み取り)」として設定されたクライアントID=Aが検索操作を行う場合、クエリ変換部124が変換後のクエリに付与すべき世代演算式は、
世代演算式=(最新の世代番号)−(他トランザクションの未コミット分)
=05−(B1+B2)
=05+01−02+03−04
となる。
Therefore, when the client ID = A whose isolation level is set as “READ COMMITED (committed read)” at time T07 performs a search operation, the generation formula that the query conversion unit 124 should give to the converted query is ,
Generation formula = (Latest generation number)-(Uncommitted for other transactions)
= 05- (B1 + B2)
= 05 + 01-02 + 03-04
It becomes.

図10は、本実施の形態におけるクエリ変換部124およびトランザクション管理部126の動作のさらに他の例(「READ COMMITED」の場合)を示すフローチャートである。ここでは、図10のステップS2020において、トランザクション管理部126が上記のようにして世代演算式を算出するようにし、この世代演算式をもってステップS2300で変換されたクエリによる検索操作を行うように構成している。   FIG. 10 is a flowchart showing still another example (in the case of “READ COMMITED”) of the operations of the query conversion unit 124 and the transaction management unit 126 in the present embodiment. Here, in step S2020 in FIG. 10, the transaction management unit 126 is configured to calculate the generation arithmetic expression as described above, and to perform a search operation using the query converted in step S2300 with this generation arithmetic expression. ing.

以上のように構成することで、世代管理型データベースに対して、アイソレーションレベルが「READ COMMITED(コミット済読み取り)」となるような世代番号を付与したクエリを生成することが可能となる。   By configuring as described above, it is possible to generate a query with a generation number assigned to the generation management database so that the isolation level becomes “READ COMMITED (committed read)”.

次いで、アイソレーションレベルが「REPEATABLE READ(再読み込み可能読み取り)」の場合について説明する。これまでの説明と共通する部分については、同一の記号と参照番号を使用し、その説明を省略する。   Next, the case where the isolation level is “REPEATABLE READ” is described. About the part which is common in the description so far, the same symbol and reference number are used, and the description is omitted.

アイソレーションレベルが「REPEATABLE READ(再読み込み可能読み取り)」の場合は、アイソレーションレベルが「SERIALIZABLE(直列化可能)」の場合に対して「PHANTOM READ」が行われることになる。ここで、「PHANTOM READ」とは、自トランザクションで検索により読み込んだ(1回目)後に、他のトランザクションが上記検索条件に合致するデータを挿入してコミットすると、再度自トランザクションが読み込んだ(2回目)時に上記コミットされたデータが反映されて読み込まれることを示す。 When the isolation level is “REPEATABLE READ”, “PHANTOM READ” is performed for the case where the isolation level is “SERIALIZABLE”. Here, “PHANTOM READ” means that the local transaction is read again (second time) when it is read by the local transaction (first time) and another transaction inserts data that matches the search conditions and commits. ) When the committed data is reflected and read.

図11は、本実施の形態におけるクエリ変換部124およびトランザクション管理部126の動作のさらに他の例(「REPEATABLE READ」の場合)を示すフローチャートである。ここでは、図11のステップS2030において、トランザクション管理部126が上記のようにして世代演算式を算出するようにし、この世代演算式をもってステップS2300で変換されたクエリによる検索操作を行うように構成している。   FIG. 11 is a flowchart showing yet another example (in the case of “REPEATABLE READ”) of the operations of the query conversion unit 124 and the transaction management unit 126 in the present embodiment. Here, in step S2030 of FIG. 11, the transaction management unit 126 is configured to calculate the generation arithmetic expression as described above, and to perform a search operation using the query converted in step S2300 with this generation arithmetic expression. ing.

このときの、ステップS2030における処理について、図5の時刻T08で、クライアントID=BがB3の変更操作の代わりに検索操作を行った場合を例にとって説明する。   The processing in step S2030 at this time will be described by taking as an example the case where the client ID = B performs a search operation instead of the change operation of B3 at time T08 in FIG.

まず、第一段階として、世代管理テーブル130から、当該クライアントID=Bに関して直近に登録された世代番号を取得する。すなわち、図7(C)の(4)のレコードから世代04が得られる。次に、第二段階として、上記直近に登録されたレコード(図7(C)の(4))以降のレコードのうち、トランザクションフィールドの値が当該クライアントID以外であり、かつ、コミット済フラグフィールドの値が「Yes」となっているレコードを求める。先の例では図7(C)の(5)、(6)となる。最後の第三段階では、第一段階で求めた世代番号に第二段階で求めた各レコードの変更情報を加えたものを算出し、これを検索操作用の世代演算式とする。先の例では、検索操作用の世代演算式は
世代演算式=04+(A1+C2)
=04+(06−05+05−04)
=06
となる。
First, as a first step, the generation number registered most recently for the client ID = B is acquired from the generation management table 130. That is, the generation 04 is obtained from the record (4) in FIG. Next, as a second stage, among the records after the most recently registered record ((4) in FIG. 7C), the value of the transaction field is other than the client ID, and the committed flag field The record whose value is “Yes” is obtained. In the previous example, (5) and (6) in FIG. In the final third stage, the generation number obtained in the first stage plus the change information of each record obtained in the second stage is calculated, and this is used as the generation operation formula for the search operation. In the previous example, the generation operation expression for the search operation is the generation operation expression = 04 + (A1 + C2)
= 04 + (06-05 + 05-04)
= 06
It becomes.

以上のように構成することで、世代管理型データベースに対して、アイソレーションレベルが「REPEATABLE READ(再読み込み可能読み取り)」となるような世代番号を付与したクエリを生成することが可能となる。   By configuring as described above, it is possible to generate a query with a generation number assigned to the generation management database so that the isolation level is “REPEATABLE READ”.

(実施の形態2)
実施の形態2では、世代管理型データベースが世代間の差分処理を行わない場合について説明する。なお、実施の形態1と共通する部分については、同一の記号と参照番号を使用し、その説明を省略する。
(Embodiment 2)
In the second embodiment, a case where the generation management database does not perform the difference process between generations will be described. In addition, about the part which is common in Embodiment 1, the same symbol and reference number are used and the description is abbreviate | omitted.

世代管理型データベースのみならず、一般にデータベースは、表構造をしたテーブルでデータを管理している。テーブルのそれぞれの行はレコードと呼ばれ、これが1件のデータとなる。テーブルには主キーを設定したフィールドが存在し、この主キーにより各レコードを一意に識別できるようになっている。また、テーブルには、データベースが各レコードへアクセスするために各レコードの記憶アドレスを擬似フィールドとして持ち、この擬似フィールドにより各レコードを一意に識別することもできる。本実施の形態では、主キーや擬似フィールドにより各レコードを一意に識別できるフィールドを「レコード識別フィールド」と呼ぶことにする。   In addition to the generation management database, a database generally manages data using a table having a table structure. Each row in the table is called a record, and this is a piece of data. The table has a field set with a primary key, and each record can be uniquely identified by this primary key. The table also has a storage address of each record as a pseudo field for the database to access each record, and each record can be uniquely identified by this pseudo field. In the present embodiment, a field in which each record can be uniquely identified by a primary key or a pseudo field is referred to as a “record identification field”.

図12は、本発明の実施の形態2における世代管理型データベース上のテーブルの一例(テーブル名:T_DOC)を示す図である。図12において、レコードはCOL0からCOL3の4つのフィールドからなり、データとして5つのレコードがテーブルT_DOCに登録されている。また、COL0がレコード識別フィールドとなっており、各レコードのCOL0の値val01からval05はそれぞれ異なる値である。   FIG. 12 is a diagram showing an example of a table (table name: T_DOC) on the generation management database according to Embodiment 2 of the present invention. In FIG. 12, the record is composed of four fields COL0 to COL3, and five records are registered in the table T_DOC as data. Also, COL0 is a record identification field, and COL0 values val01 to val05 of each record are different values.

本実施の形態では、クライアントID=Bの場合について、図5で示す操作を行った場合を例にとって説明する。ただし、ここでは、図5において、
時刻T02のB1は更新(Update)を行う変更操作であり、
時刻T05のB2は削除(Delete)を行う変更操作であり、
時刻T08のB3は追加(Insert)を行う変更操作であるとする。
In the present embodiment, the case where the operation shown in FIG. 5 is performed will be described as an example in the case of client ID = B. However, here, in FIG.
B1 at time T02 is a change operation for updating,
B2 at time T05 is a change operation for deleting,
It is assumed that B3 at time T08 is a change operation for performing an insert.

図13(A)〜図13(C)は、各時刻でクライアントID=Bが行う本実施の形態における変更操作の一例を示す図である。ここでは、更新操作B1は図13(A)、削除操作B2は図13(B)、追加操作B3は図13(C)にそれぞれ示すSQL式により定義されている。   FIGS. 13A to 13C are diagrams illustrating an example of a change operation in the present embodiment performed by the client ID = B at each time. Here, the update operation B1 is defined by SQL expressions shown in FIG. 13A, the delete operation B2 is shown in FIG. 13B, and the add operation B3 is shown in FIG. 13C.

図14は、図6に示す実施の形態1におけるクエリ変換部124およびトランザクション管理部126の「SERIALIZABLE(直列化可能)」の場合の動作フローに対し、本実施の形態における世代間の差分処理を行わない場合で「SERIALIZABLE(直列化可能)」を実現するための動作フローを示す図である。ここで、図14の動作フローが図6の動作フローと異なる点は、クエリ変換部124が、ステップS1800にてクライアントインタフェース部122から受けたクエリが変更操作であると判定した場合、追加のステップS1850で変更情報の加工を行う点である。   FIG. 14 shows the difference processing between generations in the present embodiment with respect to the operation flow in the case of “SERIALIZABLE” of the query conversion unit 124 and the transaction management unit 126 in the first embodiment shown in FIG. It is a figure which shows the operation | movement flow for implement | achieving "SERIALIZABLE (serializable)" when not performing. Here, the operation flow of FIG. 14 differs from the operation flow of FIG. 6 in that if the query conversion unit 124 determines that the query received from the client interface unit 122 in step S1800 is a change operation, an additional step is performed. The change information is processed in S1850.

図15は、図14の変更情報加工処理の内容を示すフローチャートである。   FIG. 15 is a flowchart showing the contents of the change information processing shown in FIG.

まず、時刻T02の変更操作B1では、B1が更新操作(Update)であるため、ステップS1852の判定で「YES」の方に、つまり、ステップS1858に進む。ステップS1858では、B1による更新操作により影響を受けるレコードの更新前の状態を取得する。この更新前の状態は、B1の更新操作がロールバックにより取り消された場合に、データベースの内容を元に戻すために使用される。したがって、ステップS1858は、データベース140が特定操作の状態を復元できるような機能を有していれば省略可能である。   First, in the change operation B1 at time T02, since B1 is an update operation (Update), the determination in step S1852 proceeds to “YES”, that is, the process proceeds to step S1858. In step S1858, the state before the update of the record affected by the update operation by B1 is acquired. This state before update is used to restore the contents of the database when the update operation of B1 is canceled by rollback. Therefore, step S1858 can be omitted if the database 140 has a function capable of restoring the state of the specific operation.

図16(A)〜図16(C)は、図15のステップS1858における更新前状態取得の一例を示す図である。ここで、図16(A)は、更新前の状態を取得するための一般式であり、<table>には更新(Update)文で指定されたテーブルを、<condition>には、必要に応じて、更新(Update)文で指定された「Where」節を記述する。図16(B)は、B1の場合の一例であり、これにより、B1により更新されるレコードの全フィールドを取得可能である。また、全フィールドではなく、図16(C)の場合のように、B1により更新されるフィールド(COL2、COL3)とレコード識別フィールド(COL0)だけを取得することにより、最小限の状態だけを取得することができ、サーバリソースの軽減や通信量の削減を図ることが可能である。   FIGS. 16A to 16C are diagrams illustrating an example of the pre-update state acquisition in step S1858 of FIG. Here, FIG. 16A is a general expression for acquiring the state before update. <Table> is a table specified by an update statement, and <condition> is as necessary. Then, the “Where” clause specified by the update statement is described. FIG. 16B is an example of the case of B1, and as a result, all fields of the record updated by B1 can be acquired. Moreover, only the minimum state is acquired by acquiring only the fields (COL2, COL3) and the record identification field (COL0) updated by B1, as in the case of FIG. It is possible to reduce server resources and communication volume.

図17は、B1による更新前のテーブルの状態を示す図である。図17には、更新操作B1により変更される2つのレコードが列挙されている。また、更新操作により影響を受けるレコードのレコード識別フィールドリストは、{val02,val04}であることがわかる。   FIG. 17 is a diagram illustrating the state of the table before being updated by B1. FIG. 17 lists two records that are changed by the update operation B1. It can also be seen that the record identification field list of the record affected by the update operation is {val02, val04}.

なお、更新操作がロールバックされた場合には、更新前状態を更新(Update)する変更操作をデータベース140に対して行えばよい。図18は、B1による更新操作がロールバックされた場合のクエリの一例を示している。   If the update operation is rolled back, a change operation for updating the state before update may be performed on the database 140. FIG. 18 shows an example of a query when the update operation by B1 is rolled back.

以上のようにして、クエリ変換部124はクライアントインタフェース部122から受けたクエリに含まれる変更情報の加工を行う。加工により新たに生成されトランザクション管理部126に渡される変更情報は、レコード識別フィールドリスト、ならびに、図17に示す更新前のテーブル状態と、図18に示すロールバックされた際に復元するためのクエリのいずれか一方またはその両方である。   As described above, the query conversion unit 124 processes the change information included in the query received from the client interface unit 122. The change information newly generated by processing and passed to the transaction management unit 126 includes a record identification field list, a table state before update shown in FIG. 17, and a query for restoring when rolled back shown in FIG. Either one or both.

次いで、時刻T05の変更操作B2では、B2が削除操作であるため、図15のステップS1854の判定で「YES」の方に、つまり、ステップS1858に進む。ステップS1858では、上記更新操作の場合と同様に、B2による削除操作により影響を受けるレコードの削除前の状態を取得する。削除操作の場合は、条件に合致するレコードの全フィールドが削除されるため、図16(B)に示すように、「SELECT」文の取得フィールドには、「*」のように、該当するレコードの全フィールドの状態を取得するようなクエリを発行することが望ましい。   Next, in the change operation B2 at time T05, since B2 is a delete operation, the determination in step S1854 in FIG. 15 proceeds to “YES”, that is, the process proceeds to step S1858. In step S1858, the state before the deletion of the record affected by the deletion operation by B2 is acquired as in the case of the update operation. In the case of a delete operation, all the fields of records that meet the conditions are deleted. Therefore, as shown in FIG. 16B, the acquisition field of the “SELECT” statement includes a corresponding record such as “*”. It is desirable to issue a query that retrieves the state of all fields in

なお、削除操作がロールバックされた場合には、削除前状態を追加(Insert)する変更操作をデータベース140に対して行えばよい。   When the delete operation is rolled back, a change operation for adding the state before deletion (Insert) may be performed on the database 140.

本実施の形態におけるB2の場合、上記クエリ(図16(B))により削除前の状態として図17と同じ状態を取得することができる。削除操作がロールバックされた際にデータベースの状態を復元するためのクエリの一例を図19に示す。図19は、本実施の形態におけるB2による削除操作がロールバックされた場合のクエリの一例を示す図である。また、同様に、レコード識別フィールドリストは{val02,val04}となる。   In the case of B2 in the present embodiment, the same state as in FIG. 17 can be acquired as the state before deletion by the above query (FIG. 16B). An example of a query for restoring the state of the database when the delete operation is rolled back is shown in FIG. FIG. 19 is a diagram illustrating an example of a query when the deletion operation by B2 in the present embodiment is rolled back. Similarly, the record identification field list is {val02, val04}.

以上のようにして、クエリ変換部124は加工により新たに生成した変更情報をトランザクション管理部126に渡す。   As described above, the query conversion unit 124 passes the change information newly generated by processing to the transaction management unit 126.

次いで、時刻T08の変更操作B3では、B3が追加操作であるため、図15のステップS1856の判定で「YES」の方に、つまり、ステップS1860に進む。ステップS1860では、B3による追加操作により追加されるレコードのレコード識別フィールドのリストを取得する。追加されるレコードのレコード識別フィールドのリストは、追加操作中の追加データの値から取得する。たとえば、本実施の形態では、B3は図13(C)に示すクエリで示され、また、レコード識別フィールドはCOL0であるため、レコード識別フィールドリストは{10,11,12}の3件であることがわかる。   Next, in the change operation B3 at time T08, since B3 is an addition operation, the process proceeds to “YES” in the determination of step S1856 of FIG. 15, that is, to step S1860. In step S1860, a list of record identification fields of records added by the addition operation by B3 is acquired. The list of record identification fields of the record to be added is obtained from the value of the additional data being added. For example, in the present embodiment, B3 is indicated by the query shown in FIG. 13C, and the record identification field is COL0. Therefore, the record identification field list includes three items {10, 11, 12}. I understand that.

なお、追加操作がロールバックされた場合には、上記レコード識別フィールドリストを持つレコードを削除(Delete)する削除操作をデータベース140に対して行えばよい。図20は、本実施の形態におけるB3による追加操作がロールバックされた場合のクエリの一例を示す図である。   When the add operation is rolled back, a delete operation for deleting a record having the record identification field list may be performed on the database 140. FIG. 20 is a diagram illustrating an example of a query when the addition operation by B3 in the present embodiment is rolled back.

以上のようにして、クエリ変換部124は加工により新たに生成した変更情報をトランザクション管理部126に渡す。   As described above, the query conversion unit 124 passes the change information newly generated by processing to the transaction management unit 126.

トランザクション管理部126で世代演算式を算出する場合、実施の形態1で示した世代演算式において、正(加算)の項となっている変更情報に関しては、一旦加工する前の変更情報を持つクエリをデータベース140に対して発行し、負(減算)の項となっている変更情報に関しては、該当項に対応する変更情報に含まれる上記ロールバックされた場合のクエリを一旦発行する。そして、実施の形態1で示した世代演算式を構成するすべての項について上記クエリを発行した後、その時点での最新の世代番号を世代演算式とする。この世代番号は、実施の形態1で説明した世代演算式適用後のデータベース状態と同じ状態を示している。   When the generation management formula is calculated by the transaction management unit 126, the query having the change information before being processed once for the change information that is a positive (addition) term in the generation calculation formula shown in the first embodiment. Is issued to the database 140, and regarding the change information that is a negative (subtraction) term, the query for the rollback included in the change information corresponding to the relevant term is issued once. And after issuing the said query about all the terms which comprise the generation formula shown in Embodiment 1, let the newest generation number at that time be a generation formula. This generation number indicates the same state as the database state after applying the generation operation formula described in the first embodiment.

以上のように構成することで、世代管理型データベースが世代間の差分処理を行わない場合でも、トランザクション管理部126の内部で、実施の形態1で説明した世代演算式適用後のデータベース状態と同じ状態を示す世代番号を生成することができ、実施の形態1と同様の効果を得ることができる。   With the configuration described above, even when the generation management database does not perform inter-generational difference processing, the same as the database state after application of the generation formula described in Embodiment 1 inside the transaction management unit 126 A generation number indicating a state can be generated, and the same effect as in the first embodiment can be obtained.

なお、上記各実施の形態におけるデータベースアクセス装置は、上記のように、クライアントにインストールされるドライバソフトウェアとして利用可能である。また、Webサーバ、アプリケーションサーバ上などで動作しサーブレットエンジンライブラリとしても利用可能である。さらには、データベース上のデーモンプロセスとしても利用可能である。また、ソフトウェアのみならず、本データベースアクセス方式を実装したハードウェアボードとして、クライアントやサーバ、データベースなどに搭載した利用も可能である。   Note that the database access device in each of the above embodiments can be used as driver software installed on the client as described above. It can also be used as a servlet engine library that operates on a Web server, an application server, or the like. Furthermore, it can be used as a daemon process on the database. Further, not only software but also a hardware board that implements the database access method can be used mounted on a client, server, database, or the like.

また、本発明が適用される世代管理型データベースは、世代番号などでデータを管理するものであればどのようなものでもよく、たとえば、プログラムソースコードのバージョン管理システムや、ドラマのような複数の話から構成されたコンテンツの管理配信システムなどへも適用可能である。   The generation management database to which the present invention is applied may be any database that manages data by generation number, for example, a version management system for a program source code, or a plurality of programs such as a drama. It can also be applied to a content management / distribution system composed of stories.

本発明に係るデータベースアクセス装置は、SQLやJDBCなどのように、世代番号を指定するような規定がなされていないクエリを用いて世代管理型データベースにアクセスし、ひいては、世代管理型データベースに対して一トランザクション内で参照、変更を複数回行うことができるトランザクション機構を備えたデータベースアクセス装置として有用である。   The database access apparatus according to the present invention accesses a generation management database using a query that does not specify a generation number, such as SQL or JDBC, and consequently, for a generation management database. This is useful as a database access device having a transaction mechanism that can be referred to and changed multiple times within one transaction.

本発明の実施の形態1に係るデータベースアクセス装置を含むデータベースシステムの構成を示すブロック図1 is a block diagram showing a configuration of a database system including a database access apparatus according to Embodiment 1 of the present invention. (A)クライアント、データベースアクセス装置、およびデータベースの装置構成の一例を示す図、(B)クライアント、データベースアクセス装置、およびデータベースの装置構成の他の例を示す図、(C)クライアント、データベースアクセス装置、およびデータベースの装置構成のさらに他の例を示す図(A) The figure which shows an example of the apparatus structure of a client, a database access apparatus, and a database, (B) The figure which shows the other example of the apparatus structure of a client, a database access apparatus, and a database, (C) A client, a database access apparatus , And a diagram showing still another example of the database device configuration SQLおよびJDBCによるアイソレーションレベルの設定記述例を示す図The figure which shows the example of setting description of the isolation level by SQL and JDBC 本実施の形態におけるトランザクション管理テーブルの詳細構成およびトランザクション管理テーブルへの登録方法を示す図The figure which shows the detailed structure of the transaction management table in this Embodiment, and the registration method to a transaction management table 本実施の形態におけるデータベースアクセスの第1の操作例を示す図The figure which shows the 1st example of a database access operation in this Embodiment. 本実施の形態におけるクエリ変換部およびトランザクション管理部の動作の一例(「SERIALIZABLE」の場合)を示すフローチャートA flowchart showing an example of the operation of the query conversion unit and the transaction management unit (in the case of “SERIALIZABLE”) in this embodiment (A)本実施の形態における世代管理テーブルの一例を示す図であって図5の時刻T00の時点における世代管理テーブルの内容を示す図、(B)図5の時刻T04の時点における世代管理テーブルの内容を示す図、(C)図5の時刻T09の時点における世代管理テーブルの内容を示す図(A) A diagram showing an example of the generation management table in the present embodiment, showing the contents of the generation management table at time T00 in FIG. 5, and (B) the generation management table at time T04 in FIG. FIG. 5C shows the contents of the generation management table at time T09 in FIG. 5C. 本実施の形態におけるクエリ変換部およびトランザクション管理部の動作の他の例(「READ UNCOMMITED」の場合)を示すフローチャートA flowchart showing another example of operation of the query conversion unit and the transaction management unit (in the case of “READ UNCOMMITED”) in the present embodiment 本実施の形態における世代管理テーブルの他の例を示す図であって図5の時刻T07での世代管理テーブルの内容を示す図It is a figure which shows the other example of the generation management table in this Embodiment, Comprising: The figure which shows the content of the generation management table at the time T07 of FIG. 本実施の形態におけるクエリ変換部およびトランザクション管理部の動作のさらに他の例(「READ COMMITED」の場合)を示すフローチャートFlowchart showing still another example (in the case of “READ COMMITED”) of the operations of the query conversion unit and the transaction management unit in the present embodiment 本実施の形態におけるクエリ変換部およびトランザクション管理部の動作のさらに他の例(「REPEATABLE READ」の場合)を示すフローチャートFlowchart showing still another example (in the case of “REPEATABLE READ”) of the operations of the query conversion unit and the transaction management unit in the present embodiment 本発明の実施の形態2に係るデータベースアクセス装置における世代管理型データベース上のテーブルの一例を示す図The figure which shows an example of the table on the generation management type database in the database access apparatus which concerns on Embodiment 2 of this invention. (A)実施の形態における変更操作の一例を示す図であって更新操作の場合を示す図、(B)削除操作の場合を示す図、(C)追加操作の場合を示す図(A) It is a figure which shows an example of change operation in embodiment, Comprising: The figure which shows the case of update operation, (B) The figure which shows the case of deletion operation, The figure which shows the case of (C) addition operation 本実施の形態における世代間の差分処理を行わない場合におけるクエリ変換部およびトランザクション管理部の動作の一例(「SERIALIZABLE」の場合)を示すフローチャートA flowchart showing an example of operation of the query conversion unit and the transaction management unit (in the case of “SERIALIZABLE”) when the difference process between generations in this embodiment is not performed 図14の変更情報加工処理の内容を示すフローチャートThe flowchart which shows the content of the change information processing of FIG. (A)図15のステップS1858における更新前状態取得の一例を示す図であって更新前の状態を取得するための一般式を示す図、(B)変更操作B1の場合の一例を示す図、(C)変更操作B1の場合の他の例を示す図(A) A diagram showing an example of the pre-update state acquisition in step S1858 of FIG. 15, showing a general formula for acquiring the pre-update state, (B) a diagram showing an example of the change operation B1 (C) The figure which shows the other example in the case of change operation B1 本実施の形態における変更操作B1による更新前のテーブルの状態を示す図The figure which shows the state of the table before the update by change operation B1 in this Embodiment. 本実施の形態における変更操作B1による更新操作がロールバックされた場合のクエリの一例を示す図The figure which shows an example of the query when the update operation by change operation B1 in this Embodiment is rolled back 本実施の形態における変更操作B2による削除操作がロールバックされた場合のクエリの一例を示す図The figure which shows an example of the query when the deletion operation by change operation B2 in this Embodiment is rolled back 本実施の形態における変更操作B3による追加操作がロールバックされた場合のクエリの一例を示す図The figure which shows an example of the query when the addition operation by change operation B3 in this Embodiment is rolled back (A)データベースアクセスの概念を説明するための図であって参照のクエリが発行された場合を示す図、(B)変更のクエリが発行された場合を示す図(A) It is a figure for demonstrating the concept of database access, Comprising: The figure which shows the case where a reference query is issued, (B) The figure which shows the case where the query of a change is issued

符号の説明Explanation of symbols

100 データベースシステム
110 クライアント
120 データベースアクセス装置
122 クライアントインタフェース部
124 クエリ変換部
126 トランザクション管理部
128 トランザクション管理テーブル
130 世代管理テーブル
140 データベース
142 検索処理部
DESCRIPTION OF SYMBOLS 100 Database system 110 Client 120 Database access apparatus 122 Client interface part 124 Query conversion part 126 Transaction management part 128 Transaction management table 130 Generation management table 140 Database 142 Search processing part

Claims (11)

クライアントからのクエリを受け付けるとともに、クライアントに対してデータベースアクセスを行うためのインタフェースを提供するクライアントインタフェース部と、
前記クライアントインタフェース部から得たクエリを世代管理型データベースのネイティブ形式のクエリに変換するクエリ変換部と、
を有することを特徴とするデータベースアクセス装置。
A client interface unit that accepts a query from the client and provides an interface for performing database access to the client;
A query conversion unit that converts a query obtained from the client interface unit into a query in a native format of a generation management database;
A database access device comprising:
クライアントごとに発行された一連のクエリを一トランザクションとして管理するためのトランザクション管理テーブルと、
各トランザクションを構成する各クエリに関連付けるべき世代番号、当該クエリにより適応される変更情報、および当該トランザクションのコミット状態を管理する世代管理テーブルと、
を有するトランザクション管理部をさらに有し、
クライアントごとにトランザクションを構成する、
ことを特徴とする請求項1記載のデータベースアクセス装置。
A transaction management table for managing a series of queries issued for each client as one transaction;
A generation number to be associated with each query constituting each transaction, change information adapted by the query, and a generation management table for managing the commit state of the transaction;
A transaction management unit having
Configure transactions for each client,
The database access apparatus according to claim 1.
前記クライアントインタフェース部から得たクエリが検索操作であり、その際に当該クライアントに対応付けられたトランザクションが直列化可能に設定されていた場合には、
前記トランザクション管理部は、
前記世代管理テーブル中の当該クライアントに関して直近に登録されたレコードと、前記世代管理テーブルのレコードの中で当該トランザクションの開始以降のレコードから前記直近に登録されたレコードの間に登録され、当該トランザクション以外のレコードからなるレコード集合とを求め、前記直近に登録されたレコードが示す世代番号から前記レコード集合が示す更新情報を差し引いた世代演算式を算出し、
前記クエリ変換部は、
前記トランザクション管理部によって算出された世代演算式を変換後のクエリに付与する、
ことを特徴とする請求項2記載のデータベースアクセス装置。
When the query obtained from the client interface unit is a search operation and the transaction associated with the client is set to be serializable at that time,
The transaction management unit
Registered between the record most recently registered for the client in the generation management table and the record registered most recently from the record after the start of the transaction in the generation management table record. A record set consisting of the records, and calculating a generation formula that subtracts update information indicated by the record set from a generation number indicated by the most recently registered record
The query conversion unit
Giving the generation formula calculated by the transaction management unit to the converted query,
The database access apparatus according to claim 2.
前記クライアントインタフェース部から得たクエリが検索操作であり、その際に当該クライアントに対応付けられたトランザクションが非コミット読み取りに設定されていた場合には、
前記クエリ変換部は、
検索操作時点における世代管理型データベース上で最新の世代番号を変換後のクエリに付与する、
ことを特徴とする請求項2記載のデータベースアクセス装置。
When the query obtained from the client interface unit is a search operation, and the transaction associated with the client is set to uncommitted read at that time,
The query conversion unit
Assign the latest generation number to the converted query on the generation management database at the time of the search operation.
The database access apparatus according to claim 2.
前記クライアントインタフェース部から得たクエリが検索操作であり、その際に当該クライアントに対応付けられたトランザクションがコミット読み取りに設定されていた場合には、
前記トランザクション管理部は、
検索操作時点における世代管理型データベース上で最新の世代番号を取得し、また、前記世代管理テーブルのレコードの中から当該トランザクション以外であり未コミット状態のレコード集合を求め、前記最新の世代番号から前記レコード集合が示す更新情報を差し引いた世代演算式を算出し、
前記クエリ変換部は、
前記トランザクション管理部によって算出された世代演算式を変換後のクエリに付与する、
ことを特徴とする請求項2記載のデータベースアクセス装置。
When the query obtained from the client interface unit is a search operation and the transaction associated with the client is set to read commit at that time,
The transaction management unit
The latest generation number is acquired on the generation management database at the time of the search operation, and the record set other than the transaction and uncommitted is obtained from the records of the generation management table. Calculate the generation formula that subtracts the update information indicated by the record set,
The query conversion unit
Giving the generation formula calculated by the transaction management unit to the converted query,
The database access apparatus according to claim 2.
前記クライアントインタフェース部から得たクエリが検索操作であり、その際に当該クライアントに対応付けられたトランザクションが再読み込み可能読み取りに設定されていた場合には、
前記トランザクション管理部は、
前記世代管理テーブル中の当該クライアントに関して直近に登録されたレコードと、前記世代管理テーブルのレコードの中で前記直近に登録されたレコード以降で、当該トランザクション以外でありコミット状態のレコード集合とを求め、前記直近に登録されたレコードが示す世代番号と、前記レコード集合が示す更新情報とを加えた世代演算式を算出し、
前記クエリ変換部は、
前記トランザクション管理部によって算出された世代演算式を変換後のクエリに付与する、
ことを特徴とする請求項2記載のデータベースアクセス装置。
When the query obtained from the client interface unit is a search operation, and the transaction associated with the client is set to be readable and readable,
The transaction management unit
Finding the record most recently registered for the client in the generation management table and the record set in a committed state other than the transaction after the most recently registered record in the generation management table, Calculating a generation formula that adds the generation number indicated by the most recently registered record and the update information indicated by the record set;
The query conversion unit
Giving the generation formula calculated by the transaction management unit to the converted query,
The database access apparatus according to claim 2.
前記クライアントインタフェース部から得たクエリがロールバック操作である場合には、
前記トランザクション管理部は、
検索操作時点における世代管理型データベース上で最新の世代番号を取得し、また、前記世代管理テーブルのレコードの中から当該トランザクションで未コミット状態のレコード集合を求め、前記最新の世代番号から前記レコード集合が示す更新情報を差し引いた世代演算式を算出し、
前記クエリ変換部は、
前記トランザクション管理部によって算出された世代演算式を付与したクエリを発行する、
ことを特徴とする請求項2記載のデータベースアクセス装置。
When the query obtained from the client interface unit is a rollback operation,
The transaction management unit
The latest generation number is acquired on the generation management database at the time of the search operation, and a record set in an uncommitted state in the transaction is obtained from the records of the generation management table, and the record set is acquired from the latest generation number. Calculate the generation formula that subtracts the update information indicated by
The query conversion unit
Issuing a query with a generation formula calculated by the transaction management unit,
The database access apparatus according to claim 2.
前記世代管理型データベースが世代間の差分処理を行わず、また、前記クライアントインタフェース部から得たクエリが変更操作のうち更新操作である場合には、更新操作により影響を受けるレコードの更新前状態を取得し、さらには、前記更新操作がロールバックされた場合に、前記更新前状態の内容を更新する変更操作を前記世代管理型データベースに行う、ことを特徴とする請求項2から請求項7のいずれかに記載のデータベースアクセス装置。   If the generation management database does not perform inter-generational difference processing, and the query obtained from the client interface unit is an update operation among the change operations, the pre-update state of the record affected by the update operation is displayed. 8. The acquisition management database according to claim 2, further comprising: performing a change operation for updating the contents of the pre-update state on the generation management database when the update operation is rolled back. The database access device according to any one of the above. 前記世代管理型データベースが世代間の差分処理を行わず、また、前記クライアントインタフェース部から得たクエリが変更操作のうち削除操作である場合には、削除操作により影響を受けるレコードの削除前状態を取得し、さらには、前期削除操作がロールバックされた場合に、前記削除前状態の内容を追加する変更操作を前記世代管理型データベースに行う、ことを特徴とする請求項2から請求項7のいずれかに記載のデータベースアクセス装置。   If the generation management database does not perform inter-generational difference processing, and the query obtained from the client interface unit is a delete operation among the change operations, the state before deletion of the record affected by the delete operation is displayed. 8. The generation management database according to claim 2, further comprising: performing a change operation for adding the content of the state before the deletion to the generation management database when the previous deletion operation is rolled back. The database access device according to any one of the above. 前記世代管理型データベースが世代間の差分処理を行わず、また、前記クライアントインタフェース部から得たクエリが変更操作のうち追加操作である場合には、追加操作に含まれる変更情報の中から追加される新規レコードのレコード識別フィールドの集合であるレコード識別フィールドリストを取得し、さらには、前期追加操作がロールバックされた場合に、前記レコード識別フィールドリスト中に含まれるレコード識別フィールドを持つレコードを削除する変更操作を前記世代管理型データベースに行う、ことを特徴とする請求項2から請求項7のいずれかに記載のデータベースアクセス装置。   If the generation management database does not perform inter-generational difference processing, and the query obtained from the client interface unit is an addition operation among the change operations, it is added from the change information included in the addition operation. The record identification field list that is a set of record identification fields of the new record is acquired, and when the previous addition operation is rolled back, the record having the record identification field included in the record identification field list is deleted. The database access apparatus according to claim 2, wherein a change operation to be performed is performed on the generation management database. 前記トランザクション管理部は、
前記世代管理型データベースが世代間の差分処理を行わない場合には、前記世代演算式において、すべての項について、正(加算)の項となっている変更情報に関しては、加工する前の変更情報を持つクエリをデータベースに対して発行し、負(減算)の項となっている変更情報に関しては、該当する項に対応する変更情報に含まれる前記ロールバックされた際に用いるクエリを発行した後、その時点での最新の世代番号を新たな世代演算式として算出する、
ことを特徴とする請求項2から請求項7のいずれかに記載のデータベースアクセス装置。
The transaction management unit
When the generation management database does not perform inter-generational difference processing, change information that is a positive (addition) term for all terms in the generation arithmetic expression is changed information before processing. For change information that is a negative (subtraction) term after issuing a query that has a, after issuing the query used when the rollback included in the change information corresponding to the relevant term , Calculate the latest generation number at that time as a new generation formula,
8. The database access device according to claim 2, wherein the database access device is a database access device.
JP2004220812A 2004-07-28 2004-07-28 Database access apparatus Pending JP2006040064A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004220812A JP2006040064A (en) 2004-07-28 2004-07-28 Database access apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004220812A JP2006040064A (en) 2004-07-28 2004-07-28 Database access apparatus

Publications (1)

Publication Number Publication Date
JP2006040064A true JP2006040064A (en) 2006-02-09

Family

ID=35904974

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004220812A Pending JP2006040064A (en) 2004-07-28 2004-07-28 Database access apparatus

Country Status (1)

Country Link
JP (1) JP2006040064A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017027326A (en) * 2015-07-22 2017-02-02 株式会社東芝 Storage system and program for the same
WO2017060941A1 (en) * 2015-10-05 2017-04-13 株式会社日立製作所 Data management system and data management method which maintain consistency between plurality of data
JP2019121946A (en) * 2018-01-09 2019-07-22 Kddi株式会社 Document management system, document management method, and document management program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017027326A (en) * 2015-07-22 2017-02-02 株式会社東芝 Storage system and program for the same
WO2017060941A1 (en) * 2015-10-05 2017-04-13 株式会社日立製作所 Data management system and data management method which maintain consistency between plurality of data
JP2019121946A (en) * 2018-01-09 2019-07-22 Kddi株式会社 Document management system, document management method, and document management program

Similar Documents

Publication Publication Date Title
US5600832A (en) Variant domains and variant maps in a versioned database management system
US6882994B2 (en) Method and system for querying database, as well as a recording medium for storing a database querying program
US20130132349A1 (en) Tenant separation within a database instance
US20100023562A1 (en) Extended system for accessing electronic documents with revision history in non-compatible repositories
US8090700B2 (en) Method for updating databases
US9171036B2 (en) Batching heterogeneous database commands
EP1695247A2 (en) Extended database engine providing versioning and caching of derived data
US20090248739A1 (en) System and Method to Support Runtime Model Extension in an Object Relational Mapping (ORM) System
US7624117B2 (en) Complex data assembly identifier thesaurus
US9922100B2 (en) Systems and methods for facilitating the development of an application that accesses data
US20070255685A1 (en) Method and system for modelling data
US9053143B2 (en) Allowing updates to database objects
US8180745B2 (en) Persistent object references to parallel database containers
US7398264B2 (en) Simplifying movement of data to different desired storage portions depending on the state of the corresponding transaction
JP2006040064A (en) Database access apparatus
KR20190129474A (en) Apparatus and method for retrieving data
US6925630B1 (en) Method for generating code for processing a database
US7711730B2 (en) Method of returning data during insert statement processing
US7010552B2 (en) Optimizing command execution in database systems that provide support for updatable scrollable cursors
US7856455B2 (en) System, method and program product for generating triggers for a relational database
JPH03123946A (en) Exclusive control method for data base
JP5316015B2 (en) Information processing apparatus and program
JP2004259066A (en) Data source integrating program, system and method
Kricke et al. Preserving Recomputability of Results from Big Data Transformation Workflows: Depending on External Systems and Human Interactions
JP2003208346A (en) Reflection system of data base update information and program therefor