JP2004157776A - Processing method for application and system - Google Patents

Processing method for application and system Download PDF

Info

Publication number
JP2004157776A
JP2004157776A JP2002322916A JP2002322916A JP2004157776A JP 2004157776 A JP2004157776 A JP 2004157776A JP 2002322916 A JP2002322916 A JP 2002322916A JP 2002322916 A JP2002322916 A JP 2002322916A JP 2004157776 A JP2004157776 A JP 2004157776A
Authority
JP
Japan
Prior art keywords
processing
asynchronous
service
asynchronous processing
application
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
JP2002322916A
Other languages
Japanese (ja)
Inventor
Hitomaru Saitou
仁丸 斎藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2002322916A priority Critical patent/JP2004157776A/en
Publication of JP2004157776A publication Critical patent/JP2004157776A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a processing method for an application and a system which can equally manage commitment/rollback related to a database update and commitment/rollback related to a request for and the execution of asynchronous processing. <P>SOLUTION: Asynchronous processing startup service 2 and an asynchronous processing management table 6 are linked with a relational database and manage progress and faults. The processing method realizes a first function which is realized by the asynchronous processing startup service 2 in which introduced asynchronous processing is called out at least once; a second function which stops subsequent processing so that the introduced asynchronous processing will not be executed doubly; a third function which realizes unified management when a fault occurs, on the basis of information included in the asynchronous processing management table 6; a forth function which can trace back the fault to analyze if the asynchronous processing is called out in nesting; and a fifth function which can request for retry with respect to retrieved asynchronous processing in which an error has occurred. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、非同期で実行されるアプリケーションの動作を保証する構成を提供するアプリケーションの処理方法およびシステムに関する。
【0002】
【従来の技術】
非常に単純なシステムを開発する場合、そのシステムの利用者が自分の実行した処理の正常終了を常に確認することにすれば、同期処理のみでシステムを構築することができる。このような単純なシステムでは人間系によってエラーを回避して、システムの信頼性を保証することになる。
なお、このようなシステムの信頼性を向上させるためのトランザクションの二重実行を回避するものとして、トランザクションの完了通知が紛失している場合でも、他ホストにてリカバリされた記録の有無をチェックし、トランザクションの二重実行を防止し中断トランザクションの起動の契機を得てシステムの信頼性を向上させるものが提案されている(例えば、特許文献1参照)。
【0003】
【特許文献1】
特開平11−212917号公報
【0004】
【発明が解決しようとする課題】
ところが、オペレータが伝票入力を行い、システムが構成チェックを行った後、伝票をプリンタで打ち出すような場合、オペレータに連続して入力作業をしてもらった方が効率が良く、そのためには構成チェックやプリンタでの印刷はオペレータの入力処理とは非同期に並列で行う必要があるなど、複雑な処理を単位時間になるべく多く実行させようとするシステムを構築する場合、処理を並列で実行させる必要があるが、非同期処理を採用した場合、非同期に行われた処理は知らない間にエラーすることがある。このため、非同期処理には知らない間に発生した様々なエラーにも自動的に対応できるような高い保証レベルが要求されるが、Java(登録商標、Sun Microsystems社が開発した言語)には非同期処理を行うためにはMDB(Message−driven Bean)を使うことができるがそのままでは動作保証が不十分であるという課題があった。
【0005】
具体的には従来の技術には、次のような問題点がある。
第1の問題点は、非同期処理をデータベースの更新と連携させたいと思っても、データベース更新に関するコミット、ロールバックと非同期処理の要求、実行に関するコミット、ロールバックを同一管理できなかったということである。その理由は、非同期処理起動サービス(待ち行列)がデータベース管理システムと連動していなかったり、非同期処理管理テーブルを持っていなかったためである。また、もしそれらのサービスを持っていたとしても非同期処理起動サービス(待ち行列)と非同期処理管理テーブルを一般のテーブルと同じデータベース管理システムの配下で管理していなかったためである。
【0006】
第2の問題点は、非同期処理が要求された後で、非同期に実行されている部分が異常終了しても自動的には処理を再実行させることが出来ないということである。その理由は、非同期処理起動サービス(待ち行列)がデータベースと連携していないので障害があった非同期処理を再実行して良いのか悪いのかシステムとして判断出来ないためである。
第3の問題点は、再実行を要求したが、実は先行処理が正常に終了していた場合、同様の非同期処理を2回実行してしまうことになるということである。
その理由は、非同期処理管理テーブルを用意していないので実行の進捗を管理出来ないためである。
【0007】
第4の問題点は、主に障害時における以下のような情報を統一的に管理できないことにある。
(1)障害が発生した場合、どの処理がいつどんな状態でエラーになったか統一的に管理できておらず、エラーとなった非同期処理を検索することが困難である。
(2)親→子→孫のように非同期処理が入れ子で呼び出された場合、障害を追いかけて分析することができない。
(3)エラーとなった非同期処理を発見できてもその非同期処理に対して容易にリトライを要求できない。その理由は、本発明で提示しているような非同期処理管理テーブルがそもそも用意されていなかったり、あったとしても上記リトライを要求するのに充分な情報を管理するようになっていないためである。
【0008】
そこで本発明は、データベース更新に関するコミット、ロールバックと、非同期処理の要求、実行に関するコミット、ロールバックを同一管理できるアプリケーションの処理方法およびシステムを提供することを目的とする。
【0009】
また、本発明は、非同期にアプリケーションを実行できるアプリケーションの処理方法およびシステムを提供することを目的とする。
【0010】
また、本発明は、誤って複数回非同期処理を実行してしまった場合には後続の処理が複数実行であることを検出でき、二重実行となってしまう場合には処理を取りやめることができるアプリケーションの処理方法およびシステムを提供することを目的とする。
【0011】
また、本発明は、実行情報、障害情報や、非同期処理の親子の関係を一元管理し、それらの情報から障害が起こった場合でもリトライが容易に行えるアプリケーションの処理方法およびシステムを提供することを目的とする。
【0012】
【課題を解決するための手段】
本発明に係るアプリケーションの処理方法は、クライアントサービスからの処理依頼に対し、非同期処理サーバサービスにおいて非同期で実行されるアプリケーションの動作を保証するアプリケーションの処理方法であって、同期処理のみで動作し、前記クライアントサービスから同期処理サーバサービスへ非同期処理の処理依頼を出すための投入フェーズ、非同期処理起動サービスから非同期処理依頼された非同期処理が、前記非同期処理サーバサービスにより実行される処理フェーズ、前記クライアントサービスにより前記同期処理サーバサービスを介して非同期処理の進捗や成功、失敗を含む前記非同期処理の実行について確認する確認フェーズ、前記確認フェーズで処理の終了を確認した後、情報を取り込むための取得フェーズ、前記非同期処理や異常終了後の再実行のための再実行フェーズの内から必要なフェーズを連携させ、非同期で実行されるアプリケーションの動作を保証することを特徴とする。
【0013】
本発明のアプリケーションの処理方法は、投入フェーズ、処理フェーズ、確認フェーズ、取得フェーズ、再実行フェーズの内から必要なフェーズを連携させ、データベース更新に関するコミット、ロールバックと、非同期処理の要求、実行に関するコミット、ロールバックを同一管理可能にすることで、非同期処理の二重実行の防止、障害が起こった場合の再実行を可能にし、非同期にアプリケーションを実行し、前記非同期で実行されるアプリケーションの動作を保証する。
【0014】
本発明に係るアプリケーションの処理システムは、同期、非同期のサービスを受けるクライアントサービスと、前記クライアントサービスに対するサーバ処理を受け持つ同期処理サーバサービスと、非同期処理を実行する非同期処理サーバサービスと、前記非同期処理サーバサービスの非同期処理実行について、リレーショナルデータベースと連動し、進捗や障害を管理し、非同期で実行されるアプリケーションの動作を保証する保証手段とを備えたことを特徴とする。
【0015】
本発明のアプリケーションの処理システムは、非同期処理サーバサービスの非同期処理実行について、リレーショナルデータベースと連動し、進捗や障害を管理し、データベース更新に関するコミット、ロールバックと、非同期処理の要求、実行に関するコミット、ロールバックを同一管理し、非同期処理の二重実行の防止、障害が起こった場合の再実行を可能にし、非同期にアプリケーションを実行し、前記非同期で実行されるアプリケーションの動作を保証する。
【0016】
【発明の実施の形態】
以下、本発明の実施の一形態について説明する。
図1は、この実施の形態のアプリケーションの処理システムを示すブロック図である。図2は、この実施の形態のアプリケーションの処理システムにおける非同期処理動作を示すシーケンス図である。この実施の形態のアプリケーションの処理方法が適用されるシステムは、図1に示す各サービスから構成され、図2のシーケンスに従って実行される。
このアプリケーションの処理システムでは、図1および図2に符号2で示す非同期処理起動サービス(待ち行列)や符号6で示す非同期処理管理テーブルがリレーショナルデータベースと連動し、進捗や障害を管理することに特徴がある。
そして、非同期処理を正確に1回だけ実行させるために以下の2つの機能を提供する。第1の機能は、投入された非同期処理はたとえ障害が発生したとしても少なくとも1回は呼び出される。この第1の機能は主に図1および図2の符号2で示す非同期処理起動サービス(待ち行列)によって実現される。また、第2の機能は、投入された非同期処理が、万一複数回実行された場合は既に実行済みであることを検知して二重実行されないように後続の処理を中止する。この第2の機能は主に図1および図2の符号6で示す非同期処理管理テーブルによって実現される。これら第1の機能と第2の機能を合わせることでハードウエア障害など一般には復旧が出来ないと思われるような状況においても投入された非同期処理を確実に1回実行することを可能とする。
また、図1および図2の符号6で示す非同期処理管理テーブルに持つ情報により、障害が発生した場合、どの処理がいつどんな状態でエラーになったか統一的に管理できる第3の機能を実現し、また、親→子→孫のように非同期処理が入れ子で呼び出された場合でも障害を追いかけて分析できる第4の機能を実現し、また、エラーとなった非同期処理を検索することが可能である。さらに検索されたエラーとなった非同期処理に対してリトライを要求できる第5の機能を実現する。
このようにして、非同期で実行されるアプリケーションの動作を高度に保証することを可能にする。
【0017】
なお、この実施の形態において同期処理とは図14の左のシーケンスで示されるように呼び出しを行なった側が呼び出された側の処理のリターンを待って処理を継続していく処理方式を指すものとする。そして、この同期処理では、ユーザへのレスポンスが悪いため業務に支障をきたすというデメリットがある反面、トランザクションなどの終了結果を利用者が確認できるというメリットを有している。
また、非同期処理とは図14の右のシーケンスで示されるように呼び出しを行った側が呼び出された側の処理を待つことなく、呼び出しを行なった側と呼び出された側が同時に並行して動作する処理方式を指すものとする。そして、この非同期処理では、プリンタの印刷状況を後で確認したり、後続の処理で今までの作業の一覧を確認する画面を呼び出す(部品では進捗管理テーブルを用意しているため容易に確認できる)など、非同期で処理される部分の実行結果を後で確認する必要があるなどのデメリットがある反面、処理が素早く返ってくるため単位時間あたり多くの入力を行うことができるメリットがある。
【0018】
先ず、この実施の形態のアプリケーションの処理システムを構成する図1に示す各サービスについて説明する。
クライアントサービス(例:ブラウザ)1は、同期、非同期のサービスを受けるクライアントを指す。例としてはエンドユーザが操作するブラウザやクライアントアプリケーションが挙げられる。主にオンライン系として利用されることを想定しているが、場合によってはバッチ系の処理がクライアントサービスとなって同期処理や非同期処理を利用する場合もある。
【0019】
非同期処理起動サービス(例:JavaのJMSキュー、Job管理サービス、UNIX(登録商標、AT&T社が開発したタイム・シュアリング・システム用OS)のクーロン、Windows(登録商標、Microsoft社が開発したOS)のatコマンド)2は、同期処理はユーザからの要求で実際に処理が実行されるが、非同期処理の場合はユーザからは要求のみが登録され、その要求に実行をかけるために別のサービスが必要となる。この別のサービスに対応するのが非同期処理起動サービスである。非同期処理起動サービスはこの機能を実現する。例えばJavaのJMS (Java Messaging Service)や市販のJob管理ツール、UNIXのクーロン、Windowsのatコマンドなどがこの非同期処理起動サービスとなり得る。
【0020】
同期処理サーバサービス(例:Webアプリケーションサーバ)3は、クライアントサービスに対するサーバ処理を受け持つサービスである。これらの間の処理は同期処理となる。クライアントサービスから非同期処理を投入する場合は先ずこの同期処理サーバサービスにアクセスして、同期処理サーバサービス経由で非同期処理を要求することになる。例えばWebアプリケーションサーバやTPモニタ(トランザクションモニタ)やMicrosoftのCOM+、CORBA (Common Object Request Broker Archi tecture)やRMI(Remote Method Invocation)に代表されるORB(Object Request Broker)などがこれにあたる。
【0021】
非同期処理サーバサービス(例:JavaのMessage−driven Bean、シェルやコマンドなどのバッチ処理)4は、実際に非同期処理を実行するサービスを指す。例えばJavaのMDB(Message−drivenBean) やシェルやコマンドなどのバッチ処理を行うサービスがこれにあたる

【0022】
入力情報(IN)5は、テーブル(データ)、実ファイル(テキスト、CSV、バイナリファイルなど)非同期処理への入力情報である。簡単なパラメータは非同期処理管理テーブルで管理できるがデータベースのテーブルに格納する巨大なデータを利用する場合やテキストファイル、CSV(Comma Separated Values)ファイル、バイナリファイルを扱う場合は非同期処理管理テーブルの外で管理することになる。ただし、この実施の形態では全ての情報はデータベースで管理することとするので各種のファイルとして持っている情報もデータベースに格納して管理することになる。
【0023】
非同期処理管理テーブルの拡張としてこれら入力情報5のデータをデータベースで管理する場合の例を図12に示す。
非同期処理管理テーブル6は、この実施の形態の中核をなす情報を管理するテーブルである。MDB(Message−driven Bean)で部品化した場合のサンプルを図3、図4、図5、図6、図7、図8、図9、図10、図11に示す。このサンプルでは複数のテーブルで詳細な情報を管理するように作られているので図3から図11までで規定している。
【0024】
出力情報(OUT)7はプル型とプッシュ型とに分かれ、プル型としてテーブル(データ)、実ファイル(テキスト、CSV、バイナリファイルなど)を想定し、プッシュ型としては、プリンタ、メール、ログ、障害通知、他システム連携などを想定している。そして、この出力情報(OUT)7は、非同期処理からの出力情報である。簡単なパラメータやエラーコード、エラーメッセージは非同期処理管理テーブルで管理されているがそれでは不足する場合に必要となる。上述したように大きくプル型とプッシュ型に分かれる。
プル型はテーブルに格納されている情報やテキスト、CSV、バイナリなどのファイルがデータベースに格納されているものをユーザからのアクションで取ってもらう場合を想定している。
これに対してプッシュ型はシステム側から自動的にユーザまで届けられる場合で、プリンタへの出力やメールへの転送、ログや障害通知、それに他システムへの連携などが挙げられる。非同期処理管理テーブルの拡張としてこれらのデータをデータベースで管理する場合の例を図12に示す。
【0025】
業務データベース8については、この実施の形態では業務データベースと非同期処理関係の情報が連携する必要があるので、同一のデータベース管理システム下に置くものとする。
【0026】
次に非同期処理フェーズについて説明する。
図2は各フェーズの処理内容を示すシーケンス図であり、図2に示すように、投入フェーズ、処理フェーズ、確認フェーズ、取得フェーズ(プル型)、再実行フェーズ(プッシュ型)に分類でき、これらフェーズが連携して、非同期で実行されるアプリケーションの動作を高度に保証する。
投入フェーズは、ユーザが非同期処理の処理依頼を出すためのフェーズを指す。図2のシーケンスを見るとこの投入フェーズは同期処理のみで動作することが分かる。一般に非同期処理への投入は非常に軽い処理であり、ユーザは投入が終わると次の処理フェーズの実行の如何に関わらず別の非同期処理の投入を行うことが出来る。
【0027】
処理フェーズは、非同期処理サーバサービス4により実際に非同期処理の内容が実行される部分である。この処理フェーズのみが非同期処理起動サービス4から実行される。主に処理時間の長いチェック系の業務や印刷業務で使用される。
【0028】
確認フェーズは、ユーザが非同期処理の進捗や成功、失敗の別を確認するフェーズである。処理が実行中の場合(未完了の場合)はこの確認フェーズを繰り返し実行する必要がある。
【0029】
取得フェーズ(プル型)は、プル型の情報を持つ非同期処理の場合、ユーザは確認フェーズで処理の終了を確認した後、取得フェーズによって情報を取り込む必要がある。
【0030】
再実行フェーズ(プッシュ型)は、プッシュ型の情報を持つ非同期処理や、プル型でも異常終了して再実行を要求したい場合、この再実行フェーズを行うことになる。
【0031】
次に、図2に示すシーケンス図を参照し、この実施の形態の全体の動作について詳細に説明する。
先ず、「各非同期処理フェーズに関する説明」で個々のフェーズでの詳細を説明し、その後に「非同期処理フェーズの連携に関する説明」で前に説明した個々のフェーズがどのように連携するかを説明する。
「各非同期処理フェーズに関する説明」
以下、前記分類した処理フェーズごとに区切って説明する。
「投入フェーズ」
ステップS11(投入)では、一般の同期処理としてクライアントサービス1から同期処理サーバサービス3へ「非同期処理への依頼」をかける。ステップS12(パラメータ、ファイル)では、同期処理サーバサービス3がパラメータやファイルなどの非同期処理への入力情報を登録する。ステップS13(非同期処理の依頼を登録)では、同期処理サーバサービス3が前記「非同期処理への依頼」を非同期処理管理テーブル6に登録する。ステップS14(登録完了を通知)では、ユーザ(クライアントサービス1)は登録処理が終了した旨のリターンを同期処理サーバサービス3から受け取る。注意が必要なのはこの時点では非同期処理の登録のみが正常に終了したことしか分からないことである。非同期処理自体が正常に終了したかどうかは後述する「確認フェーズ」でチェックする必要がある。
【0032】
「処理フェーズ」
ステップS21(非同期処理依頼)では、「非同期処理起動サービス2」によって非同期処理が実行される。ステップS22(依頼を検索)では、非同期処理サーバサービス4が「非同期処理管理テーブル6」に対して依頼内容を確認しにいく。またステップS23(入力内容を参照)では、非同期処理を実行する場合に必要な入力情報を非同期処理サーバサービス4が非同期処理管理テーブル6に対し確認しにいく。ステップS24(検索処理、更新処理)では、「業務データベース8」を使って当該処理参照、更新が行われる。ステップS25(出力結果を保存)では、非同期処理の結果を出力情報7として保存する。ステップS26(依頼の進捗状況を更新)では、非同期処理が完了したので進捗状況を「非同期処理管理テーブル6」に保存する。ステップS27(非同期処理終了をリターン)では、非同期処理を終了し、非同期処理終了を非同期処理起動サービス2へ返す。
【0033】
「確認フェーズ」
ステップS31(確認画面を要求)では、ユーザが非同期処理の確認を要求する。ステップS32(進捗状況を確認)では、「非同期処理管理テーブル6」に進捗状況を確認する。ステップS33(進捗、結果を一覧表示)では、進捗状況をリターンする。実行中、正常終了、エラーなどがリターンされる。
【0034】
「取得フェーズ(プル型)」
ステップS41(一覧表示画面から1件選択)では、「確認フェーズ」で取得した情報から必要な情報の取得を要求する。ステップS42(当該処理の結果取得)では、「出力情報7」から非同期処理の結果を取得する。ステップS43(当該処理の結果で使用するデータを取得)では、「出力情報7」以外に必要とする情報があれば「業務データベース8」から取得する。ステップS44(結果の返却)では、結果をユーザ(クライアントサービス1)に返却する。
【0035】
「再実行フェーズ(プッシュ型)」
ステップS51(一覧表示画面から1件選択)では、「確認フェーズ」で取得した情報から再実行の必要な情報を選択する。ステップS52(非同期処理管理テーブルのステータスを再実行に変更)では、「非同期処理管理テーブル6」のステータスを再実行に変更する。ステップS53(再実行を通知)では、再実行を要求した旨をユーザ(クライアントサービス1)に返却する。
これらの非同期処理フェーズごとの処理が以下の「非同期処理フェーズの連携に関する説明」のように連携して非同期処理が実行される。
【0036】
「非同期処理フェーズの連携に関する説明」
以下、前記実施の形態の構成において説明した各機能と前記「各非同期処理フェーズに関する説明」で説明したそれぞれの非同期処理フェーズがどのように連携して非同期処理全体を構成するかをパターンに分けて説明する。
【0037】
図2の出力情報(OUT)7で説明したプル型の場合、各フェーズは例えば以下のように連携する。
例えば長時間を要する処理を非同期で投入した場合には、「投入フェーズ」→「処理フェーズ」→「確認フェーズ」→「取得フェーズ」。
【0038】
図2の「出力情報(OUT)7」で説明したプッシュ型の場合、各フェーズは例えば以下のように連携する。
例えば印刷や自分宛てのメールなど別途確認が可能な処理を要求した場合には、「投入フェーズ」→「処理フェーズ」。
または、他人宛てのメールや他システムへの連携処理など確認が必要な場合には、「投入フェーズ」→「処理フェーズ」→「確認フェーズ」。
または、例えば非同期処理の失敗を確認し、リトライをかけた場合や、印刷などで紙詰まりが発生し、再印刷をかけた場合には、「投入フェーズ」→「処理フェーズ」→「確認フェーズ」→「再実行フェーズ」。
【0039】
次に、オンライン処理から非同期処理を呼び出す場合とバッチ処理から非同期処理を呼び出す場合について説明する。
以上、説明してきた非同期処理の動作はオンライン系の処理とバッチ系の処理のどちらからでも呼び出すことができる。図13は、非同期処理の動作について実際にオンラインからの呼び出しとバッチからの呼び出しを想定した場合の構成例を示す説明図である。図13の例ではMDB(Message−drivenBean)で非同期処理を実装しているが以下の3種類の呼び出しを例として備えている。
【0040】
「(A)ローカルの非同期処理を呼び出す」
図1のクライアントサービス1と同期処理サーバサービス3がオンライン系の処理を構成している場合でかつ、図1の同期処理サーバサービス3と非同期処理サーバサービス4が同一の環境に実装されている場合。
【0041】
「(B)リモートの非同期処理を呼び出す」
図1のクライアントサービス1と同期処理サーバサービス3がオンライン系の処理を構成している場合でかつ、図1の同期処理サーバサービス3と非同期処理サーバサービス4が異なる環境に実装されている場合。
【0042】
「(C)バッチ処理から非同期処理を呼び出す」
図1のクライアントサービス1と同期処理サーバサービス3がオンライン系の処理を構成している場合。図13ではバッチ処理から非同期処理を呼び出す場合はリモート呼出のみ記述されているが環境の作り方如何によってはローカル呼び出しも可能である。
【0043】
以上のように、この実施の形態によれば、第1の効果は、一般のテーブルと非同期処理起動サービス(待ち行列)2や非同期処理管理テーブル6などを共通のデータベース管理システムの配下に設置したため、本発明を利用した部品を利用する業務アプリケーションのトランザクションと本発明を利用した非同期処理のトランザクションを同一のトランザクションとしてコミット、ロールバックのタイミングを共通管理できることである。
【0044】
また、第2の効果は、非同期処理起動サービス(待ち行列)2をデータベースに書き込むことによってハードウエア障害を含むシステム上の障害が発生した後でも障害復旧後に自動的に未処理状態にある非同期処理を再実行でき、再実行する回数は非同期処理管理テーブル6のリトライ回数として指定することができ、少なくとも1回は非同期にアプリケーションを実行できる。
【0045】
また、第3の効果は、非同期処理管理テーブル6で進捗管理をしており、非同期処理管理テーブル6のステータスをチェックすることで当該処理が正当な実行状態にあるのか異常な事項状態にあるのか確認できるため、間違って複数回非同期処理を実行してしまった場合には後続の処理が複数実行であることを検出でき、二重実行となってしまう場合には処理を取りやめることができる。
(※第2の効果と第3の効果を合わせてハードウエア障害など一般には復旧不能と思われるような状況に陥っても「少なくとも1回(第2の効果)」かつ「ただ1回だけ(第3の効果)」非同期処理を実行することを可能とする)
【0046】
また、第4の効果は、非同期処理管理テーブルで実行ユーザID、開始時刻、終了時刻、ステータス、エラーコード、エラーメッセージなどの情報を管理できており、図15で示すように前の非同期処理を特定するIDを保持しているのでそれを辿って非同期処理全体のツリーを復元でき、さらに非同期処理管理テーブル6とそれに付随するテーブルを使えばリトライに必要な全ての情報を取り出すことができるように設計されているため、実行情報、障害情報や、非同期処理の親子の関係を一元管理し、図16に示すように非同期処理に障害が発生した場合でもリトライが容易に行える。
【0047】
次に、本発明の他の実施の形態について説明する。
以上の説明では、Javaでの実装を想定し、Javaのイメージで記述を行なっているが、Javaに限定せず一般のサービスとしても利用可能である。
【0048】
図1の非同期処理起動サービス2と非同期処理サーバサービス4を複数のサーバに分散させて負荷分散または障害時の振分け構成(フェイルオーバー)をとることも可能である。例えば、図3から図11に示す非同期処理管理テーブル(Message−driven Beanの場合)はこの複数サーバ構成に対応するように作られている。
【0049】
図1のクライアントサービス1としてブラウザや一般のアプリケーションを想定してシステムを組むことが可能である。
【0050】
図1の非同期処理起動サービス2としてJavaのJMSキュー(Java Messaging Service Queue)、一般製品として発売されているJob管理サービス、UNIXのクーロン、WindowsNTやWindows2000のatコマンドなどを採用することが可能である。ただし、これらの待ち行列をデータベースと連携させるように構築することが必要となる。(ほかにやり方がない場合は一定間隔でデータベースを見に行くように作る必要がある)
【0051】
図1の同期処理サーバサービス3としてWebアプリケーションサーバやTPモニター(トランザクションモニター)などを採用することが可能である。また分散オブジェクトを使う場合はEJBコンテナ(Enterprise Java Beans コンテナ)やCORBAオブジェクトやMICROSOFTのCOM+などを使うことも可能である。
【0052】
図1の非同期処理サーバサービス4としてJavaのMessage−driven Bean、UNIXのシェルやコマンド、Windowsのバッチファイルなどを用いることができる。
【0053】
図1の入力情報(IN)5としては図5の業務パラメータのように図1の非同期処理管理テーブル6で直接管理するほか業務データベース8のテーブル(データ)として管理したり、実ファイル(テキスト、CSV、バイナリファイルなど)として管理する方法もある。図1の非同期処理管理テーブル6に図5の業務パラメータのような構造をもたせておくと、図12の非同期処理管理テーブルの拡張で示すようにテーブルの拡張が可能となる。(拡張するテーブルの一意キーを図6の業務パラメータに設定することでテーブル拡張する)また、テーブルを拡張する場合、もとの図1の非同期処理管理テーブル6に対応するクラスを作って運用している場合、当該クラスを継承して拡張クラスを拡張テーブルに割り付けるように設計することも可能となる。
【0054】
図1の非同期処理管理テーブル6は一般に業務データベース8のテーブルとして定義される。ただし、2フェーズコミットの機能など拡張トランザクションを考えられる場合はこの限りではない。図3から図11にMessage−driven Beanを使った場合の非同期処理管理テーブルの例を示す。また非同期処理管理テーブルを拡張する場合は図12のイメージで拡張する。
【0055】
図1の出力情報(OUT)7としてはクライアント側から情報を取りに行く必要のあるプル型とサーバから情報が送りつけられるプッシュ型がある。以下ではそれぞれに分けて説明する。
【0056】
プル型としては図1の 入力情報(IN)5で説明したのと同様にテーブル(データ)、実ファイル(テキスト、CSV、バイナリファイルなど)が考えられる。プッシュ型としてはプリンタ、メール、ログ、障害通知、他システム連携などが考えられる。
その他テーブルの拡張などは図1の入力情報(IN)5で説明したのと同様の方法で行うことができる。
【0057】
図1の業務データベース8は一般にトランザクション管理可能なリレーショナルデータベースで管理するが、データベースはリレーショナルデータベースに限定するわけではなく、コダシル型やオブジェクト指向データベースなどを使うことも可能である。また、トランザクションの概念を追加できるならば一般のファイルなどで管理することも可能である。ただし、トランザクションの概念が本発明では必要となるのでトランザクションの概念を利用できないものは採用できない。
【0058】
【発明の効果】
本発明によれば、投入フェーズ、処理フェーズ、確認フェーズ、取得フェーズ、再実行フェーズの内から必要なフェーズを連携させ、データベース更新に関するコミット、ロールバックと、非同期処理の要求、実行に関するコミット、ロールバックを同一管理し、非同期処理の二重実行の防止、障害が起こった場合の再実行を可能にして、非同期にアプリケーションを実行でき、前記非同期で実行されるアプリケーションの動作を保証できる効果がある。
【0059】
本発明によれば、同期、非同期のサービスを受けるクライアントサービスと、前記クライアントサービスに対するサーバ処理を受け持つ同期処理サーバサービスと、非同期処理を実行する非同期処理サーバサービスと、前記非同期処理サーバサービスの非同期処理実行について、リレーショナルデータベースと連動し、進捗や障害を管理し、非同期で実行されるアプリケーションの動作を保証する保証手段とを備えたので、非同期処理サーバサービスの非同期処理実行について、リレーショナルデータベースと連動し、進捗や障害を管理し、データベース更新に関するコミット、ロールバックと、非同期処理の要求、実行に関するコミット、ロールバックが同一管理でき、非同期処理の二重実行の防止、障害が起こった場合の再実行が可能になり、非同期にアプリケーションを実行し、前記非同期で実行されるアプリケーションの動作を保証できる効果がある。
【図面の簡単な説明】
【図1】本発明の実施の一形態のアプリケーションの処理システムを示すブロック図である。
【図2】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理動作を示すシーケンス図である。
【図3】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図4】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図5】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図6】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図7】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図8】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図9】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図10】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図11】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理管理テーブルの一例を示す説明図である。
【図12】本発明の実施の一形態のアプリケーションの処理システムにおいて非同期処理管理テーブルの拡張として入力情報のデータをデータベースで管理する場合の一例を示す説明図である。
【図13】本発明の実施の一形態のアプリケーションの処理システムの非同期処理の動作についてオンラインからの呼び出しとバッチからの呼び出しを想定した場合の構成例を示す説明図である。
【図14】本発明の実施の一形態のアプリケーションの処理システムにおける非同期処理と同期処理の比較を示すシーケンス図である。
【図15】本発明の実施の一形態のアプリケーションの処理システムにおける実行ユーザID、ステータス、エラーコード、前の非同期処理を特定するIDなどの情報を管理可能な非同期処理管理テーブルを示す説明図である。
【図16】本発明の実施の一形態のアプリケーションの処理システムにおいて、復元した非同期処理全体のツリーをもとに非同期処理に障害が発生した場合でもリトライが容易に行えることを示す説明図である。
【符号の説明】
1……クライアントサービス、2……非同期処理起動サービス(保証手段)、3……同期処理サーバサービス、4……非同期処理サーバサービス、6……非同期処理管理テーブル(保証手段)、8……業務データベース(保証手段)。
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an application processing method and system that provide a configuration that guarantees the operation of an application that is executed asynchronously.
[0002]
[Prior art]
When developing a very simple system, if the user of the system always checks the normal end of the processing executed by the user, the system can be constructed only by the synchronous processing. In such a simple system, errors are avoided by the human system and the reliability of the system is guaranteed.
In order to avoid double execution of transactions to improve the reliability of such a system, even if the transaction completion notification is lost, check whether there is a record recovered by another host. Japanese Patent Application Laid-Open No. H11-163,086 proposes a technique for preventing the double execution of a transaction and obtaining an opportunity to start an interrupted transaction to improve the reliability of the system.
[0003]
[Patent Document 1]
JP-A-11-291717
[0004]
[Problems to be solved by the invention]
However, when the operator inputs a slip and the system checks the configuration, and then prints out the slip using a printer, it is more efficient to have the operator perform the input work continuously, and for that purpose the configuration check should be performed. When a system is designed to execute as many complex processes as possible per unit time, such as when printing on a printer or a printer needs to be performed asynchronously and in parallel with the input process of the operator, it is necessary to execute the processes in parallel. However, when asynchronous processing is adopted, processing performed asynchronously may cause an error without your knowledge. For this reason, a high level of assurance is required so that asynchronous processing can automatically cope with various errors that occur without your knowledge. However, Java (registered trademark, a language developed by Sun Microsystems) requires asynchronous processing. In order to perform the processing, MDB (Message-driven Bean) can be used, but there is a problem that the operation is not guaranteed as it is.
[0005]
Specifically, the conventional technology has the following problems.
The first problem is that even if it is desired to link asynchronous processing with database update, commit, rollback and asynchronous processing request for database update, commit and rollback for execution cannot be managed in the same manner. is there. The reason is that the asynchronous process start service (queue) is not linked with the database management system or has no asynchronous process management table. Also, even if these services are provided, the asynchronous process start service (queue) and the asynchronous process management table are not managed under the same database management system as general tables.
[0006]
The second problem is that after an asynchronous process is requested, the process cannot be automatically re-executed even if the part that is being executed asynchronously ends abnormally. The reason is that since the asynchronous process start service (queue) is not linked with the database, it is not possible to determine whether the asynchronous process in which the failure has occurred is re-executed as a system.
The third problem is that if the re-execution is requested, but the preceding process has been completed normally, the same asynchronous process will be executed twice.
The reason is that the progress of execution cannot be managed because the asynchronous process management table is not prepared.
[0007]
The fourth problem is that the following information mainly at the time of failure cannot be uniformly managed.
(1) When a failure occurs, it is not possible to uniformly manage which processing has caused an error and in what state, and it is difficult to search for an asynchronous processing that has caused an error.
(2) When asynchronous processing is called in a nested manner such as parent → child → grandchild, it is not possible to chase and analyze a failure.
(3) Even if an asynchronous process causing an error can be found, a retry cannot be easily requested for the asynchronous process. The reason for this is that the asynchronous processing management table as presented in the present invention is not prepared in the first place, or even if it is present, it does not manage enough information to request the retry. .
[0008]
Therefore, an object of the present invention is to provide a processing method and system of an application that can manage commit and rollback related to database update and commit and rollback related to request and execution of asynchronous processing in the same manner.
[0009]
Another object of the present invention is to provide an application processing method and system capable of executing an application asynchronously.
[0010]
Further, according to the present invention, when asynchronous processing is erroneously performed a plurality of times, it is possible to detect that the subsequent processing is a plurality of executions, and to cancel the processing when the execution becomes a double execution. It is an object of the present invention to provide an application processing method and system.
[0011]
Further, the present invention provides an application processing method and system that centrally manages execution information, failure information, and the relationship between parent and child of asynchronous processing, and can easily retry even if a failure occurs from such information. Aim.
[0012]
[Means for Solving the Problems]
An application processing method according to the present invention is an application processing method that guarantees the operation of an application that is executed asynchronously in an asynchronous processing server service in response to a processing request from a client service. An input phase for issuing an asynchronous processing request from the client service to the synchronous processing server service, a processing phase in which the asynchronous processing requested by the asynchronous processing start service is executed by the asynchronous processing server service, A confirmation phase for confirming the execution of the asynchronous processing including the progress and success or failure of the asynchronous processing via the synchronous processing server service, an acquisition phase for capturing information after confirming the end of the processing in the confirmation phase, Previous Asynchronous processing or by linking the necessary phases from among redo phase for abnormal termination after the re-execution, characterized in that it guarantees the operation of the application to be executed asynchronously.
[0013]
The application processing method according to the present invention relates to a required phase among an input phase, a processing phase, a confirmation phase, an acquisition phase, and a re-execution phase, and commits and rolls back a database update, and requests and executes an asynchronous process. The same management of commit and rollback prevents double execution of asynchronous processing, enables re-execution when a failure occurs, executes an application asynchronously, and operates the application executed asynchronously Guarantee.
[0014]
An application processing system according to the present invention includes a client service that receives synchronous and asynchronous services, a synchronous processing server service that performs server processing for the client service, an asynchronous processing server service that executes asynchronous processing, and the asynchronous processing server. Aspects of the asynchronous processing of the service are provided, which are linked with a relational database, manage progress and failures, and assure means for guaranteeing the operation of the application executed asynchronously.
[0015]
The application processing system of the present invention, in conjunction with a relational database, manages progress and failures for asynchronous processing execution of an asynchronous processing server service, commits and rolls back database updates, and commits and executes asynchronous processing requests and executions. Rollback is managed in the same way, double execution of asynchronous processing can be prevented, re-execution in the event of a failure is enabled, applications are executed asynchronously, and operations of the applications executed asynchronously are guaranteed.
[0016]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of the present invention will be described.
FIG. 1 is a block diagram showing an application processing system according to this embodiment. FIG. 2 is a sequence diagram showing an asynchronous processing operation in the application processing system of this embodiment. A system to which the application processing method according to the present embodiment is applied is configured by each service shown in FIG. 1, and is executed according to the sequence shown in FIG.
The processing system of this application is characterized in that an asynchronous processing start service (queue) indicated by reference numeral 2 in FIG. 1 and FIG. 2 and an asynchronous processing management table indicated by reference numeral 6 are linked with a relational database to manage progress and failures. There is.
Then, the following two functions are provided to execute the asynchronous processing exactly once. The first function is that the input asynchronous processing is called at least once even if a failure occurs. This first function is mainly realized by an asynchronous processing start service (queue) indicated by reference numeral 2 in FIGS. In the second function, if the input asynchronous processing is executed a plurality of times, it is detected that the input asynchronous processing has already been executed, and the subsequent processing is stopped so as not to be executed twice. This second function is mainly realized by the asynchronous processing management table indicated by reference numeral 6 in FIGS. By combining the first function and the second function, it is possible to reliably execute the input asynchronous processing once even in a situation where recovery cannot be generally performed, such as a hardware failure.
Further, the information held in the asynchronous processing management table denoted by reference numeral 6 in FIGS. 1 and 2 realizes a third function that can unifyly manage which processing has failed in which state when a failure has occurred. In addition, even when asynchronous processing is called in a nested manner such as parent → child → grandchild, it is possible to realize a fourth function capable of chasing and analyzing a failure and to search for an asynchronous processing in which an error has occurred. is there. Further, a fifth function capable of requesting a retry for the retrieved asynchronous process that has become an error is realized.
In this way, it is possible to highly guarantee the operation of the application executed asynchronously.
[0017]
In this embodiment, the synchronous processing refers to a processing method in which the calling side waits for the return of the called side processing and continues the processing as shown in the left sequence of FIG. I do. The synchronous processing has a disadvantage that the response to the user is poor and thus hinders the work, but has a merit that the user can confirm the end result of the transaction or the like.
Asynchronous processing refers to processing in which the calling side and the called side operate simultaneously in parallel without the calling side waiting for the called side processing as shown in the right sequence of FIG. It refers to the method. In this asynchronous processing, a screen for confirming the printing status of the printer later or calling a screen for confirming a list of the work so far in subsequent processing is called out. ), Etc., there is a disadvantage that it is necessary to confirm the execution result of the part processed asynchronously later, but there is a merit that a large number of inputs can be performed per unit time because the processing returns quickly.
[0018]
First, each service shown in FIG. 1 that constitutes the application processing system according to this embodiment will be described.
The client service (eg, browser) 1 indicates a client that receives a synchronous or asynchronous service. Examples include browsers and client applications operated by end users. It is assumed that it is mainly used as an online system, but in some cases, batch-based processing may be used as a client service to use synchronous processing or asynchronous processing.
[0019]
Asynchronous processing start service (eg, Java JMS queue, Job management service, UNIX (registered trademark, OS for time-sharing system developed by AT & T), Clone, Windows (registered trademark, OS developed by Microsoft) At command) 2, synchronous processing is actually executed by a request from the user, but in the case of asynchronous processing, only the request is registered from the user, and another service is required to execute the request. Required. An asynchronous process activation service corresponds to this other service. The asynchronous process start service realizes this function. For example, Java JMS (Java Messaging Service), a commercially available Job management tool, UNIX cron, Windows at command, and the like can be the asynchronous process activation service.
[0020]
The synchronous processing server service (eg, Web application server) 3 is a service that handles server processing for a client service. The process between these is a synchronous process. When an asynchronous process is input from the client service, the synchronous process server service is first accessed, and the asynchronous process is requested via the synchronous process server service. For example, ORBs (Object Bank Requests such as Web Application Servers, TP Monitors (Transaction Monitors), Microsoft COM +, CORBA (Common Object Request Broker Architecture), and RMI (Remote Method Invocation).
[0021]
Asynchronous processing server service (eg, Java Message-driven Bean, batch processing such as shell and command) 4 refers to a service that actually executes asynchronous processing. For example, Java MDB (Message-driven Bean) or a service that performs batch processing such as shells and commands corresponds to this.
.
[0022]
The input information (IN) 5 is input information for asynchronous processing of a table (data) and a real file (text, CSV, binary file, etc.). Simple parameters can be managed in the asynchronous process management table. However, when using huge data stored in the database table or when handling text files, CSV (Comma Separated Values) files, and binary files, outside the asynchronous process management table Will be managed. However, in this embodiment, since all information is managed in the database, information held as various files is also stored and managed in the database.
[0023]
FIG. 12 shows an example in which the data of the input information 5 is managed in a database as an extension of the asynchronous processing management table.
The asynchronous process management table 6 is a table for managing information that forms the core of this embodiment. FIGS. 3, 4, 5, 6, 7, 8, 9, 10 and 11 show samples in the case where components are formed by MDB (Message-driven Bean). In this sample, detailed information is managed by a plurality of tables, and is specified in FIGS.
[0024]
The output information (OUT) 7 is divided into a pull type and a push type. A table (data) and a real file (text, CSV, binary file, etc.) are assumed as the pull type, and a printer, mail, log, It assumes failure notification and other system cooperation. The output information (OUT) 7 is output information from the asynchronous processing. Simple parameters, error codes, and error messages are managed in the asynchronous processing management table, but they are necessary when that is insufficient. As described above, it is largely divided into a pull type and a push type.
The pull type is intended for a case where information stored in a table, a file of text, CSV, binary, or the like, which is stored in a database, is taken by a user's action.
On the other hand, the push type is a case where the system automatically sends the information to the user, and includes output to a printer, transfer to an e-mail, log and failure notification, and cooperation with another system. FIG. 12 shows an example in which these data are managed in a database as an extension of the asynchronous processing management table.
[0025]
In the present embodiment, the business database 8 needs to cooperate with the business database and the information on the asynchronous processing. Therefore, the business database 8 is placed under the same database management system.
[0026]
Next, the asynchronous processing phase will be described.
FIG. 2 is a sequence diagram showing the processing content of each phase. As shown in FIG. 2, it can be classified into an input phase, a processing phase, a confirmation phase, an acquisition phase (pull type), and a re-execution phase (push type). The phases work together to assure a high degree of asynchronous application behavior.
The input phase refers to a phase in which the user issues a processing request for asynchronous processing. From the sequence shown in FIG. 2, it can be seen that this input phase operates only by the synchronous processing. Generally, the input to the asynchronous process is a very light process, and when the input is completed, the user can input another asynchronous process regardless of execution of the next processing phase.
[0027]
The processing phase is a part where the asynchronous processing server service 4 actually executes the contents of the asynchronous processing. Only this processing phase is executed from the asynchronous processing start service 4. It is mainly used in check-related work and print work that require a long processing time.
[0028]
The confirmation phase is a phase in which the user confirms the progress, success, or failure of the asynchronous processing. If the processing is being executed (if not completed), it is necessary to repeatedly execute this confirmation phase.
[0029]
In the acquisition phase (pull type), in the case of asynchronous processing having pull-type information, the user needs to capture the information in the acquisition phase after confirming the end of the processing in the confirmation phase.
[0030]
In the re-execution phase (push type), this re-execution phase is performed when asynchronous processing having push-type information or when it is desired to request re-execution due to abnormal termination even in the pull type.
[0031]
Next, the overall operation of this embodiment will be described in detail with reference to the sequence diagram shown in FIG.
First, the details of each phase are described in "Description of Asynchronous Processing Phases", and then, how the individual phases described earlier are linked in "Description of Cooperation of Asynchronous Processing Phases" .
"Description of each asynchronous processing phase"
Hereinafter, description will be given for each of the classified processing phases.
"Input phase"
In step S11 (input), "a request for asynchronous processing" is issued from the client service 1 to the synchronous processing server service 3 as general synchronous processing. In step S12 (parameter, file), the synchronous processing server service 3 registers input information for asynchronous processing such as parameters and files. In step S13 (register a request for asynchronous processing), the synchronous processing server service 3 registers the “request for asynchronous processing” in the asynchronous processing management table 6. In step S14 (notification of registration completion), the user (client service 1) receives a return indicating that the registration processing has been completed from the synchronous processing server service 3. It should be noted that at this point it is only known that only the registration of the asynchronous process has been completed normally. It is necessary to check whether the asynchronous processing itself has been completed normally in a “confirmation phase” described later.
[0032]
"Processing phase"
In step S21 (asynchronous processing request), the asynchronous processing is executed by the "asynchronous processing start service 2". In step S22 (search for a request), the asynchronous processing server service 4 checks the contents of the request with respect to the “asynchronous processing management table 6”. Also, in step S23 (see input contents), the asynchronous processing server service 4 checks the asynchronous processing management table 6 for input information necessary for executing the asynchronous processing. In step S24 (search processing and update processing), the processing is referred to and updated using the "business database 8". In step S25 (save output result), the result of the asynchronous process is saved as output information 7. In step S26 (updating the progress of the request), the progress is stored in the "asynchronous process management table 6" since the asynchronous process has been completed. In step S27 (return asynchronous process end), the asynchronous process ends, and the asynchronous process end is returned to the asynchronous process activation service 2.
[0033]
"Confirmation phase"
In step S31 (request for confirmation screen), the user requests confirmation of asynchronous processing. In step S32 (confirm the progress), the progress is confirmed in the "asynchronous process management table 6". In step S33 (progress and results are listed), the progress is returned. During execution, normal termination, error, etc. are returned.
[0034]
"Acquisition phase (pull type)"
In step S41 (select one from the list display screen), a request is made to obtain necessary information from the information obtained in the “confirmation phase”. In step S42 (obtain the result of the process), the result of the asynchronous process is obtained from “output information 7”. In step S43 (acquisition of data to be used as a result of the processing), if there is necessary information other than “output information 7”, it is acquired from “business database 8”. In step S44 (return of result), the result is returned to the user (client service 1).
[0035]
"Re-execution phase (push type)"
In step S51 (select one from the list display screen), information that needs to be re-executed is selected from the information acquired in the “confirmation phase”. In step S52 (change the status of the asynchronous process management table to re-execution), the status of the “asynchronous process management table 6” is changed to re-execution. In step S53 (notification of re-execution), the fact that re-execution was requested is returned to the user (client service 1).
Asynchronous processing is executed by coordinating the processing for each of the asynchronous processing phases as described below in “Description of Cooperation of Asynchronous Processing Phase”.
[0036]
"Explanation about cooperation of asynchronous processing phase"
Hereinafter, how each function described in the configuration of the above-described embodiment and each asynchronous processing phase described in the above “Description of each asynchronous processing phase” cooperate to form an entire asynchronous process is divided into patterns. explain.
[0037]
In the case of the pull type described in the output information (OUT) 7 of FIG. 2, the phases cooperate, for example, as follows.
For example, when processing that requires a long time is input asynchronously, “input phase” → “processing phase” → “confirmation phase” → “acquisition phase”.
[0038]
In the case of the push type described in “Output information (OUT) 7” in FIG. 2, the phases cooperate, for example, as follows.
For example, when a process that can be separately confirmed, such as printing or an e-mail addressed to the user, is requested, the “input phase” → the “processing phase”.
Or, when confirmation such as mailing to another person or coordination processing to another system is required, "input phase" → "processing phase" → "confirmation phase".
Or, for example, when the failure of asynchronous processing is confirmed and retry is performed, or when a paper jam occurs in printing or the like and reprinting is performed, “input phase” → “processing phase” → “confirmation phase” → "Rerun phase".
[0039]
Next, a case where the asynchronous process is called from the online process and a case where the asynchronous process is called from the batch process will be described.
The operation of the asynchronous processing described above can be called from either online processing or batch processing. FIG. 13 is an explanatory diagram showing a configuration example in a case where a call from online and a call from batch are actually assumed for the operation of asynchronous processing. In the example of FIG. 13, asynchronous processing is implemented by MDB (Message-driven Bean), but the following three types of calls are provided as examples.
[0040]
"(A) Call local asynchronous processing"
When the client service 1 and the synchronous processing server service 3 of FIG. 1 constitute online processing, and the synchronous processing server service 3 and the asynchronous processing server service 4 of FIG. 1 are implemented in the same environment. .
[0041]
"(B) Invoking remote asynchronous processing"
A case where the client service 1 and the synchronous processing server service 3 of FIG. 1 constitute online processing, and a case where the synchronous processing server service 3 and the asynchronous processing server service 4 of FIG. 1 are implemented in different environments.
[0042]
"(C) Call asynchronous processing from batch processing"
A case where the client service 1 and the synchronous processing server service 3 of FIG. 1 constitute online processing. In FIG. 13, when the asynchronous process is called from the batch process, only the remote call is described, but a local call is also possible depending on how the environment is created.
[0043]
As described above, according to this embodiment, the first effect is that the general table and the asynchronous process start service (queue) 2 and the asynchronous process management table 6 are installed under the common database management system. That is, a transaction of a business application using a component using the present invention and a transaction of asynchronous processing using the present invention can be commonly managed as commit and rollback timings as the same transaction.
[0044]
The second effect is that, by writing the asynchronous processing start service (queue) 2 to the database, even after a failure on the system including a hardware failure occurs, the asynchronous processing which is automatically in the unprocessed state after the recovery from the failure. Can be re-executed, and the number of re-executions can be specified as the number of retries in the asynchronous process management table 6, and the application can be executed asynchronously at least once.
[0045]
The third effect is that progress is managed in the asynchronous process management table 6, and by checking the status of the asynchronous process management table 6, whether the process is in a valid execution state or in an abnormal matter state is checked. Since the confirmation can be performed, if the asynchronous processing is executed a plurality of times by mistake, it can be detected that the subsequent processing is a plurality of executions, and if the asynchronous processing is executed twice, the processing can be canceled.
(* Even if the second effect and the third effect are combined and a situation such as a hardware failure seems to be generally unrecoverable, "at least once (second effect)" and "only once ( Third effect) "allows execution of asynchronous processing)
[0046]
A fourth effect is that information such as an execution user ID, a start time, an end time, a status, an error code, and an error message can be managed in the asynchronous process management table. As shown in FIG. Since the specified ID is held, the tree of the entire asynchronous process can be restored by tracing the ID, and all the information necessary for the retry can be extracted by using the asynchronous process management table 6 and its accompanying table. Since it is designed, the execution information, the failure information, and the relationship between the parent and child of the asynchronous processing are unitarily managed, and even if a failure occurs in the asynchronous processing as shown in FIG. 16, the retry can be easily performed.
[0047]
Next, another embodiment of the present invention will be described.
In the above description, the implementation in Java is assumed and the description is made using the image of Java, but the present invention is not limited to Java but can be used as a general service.
[0048]
The asynchronous process start service 2 and the asynchronous process server service 4 in FIG. 1 can be distributed to a plurality of servers to take a load distribution or a distribution configuration (failover) at the time of failure. For example, the asynchronous processing management tables (in the case of Message-driven Bean) shown in FIGS. 3 to 11 are created so as to correspond to the multiple server configuration.
[0049]
It is possible to build a system assuming a browser or a general application as the client service 1 of FIG.
[0050]
As the asynchronous processing start service 2 in FIG. 1, a Java JMS queue (Java Messaging Service Queue), a job management service released as a general product, a UNIX coulomb, an at command of Windows NT or Windows 2000 can be used. . However, it is necessary to construct these queues so as to link with the database. (If there is no other way, it is necessary to make it to look at the database at regular intervals)
[0051]
It is possible to employ a Web application server, a TP monitor (transaction monitor), or the like as the synchronous processing server service 3 in FIG. When a distributed object is used, an EJB container (Enterprise Java Beans container), a CORBA object, and MICROSOFT COM + can be used.
[0052]
As the asynchronous processing server service 4 in FIG. 1, a Java Message-driven Bean, a UNIX shell or command, a Windows batch file, or the like can be used.
[0053]
The input information (IN) 5 in FIG. 1 is directly managed in the asynchronous processing management table 6 in FIG. 1 like the business parameter in FIG. 5, and is also managed as a table (data) in the business database 8 or a real file (text, (CSV, binary file, etc.). If the asynchronous process management table 6 in FIG. 1 has a structure like the business parameters in FIG. 5, the table can be extended as shown in the extension of the asynchronous process management table in FIG. (The table is extended by setting the unique key of the table to be extended in the business parameter in FIG. 6.) When extending the table, a class corresponding to the original asynchronous processing management table 6 in FIG. 1 is created and operated. In this case, it is possible to design so that the extended class is assigned to the extended table by inheriting the class.
[0054]
The asynchronous processing management table 6 in FIG. 1 is generally defined as a table in the business database 8. However, this does not apply when an extended transaction such as a two-phase commit function can be considered. FIGS. 3 to 11 show examples of the asynchronous processing management table in the case where the Message-driven Bean is used. When the asynchronous process management table is extended, it is extended with the image of FIG.
[0055]
The output information (OUT) 7 in FIG. 1 includes a pull type in which information needs to be obtained from the client side and a push type in which information is sent from the server. In the following, each of them will be described separately.
[0056]
As the pull type, a table (data) and a real file (text, CSV, binary file, etc.) can be considered as described in the input information (IN) 5 of FIG. As the push type, printer, mail, log, failure notification, cooperation with other systems, and the like can be considered.
In addition, expansion of the table and the like can be performed in the same manner as described in the input information (IN) 5 in FIG.
[0057]
Although the business database 8 of FIG. 1 is generally managed by a relational database capable of transaction management, the database is not limited to a relational database, and a Kodasil type or an object-oriented database may be used. If the concept of a transaction can be added, it can be managed by a general file or the like. However, since the concept of a transaction is required in the present invention, a technology that cannot use the concept of a transaction cannot be adopted.
[0058]
【The invention's effect】
According to the present invention, a necessary phase is coordinated among an input phase, a processing phase, a confirmation phase, an acquisition phase, and a re-execution phase, and commit and rollback regarding database update, request for asynchronous processing, commit and roll regarding execution are performed. The same back is managed, preventing double execution of asynchronous processing, enabling re-execution in the event of a failure, enabling the application to be executed asynchronously, and has the effect of guaranteeing the operation of the application executed asynchronously. .
[0059]
According to the present invention, a client service that receives synchronous and asynchronous services, a synchronous processing server service that performs server processing for the client service, an asynchronous processing server service that executes asynchronous processing, and an asynchronous processing of the asynchronous processing server service As for execution, it is linked with the relational database, it manages progress and failures, and it has guarantee means to guarantee the operation of the application that is executed asynchronously. Commit and rollback for database updates and asynchronous processing requests, execution commits and rollbacks can be managed in the same way, preventing double execution of asynchronous processing and re-executing when a failure occurs Is possible Ri, execute an application asynchronously, there is an effect that can guarantee the operation of the application executed by the asynchronous.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an application processing system according to an embodiment of the present invention.
FIG. 2 is a sequence diagram illustrating an asynchronous processing operation in the application processing system according to the embodiment of this invention;
FIG. 3 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 4 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 5 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 6 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 7 is an explanatory diagram illustrating an example of an asynchronous process management table in the application processing system according to the embodiment of this invention;
FIG. 8 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 9 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 10 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 11 is an explanatory diagram illustrating an example of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 12 is an explanatory diagram showing an example of a case where data of input information is managed in a database as an extension of an asynchronous processing management table in the application processing system according to the embodiment of this invention;
FIG. 13 is an explanatory diagram showing a configuration example of an asynchronous processing operation of the application processing system according to the embodiment of the present invention in a case where a call from online and a call from batch are assumed;
FIG. 14 is a sequence diagram illustrating a comparison between asynchronous processing and synchronous processing in the application processing system according to the embodiment of this invention;
FIG. 15 is an explanatory diagram showing an asynchronous process management table capable of managing information such as an execution user ID, a status, an error code, and an ID for identifying a previous asynchronous process in the application processing system according to the embodiment of this invention; is there.
FIG. 16 is an explanatory diagram showing that in an application processing system according to an embodiment of the present invention, retry can be easily performed even when a failure occurs in asynchronous processing based on a tree of the entire restored asynchronous processing. .
[Explanation of symbols]
1 ... Client service, 2 ... Asynchronous processing start service (guaranteing means), 3 ... Synchronous processing server service, 4 ... Asynchronous processing server service, 6 ... Asynchronous processing management table (guaranteing means), 8 ... Business Database (guarantee means).

Claims (6)

クライアントサービスからの処理依頼に対し、非同期処理サーバサービスにおいて非同期で実行されるアプリケーションの動作を保証するアプリケーションの処理方法であって、
同期処理のみで動作し、前記クライアントサービスから同期処理サーバサービスへ非同期処理の処理依頼を出すための投入フェーズ、非同期処理起動サービスから非同期処理依頼された非同期処理が、前記非同期処理サーバサービスにより実行される処理フェーズ、前記クライアントサービスにより前記同期処理サーバサービスを介して非同期処理の進捗や成功、失敗を含む前記非同期処理の実行について確認する確認フェーズ、前記確認フェーズで処理の終了を確認した後、情報を取り込むための取得フェーズ、前記非同期処理や異常終了後の再実行のための再実行フェーズの内から必要なフェーズを連携させ、非同期で実行されるアプリケーションの動作を保証するアプリケーションの処理方法。
An application processing method for guaranteeing the operation of an application executed asynchronously in an asynchronous processing server service in response to a processing request from a client service,
Operate only by synchronous processing, the input phase for issuing an asynchronous processing request from the client service to the synchronous processing server service, the asynchronous processing requested by the asynchronous processing start service asynchronous processing is executed by the asynchronous processing server service A confirmation phase for confirming the execution of the asynchronous processing including the progress, success, and failure of the asynchronous processing via the synchronous processing server service by the client service. A method of processing an application that guarantees the operation of an application that is executed asynchronously by linking a necessary phase among an acquisition phase for capturing a program, a re-execution phase for re-execution after an abnormal termination, and an asynchronous process.
前記投入フェーズは、同期処理として前記クライアントサービスから前記同期処理サーバサービスへ非同期処理への依頼をかける投入ステップと、前記同期処理サーバサービスがパラメータやファイルなどの非同期処理への入力情報を登録する入力情報登録ステップと、前記同期処理サーバサービスが前記非同期処理への依頼を非同期処理管理テーブルに登録する非同期処理登録ステップと、登録処理が終了した旨のリターンを前記クライアントサービスが前記同期処理サーバサービスから受け取る登録完了通知ステップとを有し、前記処理フェーズは、前記非同期処理起動サービスから処理依頼された非同期処理が前記非同期処理起動サービスによって実行される非同期処理依頼ステップと、前記非同期処理サーバサービスが前記非同期処理管理テーブルに対して依頼内容を確認しにいく依頼検索ステップと、前記非同期処理サーバサービスが前記非同期処理管理テーブルに対し前記非同期処理を実行する場合に必要な入力情報を確認しにいく入力内容参照ステップと、業務データベースを使って参照、更新が行われる検索更新ステップと、前記非同期処理の結果を出力情報として保存する保存ステップと、前記非同期処理の進捗状況を前記非同期処理管理テーブルに保存する進捗状況更新ステップと、前記非同期処理を終了し、非同期処理終了を前記非同期処理起動サービスへ返す非同期処理終了ステップとを備えていることを特徴とする請求項1記載のアプリケーションの処理方法。The input phase includes an input step of requesting the synchronous processing server service to perform the asynchronous processing from the client service as a synchronous processing, and an input in which the synchronous processing server service registers input information to the asynchronous processing such as parameters and files. An information registration step, an asynchronous processing registration step in which the synchronous processing server service registers a request for the asynchronous processing in an asynchronous processing management table, and a return indicating that the registration processing has been completed is returned from the synchronous processing server service by the client service. Receiving the registration completion notification step, wherein the processing phase includes an asynchronous processing requesting step in which the asynchronous processing requested by the asynchronous processing starting service is executed by the asynchronous processing starting service; and Asynchronous processing A request search step for checking the request content for the management table, and an input content reference for checking input information required when the asynchronous processing server service executes the asynchronous process on the asynchronous process management table Step, a search / update step in which reference and update are performed using a business database, a save step of saving the result of the asynchronous process as output information, and a progress of saving the progress of the asynchronous process in the asynchronous process management table 2. The application processing method according to claim 1, further comprising: a status update step; and an asynchronous process end step of terminating the asynchronous process and returning an asynchronous process end to the asynchronous process start service. 非同期で実行されるアプリケーションの動作を保証する構成を提供するアプリケーションの処理システムであって、
同期、非同期のサービスを受けるクライアントサービスと、
前記クライアントサービスに対するサーバ処理を受け持つ同期処理サーバサービスと、
非同期処理を実行する非同期処理サーバサービスと、
前記非同期処理サーバサービスの非同期処理実行について、リレーショナルデータベースと連動し、進捗や障害を管理し、非同期で実行されるアプリケーションの動作を保証する保証手段と、
を備えたことを特徴とするアプリケーションの処理システム。
An application processing system that provides a configuration that guarantees the operation of an application executed asynchronously,
Client services that receive synchronous and asynchronous services,
A synchronous processing server service responsible for server processing for the client service;
An asynchronous processing server service that executes asynchronous processing,
Assurance means for performing asynchronous processing execution of the asynchronous processing server service in cooperation with a relational database, managing progress and failure, and guaranteeing operation of an application executed asynchronously;
An application processing system comprising:
前記保証手段は、リレーショナルデータベースと連動し、非同期処理の場合のユーザからの要求に実行をかけるための非同期処理起動サービスと非同期処理管理テーブルとを備えていることを特徴とする請求項3記載のアプリケーションの処理システム。4. The assurance means according to claim 3, wherein the assurance means is provided with an asynchronous processing start service and an asynchronous processing management table for executing a request from a user in the case of asynchronous processing in cooperation with a relational database. Application processing system. 前記保証手段は、非同期処理関係の情報と連携する、同一のデータベース管理システム下に置かれた業務データベースを備えていることを特徴とする請求項4記載のアプリケーションの処理システム。5. The application processing system according to claim 4, wherein said assurance means includes a business database placed under the same database management system in cooperation with information related to asynchronous processing. 前記保証手段は、投入された非同期処理が少なくとも1回は呼び出される、非同期処理起動サービスによって実現される第1の機能と、投入された非同期処理が二重実行されないように後続の処理を中止する、非同期処理管理テーブルをもとに実現される第2の機能と、前記非同期処理管理テーブルが持つ情報をもとに、障害が発生した場合の統一的管理を実現する第3の機能と、非同期処理が入れ子で呼び出された場合、障害を辿って分析できる第4の機能と、検索されたエラーとなった非同期処理に対してリトライを要求できる第5の機能を実現することを特徴とする請求項4または5記載のアプリケーションの処理システム。The assurance means cancels a first function realized by an asynchronous process start service in which the input asynchronous process is called at least once and a subsequent process so that the input asynchronous process is not double-executed. A second function implemented based on the asynchronous process management table, a third function implemented based on information held in the asynchronous process management table, and a third function implemented unified management in the event of a failure. When the process is called in a nested manner, a fourth function capable of analyzing the failure by tracing the failure and a fifth function capable of requesting a retry for the asynchronous process that has been found as an error are realized. Item 6. The application processing system according to item 4 or 5.
JP2002322916A 2002-11-06 2002-11-06 Processing method for application and system Pending JP2004157776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002322916A JP2004157776A (en) 2002-11-06 2002-11-06 Processing method for application and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002322916A JP2004157776A (en) 2002-11-06 2002-11-06 Processing method for application and system

Publications (1)

Publication Number Publication Date
JP2004157776A true JP2004157776A (en) 2004-06-03

Family

ID=32802970

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002322916A Pending JP2004157776A (en) 2002-11-06 2002-11-06 Processing method for application and system

Country Status (1)

Country Link
JP (1) JP2004157776A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007226584A (en) * 2006-02-24 2007-09-06 Hitachi Ltd Transaction system
JP2010532052A (en) * 2007-06-27 2010-09-30 マイクロソフト コーポレーション Dealing with incorrect parent transaction failures
US9411635B2 (en) 2007-09-18 2016-08-09 Microsoft Technology Licensing, Llc Parallel nested transactions in transactional memory

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007226584A (en) * 2006-02-24 2007-09-06 Hitachi Ltd Transaction system
JP2010532052A (en) * 2007-06-27 2010-09-30 マイクロソフト コーポレーション Dealing with incorrect parent transaction failures
US9411635B2 (en) 2007-09-18 2016-08-09 Microsoft Technology Licensing, Llc Parallel nested transactions in transactional memory

Similar Documents

Publication Publication Date Title
US5923833A (en) Restart and recovery of OMG-compliant transaction systems
US10942823B2 (en) Transaction processing system, recovery subsystem and method for operating a recovery subsystem
US6980988B1 (en) Method of applying changes to a standby database system
US7493527B2 (en) Method for logging diagnostic information
US8473783B2 (en) Fault tolerance in distributed systems
US8689179B2 (en) Transportable refactoring object
US7992148B2 (en) Issuing syncpoints during execution of a batch application to minimize or eliminate periods of record unavailability due to batch related record locking
US8504873B1 (en) Method and apparatus for providing in-memory checkpoint services within a distributed transaction
US7899897B2 (en) System and program for dual agent processes and dual active server processes
US20070285993A1 (en) Systems and methods for common instance handling of providers in a plurality of frameworks
US20060129660A1 (en) Method and computer system for queue processing
CN114253673A (en) Transaction processing method and transaction processing device of distributed system
WO2007030805A1 (en) Transaction consistency and problematic states
Barga et al. Recovery guarantees for general multi-tier applications
US7284018B1 (en) Logless transaction coordination
WO2004025461A2 (en) A data processing system adapted to integrating non-homogeneous processes
KR100744738B1 (en) Link processing apparatus and method for processing link
Barga et al. Persistent applications via automatic recovery
JP2004157776A (en) Processing method for application and system
US7650606B2 (en) System recovery
US20060036713A1 (en) Method, system and program product for configuring an event management system
GB2335516A (en) Failure recovery in distributed transaction avoids heuristic damage
Kistijantoro et al. Enhancing an application server to support available components
Zhou et al. A system for managing remote procedure call transactions
Albassam et al. Variable recovery and adaptation connectors for dynamic software product lines

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040427

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061020

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061218

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070116