JPH06282481A - サーバ・メモリの管理 - Google Patents

サーバ・メモリの管理

Info

Publication number
JPH06282481A
JPH06282481A JP5162257A JP16225793A JPH06282481A JP H06282481 A JPH06282481 A JP H06282481A JP 5162257 A JP5162257 A JP 5162257A JP 16225793 A JP16225793 A JP 16225793A JP H06282481 A JPH06282481 A JP H06282481A
Authority
JP
Japan
Prior art keywords
data
buffer
computer
data structure
communication buffer
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
JP5162257A
Other languages
English (en)
Inventor
Ii Lloyd E Jordan
リロイド・ユージーン・ジョーダン、セカンド
Shaw-Ben Shi
シャウ−ベン・シー
J Sirkin Martin
マーティン・ジェイ・サーキン
Paul E Stephens
ポール・エドウィン・ステファンス
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.)
International Business Machines Corp
Original Assignee
International Business Machines 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 International Business Machines Corp filed Critical International Business Machines Corp
Publication of JPH06282481A publication Critical patent/JPH06282481A/ja
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99941Database schema or data structure
    • Y10S707/99942Manipulating data structure, e.g. compression, compaction, compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99951File or database maintenance
    • Y10S707/99952Coherency, e.g. same view to multiple users
    • Y10S707/99953Recoverability

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

(57)【要約】 【目的】 改良されたデータベース・サーバを提供す
る。 【構成】 第2のコンピュータ上のデータベースから情
報をアクセスする時、第1のコンピュータ上のデータベ
ースからメモリ要求データ構造を獲得し、このデータベ
ースからのメモリ要求データ構造と情報を含む通信バッ
ファ230を構成することにより、第1のコンピュータ
上のメモリ内にデータ構造214を構成する。通信バッ
ファ230はその後、第2のコンピュータに伝送され
る。第2のコンピュータは第2のコンピュータ上に通信
バッファ230を受信し、通信バッファ230内の情報
にもとづき、データ構造214に対応するメモリ要求を
決定する。最後に、第2のコンピュータ内の通信バッフ
ァ230内に既に割当てられたメモリを使用することに
より、第2のコンピュータ上のメモリ要求データ構造に
もとづきデータ構造214が形成される。

Description

【発明の詳細な説明】
【0001】
【産業上の利用分野】本発明は、一般にデータベース処
理の改良に関し、特にデータベースの遠隔アクセスに関
する。
【0002】
【従来の技術】データベースの遠隔アクセスのシステム
管理は、多数の記事及び特許におけるテーマである。例
えば米国特許第5014221号はクライアントのアク
セスを仲裁する機能を有するプリント・サーバを開示す
る。米国特許第4511964号はメモリの動的構造の
割当て、拡張及び割当て解除を達成するメモリ制御装置
における動的メモリ・マッピングを開示する。米国特許
第5025491号は関連するサーバ・ステーションを
有し、サーバ・アドレスがコンピュータ・アルゴリズム
により解析される通信ネットワークを開示する。しかし
ながら、参照される従来技術のいずれもが、本発明によ
る改良されたデータベース・サーバを開示していない。
【0003】
【発明が解決しようとする課題】従って、本発明の目的
は改良されたデータベース・サーバを提供する。
【0004】本発明の目的が、データ構造の再構成処理
におけるメモリ割当て及びメモリ複写を改良するプロセ
ッサ・メモリの処理オペレーションにより達成される。
【0005】
【課題を解決するための手段】第2のコンピュータ上の
データベースから情報をアクセスする時、第1のコンピ
ュータ上のデータベースからメモリ要求データ構造を獲
得し、このデータベースからのメモリ要求データ構造と
情報を含む通信バッファを構成することにより、第1の
コンピュータ上のメモリ内にデータ構造を構成する。通
信バッファはその後、第2のコンピュータに伝送され
る。第2のコンピュータは第2のコンピュータ上に通信
バッファを受信し、通信バッファ内の情報にもとづき、
データ構造に対応するメモリ要求を決定する。最後に、
第2のコンピュータ内の通信バッファ内に既に割当てら
れたメモリを使用することにより、第2のコンピュータ
上のメモリ要求データ構造にもとづきデータ構造が形成
される。
【0006】
【実施例】本発明は好適にはIBM社より販売されるI
BM PS/2コンピュータに常駐するオペレーティン
グ・システムにおいて実施される。代表的なハードウェ
ア環境を図1に示す。これは本発明によるワークステー
ションの典型的なハードウェア構成を表しており、従来
のマイクロプロセッサなどによる中央処理ユニット10
を有し、他の多数のユニットがシステム・バス12を介
して相互に接続される。図1に示されるワークステーシ
ョンはランダム・アクセス・メモリ(RAM)14、読
出し専用メモリ(ROM)16、ディスク・ユニット2
0などの周辺装置をバスに接続するためのI/Oアダプ
タ18、キーボード24を接続するためのユーザ・イン
タフェース・アダプタ22、マウス26、スピーカ2
8、マイクロフォン32、及びタッチ画面装置など(図
示せず)の他のユーザ・インタフェース装置、ワークス
テーションをデータ処理ネットワークに接続するための
通信アダプタ34、及びバスを表示装置38に接続する
表示アダプタ36を含む。ワークステーションはそれ上
にAIXオペレーティング・システムと本発明を構成す
るコンピュータ・ソフトウェアを有する。後者はツール
キットとして組込まれる。
【0007】リレーショナル・データベースへの遠隔ア
クセスを提供するための専用のプロトコルが、IBMに
よるOS/2 1.3拡張版(EE:Extended Editio
n)オペレーティング・システムにおいて実施された。
このプロトコルはIBM発行の"Distributed Relationa
l Database Architecture Reference"、August 1990、I
BM、SC26-4651、及び"Distributed Data Management(D
DM)ArchitectureReference"、August 1990、IBM、SC21
-9526 に述べられている。性能テストの結果、データベ
ースのデータ構造の再構成処理におけるメモリ割当て及
びメモリ複写の問題が明らかとなった。
【0008】本発明は遠隔プロトコルにおけるサーバ・
メモリ割当ての効率的設計を含む。このプロトコルはO
S/2拡張サービス(ES:Extended Service)1.0
遠隔データベース・サービス用に設計される。このシス
テムはデータ構造を再構成するための余分な記憶域を割
当てることなく通信バッファを使用する。従って、サー
バに対するメモリ要求を減らし、メモリ複写のコストを
低減する。
【0009】OS/2 1.3拡張版と比較して、本遠
隔プロトコルはスループットで56%のスピードアップ
を、またエンド・ユーザ応答時間で36%のスピードア
ップを達成する。SQLJRA遠隔プロトコルは、クラ
イアント或いはサーバ上に同質環境で形成されるデータ
構造を支援する。すなわち、これらのデータ構造が類似
に構成される。従って、データ構造は変換ステップを必
要とすることなく直接的に転送される。
【0010】クライアント側では、データ・ストリーム
構成器がデータ構造からデータ・ストリームを形成す
る。データ構造がポインタを含む場合、それらのポイン
タにより指示される実際のデータがデータ・ストリーム
に配置される。サーバ上のデータ構造再構成器は、クラ
イアントから受信されたデータ・ストリングに従い、デ
ータ構造を形成する。サーバ上にエンジン・データ構造
を再形成するため、サーバはそのデータ構造用にメモリ
を割当てることが必要となる。本発明はデータ構造を再
構成するために、効率的にメモリを割当てる方法に関す
る問題を指摘する。
【0011】OS/2 ES1.0データベース・マネ
ージャでは、各クライアント及びサーバは送受信情報用
の固有の通信バッファを有する。通信バッファのサイズ
は、データベース・コンフィギュレーション・ファイル
内のブロック・サイズにより決定される。通信バッファ
の最小サイズは4Kである。リクエスタはデータを通信
バッファに配置し、データを実際に送信するために通信
ルーチンを呼出す。サーバは自己の固有の通信バッファ
からデータを受信する。
【0012】クライアントがエンジン・データ構造を通
信バッファ内に配置する以前に、クライアントは第1に
データベース・データ構造により要求される合計メモリ
を計算しなければならない。データベース・データ構造
はJRA制御構造、入力SQLDA、出力SQLDA及
びSQLCAを含む。メモリ要求情報は通信バッファ内
に配置される。次に、クライアントは制御構造を通信バ
ッファ内に複写する。通信バッファが充填されると、ク
ライアントは通信ルーチンを呼出し、バッファをサーバ
に送信する。
【0013】サーバは次に通信ルーチンを呼出してデー
タを受信する。この時、クライアントにより送信された
データはサーバの通信バッファ内に存在する。クライア
ントは最初にメモリ要求情報をその通信バッファ内に配
置したため、サーバはそれを最初にバッファ内に受信す
る。サーバは次にこの情報を使用して、データ構造に対
応してメモリを割当てる。
【0014】エンジン・データ構造により必要とされる
メモリをM、通信バッファのサイズをB、及びセグメン
トのサイズをSとする。セグメントは各メモリ割当て呼
出しにおいて割当てられる最大仮想メモリである。例え
ば、16ビットOS/2に対応する最大セグメント・サ
イズは64Kである。第1に、エンジン・データ構造に
より必要とされるメモリ(M)が通信バッファのサイズ
(B)よりも小さい場合、余分なメモリは必要とされな
い。これらのデータ構造はネイティブ形式で転送される
ため、通信バッファはエンジン・データ構造を再形成す
るために使用される。クライアントは単に各データ構造
の開始位置を位置決めし、新たなアドレスをSQLJR
Aのポインタ・フィールドに割当てる。
【0015】図2は遠隔データベース要求における情報
の流れの一例を示す。最初にデータベース・ランタイム
APIルーチン200が、ユーザのSQL要求から、デ
ータベース・エンジン・データ構造202を準備する。
これらのデータ構造にはSQLRA202(SQL要求
エリア)及びSQLDA202(SQLデータ・エリ
ア)が含まれる。次にゲートウェイ・マッパ210がS
QLRAをSQLJRA(ゲートウェイ・インタフェー
ス要求エリア)にマップする。データ構造(SQLJR
A及びSQLDA)214はSQLJRAデータ・スト
リーム構成器に渡される。次にSQLJRAデータ・ス
トリーム構成器220は、データ・ストリーム222に
対するメモリ要求を計算する。
【0016】メモリ要求に関する情報はデータ・ストリ
ーム(SQLCPLEN)に配置されるが、これについ
ては後述する。SQLJRAデータ・ストリーム構成器
はまたデータ構造からデータ・ストリーム222を構成
し、このデータ・ストリームを通信バッファ230に配
置する。データベース・マネージャ移送ルーチン240
/250は、トランスポート層通信プロトコルを通じ
て、通信バッファをサーバに伝送する。
【0017】サーバ側では、データベース・マネージャ
280移送ルーチンがデータ・ストリームを通信バッフ
ァ内に受信する。SQLJRAデータ構造構成器260
が通信バッファから最初に獲得するのは、メモリ要求デ
ータ構造である。メモリ要求データ構造内の情報によ
り、サーバはデータ構造を再構成するための合計メモリ
要求を計算する。データ構造構成器は適切なメモリ・サ
イズを割当て、データ・ストリームから割当てられたメ
モリにデータを受信し、データ構造を再形成する。
【0018】再構成されたデータ構造はゲートウェイ・
ルータ270に与えられ、これはSQLJRAゲートウ
ェイ・インタフェース構造を、データベースが実際に使
用するデータ構造であるSQLRAにマップする。次に
SQLRA及びSQLDAがSQL要求を実行するため
にデータベース280に提供される。
【0019】図3はクライアント側のSQLJRAデー
タ・ストリーム構成器の詳細な流れ図である。上述のよ
うに、データ・ストリーム構成器はサーバが必要とする
メモリ要求情報を含むデータ構造を準備する必要があ
る。処理は機能ブロック300で開始され、ここでロケ
ーション・ポインタが通信バッファ内の最初に使用可能
なレコードに初期化される。次に機能ブロック310に
おいて、現行バッファ・ロケーション・ポインタがSQ
LCPLENに割当てられ、2つのデータ構造のレング
スが機能ブロック320で計算される。合計入力データ
・レングス及び出力データ・レングスが、それぞれ機能
ブロック330及び340において、適切な変数に割当
てられる。次に、機能ブロック350及び360に示さ
れるように、入力及び出力に対応する変数の数が計算さ
れ、通信バッファ内に配置される。最後に、機能ブロッ
ク370、380及び390において、通信バッファ内
の各変数のレングスが記録され、エグジットがターミナ
ル392で実行される。
【0020】本発明によるデータ構造:次に、クライア
ントがサーバにメモリ及びデータ・レングス情報を示す
ために転送する制御構造を示す。
【0021】
【0022】このデータ構造を形成する直感的アプロー
チは、構造の定義、構造内の値の割当て、及び構造の通
信バッファへの転送である。またその代わりに、制御構
造が通信バッファ内に形成され、値が適切な制御構造に
格納されてもよい。この場合には、制御構造をデータ・
ストリームに複写する必要はない。
【0023】次に上記制御構造内の各変数について説明
する。 ・CS_LEN:SQLJRA及びSQLCPLENを含む制
御構造の合計レングスである。サーバは制御構造の終わ
りを位置決めするためにこの情報を使用する。 ・IN_DATA_LEN:ユーザ入力データ領域のレングスであ
る。 ・OUT_DATA_LEN:ユーザ出力データ領域のレングスであ
る。 ・IN_DATA_LEN及びOUT_DATA_LEN:データ構造に必要な合
計メモリ空間、及びユーザ入出力データ領域用に必要な
セグメント数を計算するために使用される。 ・NUM_OF_VARS:入出力SQL変数の数である。NUM_OF_V
ARS の値はユーザ入力SQLDA内のSQLDから転送
される。 ・NUM_OF_OUT_VARS:出力SQL変数の数である。NUM_OF
_OUT_VARS の値はユーザ出力SQLDA内のSQLDか
ら転送される。 ・SQLVAR_LEN:各SQL変数の実際のデータ・レングス
を格納するための配列である。ユーザ入力SQLDA内
の各SQLVARは、実際のデータ・レングスを得るた
めに検査される。サーバはNUM_OF_VARSから入力SQL
DAレングス(IN_DA_LEN)を計算し、NUM_OF_OUT_VARS
から出力SQLDAレングス(OUT_DA_LEN)を計算す
る。
【0024】図4はサーバ上におけるデータ構造再構成
器の詳細な流れ図である。データ構造再構成器が通信バ
ッファから最初に獲得するものはSQLCPLENデー
タ構造である。機能ブロック400に示されるように、
サーバはSQLCPLENデータ構造内の情報におい
て、データ構造のために必要な合計メモリ空間(M)4
20を次式により計算する。 M = CS_LEN + IN_DA_LEN + OUT_DA_LEN + IN_DATA_LE
N + OUT_DATA_LEN
【0025】ここで通信バッファのサイズをB(参照番
号422)及びセグメントのサイズをS(同424)と
する。セグメント(S)424は各メモリ割当て呼出し
において割当て可能な最大仮想メモリである。例えば、
16ビットOS/2における最大セグメント・サイズは
64Kである。最初に判断ブロック410に示されるよ
うに、データ構造(M)に必要なメモリが通信バッファ
(B)のサイズよりも小さい場合、余分なメモリは必要
とされない。SQLJRA遠隔プロトコルはこれらのデ
ータ構造をそのネイティブ形式で転送するため、通信バ
ッファはそのデータ構造を再形成するために使用可能と
なる。クライアントは各データ構造の開始位置を位置決
めするだけでよく、新たなアドレスをSQLJRA内の
ポインタ・フィールドに割当てる。判断ブロック410
において余分なメモリが必要とされない場合、次に機能
ブロック430及び440において、データ構造の開始
アドレスが位置決めされ、アドレスが適切なポインタに
割当てられ、処理は完了される。
【0026】判断ブロック410のテストの結果、余分
なメモリが必要な場合、更に判断ブロック450におい
てテストが実行され、必要な合計メモリがセグメント・
サイズよりも大きいかが判断される。大きい場合、機能
ブロック460に示されるように3個のバッファが割当
てられ、機能ブロック470においてデータが3個のバ
ッファ内に受信される。その後、制御は機能ブロック4
30及び440に移行し、データ構造の開始アドレスが
位置決めされ、そのアドレスが適切なポインタに割当て
られる。
【0027】必要となる合計メモリがセグメント・サイ
ズよりも大きいかを判断する判断ブロック450におけ
るテストの結果、必要なメモリの最大量が1セグメント
である場合、次に機能ブロック452で示されるよう
に、1個のバッファが割当てられ、データは機能ブロッ
ク454に示されるように単一のバッファ内に受信され
る。その後、制御は機能ブロック430及び440に移
行し、データ構造の開始アドレスが位置決めされ、その
アドレスが適切なポインタに割当てられる。
【0028】図5は単一の通信バッファ500内に全て
のデータ構造を収容する例を示す。SQLJRA510
内の入力SQLDAポインタ520は通信バッファ内の
入力SQLDA領域540を指示し、出力SQLDAポ
インタ530は出力SQLDA550を指示する。入/
出力SQLDAは、各々、対応するデータ領域560及
び570を有する。ユーザ照会のために生成されるデー
タ構造の大部分は、図5に示されるように、その最小サ
イズが4Kである1個の通信バッファ内に適合する。こ
の場合、データ構造を再構成するために余分なメモリは
必要とならない。
【0029】第2に、MがBよりも大きくSよりも小さ
い場合、サーバはサイズMの1個のバッファを割当て
る。全てのデータ構造はこのバッファ内に順番に受信さ
れる。全てのデータが受信された後、ポインタは第1の
ケースの場合同様に調整される。
【0030】第3に、MがSよりも大きい場合、サーバ
は少なくとも3個のバッファを割当てる。第1のバッフ
ァは制御構造SQLJRA及びSQLCA用に使用され
る。また、第2のバッファは入力SQLDA用に、第3
のバッファは出力SQLDA用に使用される。第2或い
は第3のバッファはユーザのデータに依存して、1セグ
メントよりも大きい場合もある。追加のバッファは入出
力データを収容するために割当てられる。
【0031】本発明は、特定のシステム環境における実
施例について述べてきたが、当業者には理解されるよう
に、本発明は特許請求の範囲の精神及び範中において、
他の異なるハードウェア及びソフトウェア環境において
も変更を伴うことにより実施可能である。
【0032】 /*********************************-PROLOGUE-**************************** ***** * * * OCO SOURCE MATERIALS * * * * MODULE NAME: sqlcpsvr * * * * COMPONENT NAME: Distributed Data Services * * JRA data stream server * * * * LPP NAME: Gemstone * * * * DESCRIPTIVE NAME: Receive JRA data stream * * * * COPYRIGHT: program-number (C) COPYRIGHT IBMCORP 1991 * * * * STATUS: Development Phase * * * * FUNCTION: * * This module contains a set of functions which receive the JRA dat a * * stream, send it to the database engine, and return the results to * * the requester. * * * * COMPILER OPTIONS: * * see sqlc.cop * * * * INPUT: * * * * The following is the standard data flow of a data request: * * * * Item Element * * * *----------------------------------------------------------------------- ----* * 1. Amount of data in 1st Communications buffer. * * 2. The SQLJRA (with no meaningful data in any pointer field s). * * 3. Length of the control structures (Everything through ite m #9 * * (up to item #10)). This does include item #1 (2byte s). * * 4. Length of the input data. * * 5. Length of the output data (if any). * * 6. Number of items in array #8. * * 7. Number of output SQLVARS. If there is no output DA this will* * be 0. * * 8. Array of the actual lengths of the input data items (len gths * * in the input SQLDA can be maximums). * * 9. SQLJRA parameters (data in fields accessed by pointers) . * * 10. Input SQLDA (no data). * * 11. Ouput SQLDA (no data). * * 12. Input data. * * * * Note: It is highly likely everything is the first buffer. * * * * OUTPUT: * * * * The following is the standard data flow of data returned from the * * server: * * * * Item Element * * ------------------------------------------------------------------ --- * * 1. Amount of data in 1st Communications buffer (unsigned in t). * * 2. The two byte return code from sqledscr (the router). * * 3. A NULL indicator for the SQLCA. If it is 0, a SQLCA is * * returned. If it is less than 0, no SQLCA is returned. * * A SQLCA is always returned for start using database. * * 4. Optional SQLCA. See Item #3 for a description. * * * * The rest of the data returned depends on the SQLJRA request type. * * * * For execute commands: * * * * 5. A NULL indicator for the data. If it is 0, a data row is * * returned. If it is less than 0, no data row is returned . * * 6. A data row. Each data row consists of n SQLVARs, where n is * * the number listed in the output SQLDA. Each SQLVAR * * consists of the following: * * * * 1. NULL indicator. This describes if the data is NULL or is * * present. A 0 value indicates data. Less than 0 * * indicates that no data is sent. * * 2. Optional data. See Item 5.1 above for a description. * * * * For start using commands: * * * * 5. The database name (10 bytes). * * 6. The server SBCS codepage (2 bytes). * * 7. The server comm buffer length (2 bytes). * * 8. The server process ID (2 bytes). * * 9. The server thread ID (2 bytes). * * 10. The server release level (10 bytes). * * * * For prepare and describe commands: * * * * 5. The number of output SQLVARS used (output DA sqld field - 2 b ytes)* * 6. Optional output DA (with no data). This DA is only sent if the * * output DA sqld field is smaller or equal to the allocated si ze * * (the output DA sqln field). * * * ************************************************************************ ***** * For fetches ONLY WHEN the cursor is using blocking: * * This flow is different than the others. Each row has the same f low * * as an execute command. * * * * 1. Amount of data in 1st Communications buffer (unsigned in t). * * 2. Number of rows fetched in this buffer. * * 3. Is the last row in this buffer the last row that can be * * fetched from the cursor? 0 = no, -1 = yes. * * * * After this, each row consists of the following: * * * * 4. The two byte return code from sqledscr (the router). * * 5. A NULL indicator for the SQLCA. If it is 0, a SQLCA is * * returned. If it is less than 0, no SQLCA is returned. * * 6. Optional SQLCA. See Item #5 for a description. * * 7. A NULL indicator for the data. If it is 0, a data row is * * returned. If it is less than 0, no data row is returned . * * 8. A data row. Each data row consists of n SQLVARs, where n is * * the number listed in the output SQLDA. Each SQLVAR * * consists of the following: * * * * 1. NULL indicator. This describes if the data is NULL or is * * present. A 0 value indicates data. Less than 0 * * indicates that no data is sent. * * 2. Optional data. See Item 7.1 above for a description. * * * * For open cursors when blocking is to be used on the cursor: * * * * 1. Amount of data in 1st Communications buffer (unsigned in t). * * 2. The two byte return code from sqledscr (the router). * * 3. A NULL indicator for the SQLCA. If it is 0, a SQLCA is * * returned. If it is less than 0, no SQLCA is returned. * * A SQLCA is always returned for start using database. * * 4. Optional SQLCA. See Item #3 for a description. * * 5. The number of output SQLVARS used (output DA sqld field - 2 b ytes)* * 6. Optional output DA (with no data). This DA is only sent if the * * output DA sqld field is smaller or equal to the allocated si ze * * (the output DA sqln field). * * 7. Number of rows fetched in this buffer. * * 8. Is the last row in this buffer the last row that can be * * fetched from the cursor? 0 = no, -1 = yes. * * 9. Any data rows (if #7 > 0). See the fetch description above for * * row contents. * * * * Note: It is highly likely everything is the first buffer. * * * * RETURN CODE: * * See individual function description * * * ************************************************************************ ****/ /*********************************************************************** ******/ /*** Include statements. ***/ /*********************************************************************** ******/ #define SQLZ_STACK /* Do not invoke api macros*/ #define LINT_ARGS 1 #define INCL_SQLOMMDC #define INCL_SQLOIPDC 1 #include "sqlz.h" #include "sqlo.h" #include "sqlocall.h" #include "sqlenv.h" #include "sqljra.h" #include "sqljrai.h" #include "sqler.h" #include "sqlra.h" #include "sqlca.h" #include "sqlcc.h" #include "sqlcm.h" #include "sqlcmi.h" #include "sqle.h" #include "sqleapi.h" #include "sqlei.h" #include "sqltc.h" #include "sqlchdda.h" #include "sqlc.h" #include "sqlci.h" #include "sqlcodes.h" #include "sqlrx.h" #include "sqlda.h" #include "sql.h" #include "sqlcitoh.h" #include "sqlcpcom.h" #include "sqlcpccb.h" #include "sqlcpsvr.h" /*********************************************************************** ******/ /* Function name: SQLCPSVR_RECEIVE */ /* Function: */ /* Receive a JRA request from a client, and marshall it. */ /* Input: */ /* DDSACB pointer */ /* Output: */ /* Return code of status of operation. */ /*********************************************************************** ******/ short SQLZ_LOCAL sqlcpsvr_receive(struct sqlcacb *ddsacb) { short retcode = 0; /* Function return code. */ short t_count, t_count2; /* Looping variables. */ unsigned char *buf_ptr; /* Pointer for use in scanning la rger */ /* buffer. */ unsigned char *cb_buf_ptr; /* Used only for parsing das. */ unsigned short buffer_len; /* Length of the comm buffer. */ unsigned long total_len; /* Total length of the entire req uest */ unsigned long total_input_len; /* Total length except output dat a. */ unsigned long ctl_struct_len; /* Length of the control structur es. */ unsigned long in_data_len; /* Length of the input data. */ unsigned long out_data_len; /* Length of the output data. */ unsigned long num_in_sqlvars; /* Number of entries in the array of */ /* input data lengths. */ unsigned long num_out_sqlvars; /* Number of output SQLVARs. */ unsigned long input_da_len; /* Length of the input DA (no da ta). */ char *jra_params; /* Pointer to the SQLJRA paramete rs. */ char **triplet_ptr; /* Pointer to triplets in SQLJRA. */ unsigned long *length_ptr; /* Pointer to length field in tri plets*/ unsigned long *in_da_lens; /* Pointer to array of actual inp ut */ /* DA lengths. */ struct sqlda *in_da_ptr = NULL; /* Pointer to input DA in the buf fer. */ char *input_data; /* Pointer to the start of the in put */ /* data. */ char *output_data; /* Pointer to the start of the ou tput */ /* data. */ struct sqlvar *t_sqlvar; /* Pointer to a SQLVAR from SQLDA */ struct sqlda *private_out_da; /* Private copy of the output DA. */ /* move_data call. */ unsigned long total_received; /* Total received so far. */ unsigned int amt_to_copy; /* Amount left to copy. */ unsigned int temp_holder; /* Variable to hold last two byte s of */ /* buffer during copy of next co mm */ /* buffer. */ unsigned short receive_length; /* How much data was received. */ unsigned short parse_da_data = FALSE; /* Should data for the das be par sed */ /* to see if it has to go in mul tiple*/ /* bufs? */ unsigned long *t_in_da_lens; /* Pointer to array of actual inp ut */ unsigned short start_var; /* Which is first sqlvar in this seg? */ unsigned short total_var_space; /* How much space used up in cur seg? */ unsigned short this_var_space; /* How much space does this var t ake */ /* up? */ short done_with_input; /* Are we done with the input var ? */ unsigned char *t_run_ptr; /* Temp pointer for runstats. */ unsigned char *t_addr_ptr; /* Temp pointer for runstats. */ struct sqlcp_ccb *temp_ccb; /* Temp CCB pointer. */ unsigned long rcv_out_da_len; /* Length of the output DA sent b y rqr*/ /*********************************************************************** ******/ /* Get the address of the comm bu ffer.*/ /* Get the length of the data in the */ /* buffer (it is byte-reversed ). */ /* Byte reverse it. */ /* Move the pointer to start of t he */ /* SQLJRA. */ comm_buffer = ddsacb->buffer; sqlzmcpy(&buffer_len, comm_buffer, SQLC_SHORT_SIZE); buffer_len = SQLC_SWAP2(buffer_len); comm_buffer += SQLC_SHORT_SIZE; /* Set a pointer to the SQLJRA in the */ /* Comm buffer. */ /* Move to the length fields. */ dcsra = (SQLJDSRA *)&comm_buffer[0]; comm_buffer += sizeof(SQLJDSRA); /* Assign the SQLCA in the SQLJRA . */ dcsra->sqlrcap = (char *) &ddsacb->cb.aacb.sqlca; /* No errors found. */ /* Clear out status variable for out */ /* DA memory storage. */ /* Clear out variables to tell us what*/ /* kind of request this is. We only */ /* care about a few special requ est */ /* types that require special */ /* processing. */ /* Find out if this is a start us ing. */ /* Find out if this is a compile stmt */ /* or not. Compile statements h ave */ /* input Das, but no input data. The*/ /* DA has SQLVAR length and name */ /* information for the host vari ables*/ /* so we don^t want to try to se t the*/ /* data pointers in the DA. */ /* Find out if this is a runstats . */ /* runstats has input DA too, bu t no */ /* data. Also we have to adjust the */ /* pointers in theDCSRA->SQLJRDA TA[1*/ /* field to point to the input D A. */ /* Find out if it is one of sever al */ /* other type of commands that n eed */ /* special processing. */ error_found = 0; allocate_out_da = 0; start_using = 0; compile = 0; runstat = 0; prep_desc = 0; ari = 0; op_stat = 0; open_cursor = 0; close_cursor = 0; fetch = 0; exec = 0; blocking = 0; switch (dcsra->sqltype) { case SQLJ_DCSSV: switch (dcsra->sqlrtype) { case SQLJR_STARTGW: start_using = 1; if (ddsacb->length > SQLC_SIZE_MAXQRYBLK) { ddsacb->length = SQLC_SIZE_MAXQRYBLK; } break; case SQLJR_RPC: ari = 1; break; case SQLC_RT_OPSTAT: op_stat = 1; break; } break; case SQLJ_DBSV: switch (dcsra->sqlrtype) { case SQLJR_COMPILE: compile = 1; break; case SQLJR_RUNSTATS: runstat = 1; break; case SQLJR_PREPARE: case SQLJR_DESCRIBE: prep_desc = 1; break; case SQLJR_OPEN: open_cursor = 1; break; case SQLJR_CLOSE: close_cursor = 1; break; case SQLJR_FETCH: fetch = 1; break; case SQLJR_EXECUTE: exec =1; break; } break; } /* Get the control structures len gth */ /* Get the input data length. */ /* Get the output data length. */ /* Get the number of input sqlvar s. */ /* Get the number of output sqlva rs. */ /* Get the size of the input DA. */ /* If it is zero in the JRA, lea ve it*/ /* Otherwise it is a DA of num_i n_var*/ /* sqlvars. This can be smalle r */ /* than the size in the JRA (i f the */ /* sqld field is smaller than s qln).*/ /* Get the size of the output DA for */ /* both memory allocation and rc ving.*/ sqlzmcpy(&ctl_struct_len, comm_buffer, SQLC_LONG_SIZE); comm_buffer += SQLC_LONG_SIZE; sqlzmcpy(&in_data_len, comm_buffer, SQLC_LONG_SIZE); comm_buffer += SQLC_LONG_SIZE; sqlzmcpy(&out_data_len, comm_buffer, SQLC_LONG_SIZE); comm_buffer += SQLC_LONG_SIZE; sqlzmcpy(&num_in_sqlvars, comm_buffer, SQLC_LONG_SIZE); comm_buffer += SQLC_LONG_SIZE; sqlzmcpy(&num_out_sqlvars, comm_buffer, SQLC_LONG_SIZE); comm_buffer += SQLC_LONG_SIZE; if (compile ) { input_da_len = dcsra->sqlrdail; } else { input_da_len = (dcsra->sqlrdail > 0) ? SQLDASIZE(num_in_sqlvars ) : 0; } output_da_len = dcsra->sqlrdaol; rcv_out_da_len = output_da_len; if (output_da_len > 0) { rcv_out_da_len = SQLDASIZE(num_out_sqlvars); } /* Get the data length sent from the */ /* client. It is composed as fo llows*/ /* 1) Two bytes - Length of buf fer. */ /* 2) Size of all control struc ts. */ /* 3) Sizes of input/output DAs . */ /* 4) Size of input data. */ /* Get our total space needs. It is */ /* equal to the input space plus the */ /* space needed for the output d ata. */ total_input_len = SQLC_SHORT_SIZE + ctl_struct_len + input_da_len + rcv_out_da_len + in_data_len; total_len = SQLC_SHORT_SIZE + ctl_struct_len + input_da_len + output_d a_len + in_data_len + out_data_len; /* If everything will fit into th e */ /* one Comm, buffer... */ /* 1) We don^t need any segment s. */ /* 2) Set up a pointer for rest of */ /* the buffer manipulations. */ if (total_len <= ddsacb->length) { num_segs_needed = 0; buf_ptr = comm_buffer; } else { /* If it will all fit into one se gmemt*/ /* (64K or less). */ /* Mark that we need one segment. */ /* Get the segment. */ /* Copy the comm buffer into the */ /* segment. */ /* Set the pointer in the segment for */ /* the next receive. */ /* Get the length of the first re ceive*/ /* Mark that as received so far. */ /* While there^s more to get... */ /* Find out how much is left to copy.*/ /* If it is less than one buffer ... */ /* Adjust amount to receive. */ /* Save the last two bytes recei ved. */ /* Get the next buffer. */ /* Copy back the 2 bytes (over the */ /* new buffer^s LL field). */ /* Increment total. */ /* Move forward for next receive . */ if (total_len <= SQLO_MAXSEGSIZ) { retcode = sqloallocseg((unsigned int) total_len, (char **) &segments[0], SQLO_MM_SHARE_GIVE); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR", (long) SQL_RC_E954); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 102, sizeof( short), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } num_segs_needed = 1; sqlzmcpy(segments[0], ddsacb->buffer, buffer_len); buf_ptr = segments[0] + buffer_len - SQLC_SHORT_SIZE; receive_length = ddsacb->length; total_received = receive_length; while (total_received < total_input_len) { amt_to_copy = (unsigned int) (total_input_len - total_received + SQLC_SHOR T_SIZE); if (amt_to_copy < ddsacb->length) { receive_length = amt_to_copy; } sqlzmcpy(&temp_holder, buf_ptr, SQLC_SHORT_SIZE); retcode = sqlccrcv(&(ddsacb->comhandle), &receive_lengt h, buf_ptr, SQLC_FILL); if (retcode != 0) { sqlcperc(&ddsacb->comhandle,(struct sqlca *)dcsra->s qlrcap, "SQLCPSVR"); /* sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR ", (long) SQL_RC_E30080); */ sqlt_system_error(SQLT_SQLC, SQLT_SQLCPSVR, 108, sizeo f(short), &retcode); retcode = SQLJR_RCF_TERMINATE | SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } sqlzmcpy(buf_ptr, &temp_holder, SQLC_SHORT_SIZE); total_received += receive_length - SQLC_SHORT_SIZE; buf_ptr += receive_length - SQLC_SHORT_SIZE; } /* Set up the SQLJRA pointer. */ /* Mark location in new buffer. */ dcsra = (SQLJDSRA *) ((char *) segments[0] + SQLC_SHORT _SIZE); buf_ptr = segments[0] + (comm_buffer - ddsacb->buffer); } else { /* We need a minimum of 3 buffers . */ /* Allocate a buffer for the cont rol */ /* structures (SQLJRA...) */ /* Allocate a buf for input da. */ /* Allocate a buf for output da. */ /* Mark that we have to parse da */ /* data. */ retcode = sqloallocseg((unsigned int) (SQLC_SHORT_SIZE + ctl_struct_len), (char **) &segments[0], SQLO_MM_SHA RE_GIVE); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR", (long) SQL_RC_E954); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 103, sizeof( short), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } num_segs_needed = 1; retcode = sqloallocseg((unsigned int) input_da_len, (char **) &segments[1], SQLO_MM_SHA RE_GIVE); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR", (long) SQL_RC_E954); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 104, sizeof( short), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } num_segs_needed = 2; retcode = sqloallocseg((unsigned int) output_da_len, (char **) &segments[2], SQLO_MM_SHARE_GIVE); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR", (long) SQL_RC_E954); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 105, sizeof( short), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } num_segs_needed = 3; parse_da_data = TRUE; /* Get start of first comm buffer . */ /* Receive control data into a se gment*/ /* If there^s an input da, get it . */ /* If there^s an output da, get i t. */ cb_buf_ptr = ddsacb->buffer; retcode = sqlcpgd(ddsacb, &cb_buf_ptr, ddsacb->buffer, segm ents[0], (unsigned int) (SQLC_SHORT_SIZE + ctl_struc t_len), FALSE); if (retcode != 0) { sqlcperc(&ddsacb->comhandle,(struct sqlca *)dcsra->sql rcap, "SQLCPSVR"); /* sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR", (long) SQL_RC_E30080); */ sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 109, sizeof( short), &retcode); retcode = SQLJR_RCF_TERMINATE | SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } if (input_da_len > 0) { retcode = sqlcpgd(ddsacb, &cb_buf_ptr, ddsacb->buffer, segments[1], (unsigned int) (input_d a_len), FALSE); if (retcode != 0) { sqlcperc(&ddsacb->comhandle,(struct sqlca *)dcsra-> sqlrcap, "SQLCPSVR"); /* sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSV R", (long) SQL_RC_E30080); */ sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 110, sizeof(short), &retcode); retcode = SQLJR_RCF_TERMINATE | SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } } if (rcv_out_da_len > 0) { retcode = sqlcpgd(ddsacb, &cb_buf_ptr, ddsacb->buffer, segments[2], (unsigned int) (rcv_out _da_len), FALSE); if (retcode != 0) { sqlcperc(&ddsacb->comhandle,(struct sqlca *)dcsra-> sqlrcap, "SQLCPSVR"); /* sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSV R", (long) SQL_RC_E30080); */ sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 111, sizeof(short), &retcode); retcode = SQLJR_RCF_TERMINATE | SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } } /* Set up the SQLJRA pointer. */ /* Mark location in new buffer. */ dcsra = (SQLJDSRA *) ((char *) segments[0] + SQLC_SHORT _SIZE); buf_ptr = segments[0] + (comm_buffer - ddsacb->buffer); } } /* Get a pointer to start of arra y of */ /* actual input DA data lengths. */ /* Move comm buffer ptr to JRA pa rams.*/ /* Get a pointer to the JRA param s. */ in_da_lens = (unsigned long *)&buf_ptr[0]; buf_ptr += (num_in_sqlvars * SQLC_LONG_SIZE); jra_params = (char *)&buf_ptr[0]; /* Point to first triplet. ASSUM E */ /* THAT INDICATOR ARRAY IS FIRST !!! */ /* For each triplet... */ /* Set the pointer field to poin t */ /* to the proper parameter fiel d. */ /* Move the pointer in the param eters*/ /* field based on field length. */ /* Move to the next triplet. */ triplet_ptr = &(dcsra->sqlrflag); length_ptr = &(dcsra->sqlrflgl); for (t_count = 0; t_count < SQLC_NUM_TRIPLETS; t_count++) { if (((unsigned long) *length_ptr) > 0) { *triplet_ptr = jra_params; jra_params += (unsigned long) *length_ptr; } else { *triplet_ptr = NULL; } triplet_ptr = (char **) ((char *) triplet_ptr + SQLC_TRIPLET_SI ZE); length_ptr = (unsigned long *) ((char *) length_ptr + SQLC_TRIP LET_SIZE); } /* Set a pointer to start of DA a rea. */ /* Initialize the output DA ptr. */ /* If there^s an input DA, set th e ptr*/ /* If there^s an output DA... */ /* Set the pointer. */ /* If this is all in the comm bu ffer.*/ /* Get private storage. */ /* If can^t, error and leave. */ /* Copy the DA to private stora ge. */ /* NOTE: Output DA must be co pied */ /* out of the buffer, */ /* because it can be wi ped */ /* out when we store re turn */ /* data (and we need i t then*/ buf_ptr = (char *) dcsra + ctl_struct_len; out_da_ptr = NULL; if (input_da_len > 0) { in_da_ptr = (struct sqlda *) ((parse_da_data) ? segments[1] : buf_ptr); } if (output_da_len > 0) { out_da_ptr = (struct sqlda *) ((parse_da_data) ? segments[2] : (buf_ptr + input_da_le n)); allocate_out_da = FALSE; if (num_segs_needed == 0) { retcode = sqlogblk(ddsacb->rsheap, (unsigned) output_da_len, &private_out_da); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCPSVR", (long) SQL_RC_E962); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 102, sizeof(shor t), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } allocate_out_da = 1; sqlzmcpy(private_out_da, out_da_ptr, (unsigned int) output_da _len); out_da_ptr = private_out_da; } } /* Set the pointers to the input and */ /* output SQLDAs. */ dcsra->sqlrdapi = (char *) in_da_ptr; dcsra->sqlrdapo = (char *) out_da_ptr; /* If this is a runstat operation ... */ /* Get a pointer to the start of the */ /* array of pointers in the prop er */ /* triplet. */ /* Loop through the number of ind exes.*/ /* For each, put the address of t he */ /* string containing the index n ame */ /* (which is in a SQLVAR),
in the */
/* data triplet. /* Move forward in triplet to nex t ind*/ if (runstat) { t_run_ptr = dcsra->sqlrdata[1].sqlrdtp; for (t_count = 0; t_count < (short) (dcsra->sqlrdata[1].sqlrdtl / SQLC_LONG_SIZE); t_count++) { t_addr_ptr = (char *) in_da_ptr->sqlvar[t_count].sqlname.data ; sqlzmcpy(t_run_ptr, &t_addr_ptr, SQLC_LONG_SIZE); t_run_ptr += SQLC_LONG_SIZE; } /* Fix the number of indexes in t he */ /* triplet. */ /* Clear out the input da in the JRA. */ /* (we only need it for index n ames).*/ dcsra->sqlrdata[1].sqlrdtl /= SQLC_LONG_SIZE; dcsra->sqlrdapi = NULL; dcsra->sqlrdail = 0; } /* Clear out the input data point er. */ /* If there^s an input DA, and th is */ /* is not a "compile SQL" stmt.. . */ /* and not a "runstat" stmt... */ /* If we need input data in a seg ment.*/ input_data = NULL; if ((in_da_ptr != NULL) && (!compile) && (!runstat)) { if (!parse_da_data) { /* Now we must deal with input da ta. */ /* If there is input data... */ /* Loop through all sqlvars. Fo r */ /* each SQLVAR... */ /* 1) Get a pointer to the SQ LVAR. */ /* 2) If column data is NULL. .. */ /* Set up NULL pointer. */ /* Move forward in buffer. */ /* 3) Else, */ /* Set up the data pointer . */ /* Move in the data the si ze */ /* of this data item (to the */ /* next item. */ /* 4) Move to the next length in */ /* the array of lengths. */ input_data = (char *) (buf_ptr + input_da_len + rcv_out_da_ len); for (t_count = 0; t_count < (unsigned int) num_in_sqlvars; t_count++) { t_sqlvar = (struct sqlvar *) &(in_da_ptr->sqlvar[t_coun t]); if ((t_sqlvar->sqltype & SQL_TYP_NULINC) != 0) { t_sqlvar->sqlind = (short *) input_data; input_data += SQLC_SHORT_SIZE; } if (((t_sqlvar->sqltype & SQL_TYP_NULINC) == 0) || ((short) *t_sqlvar->sqlind >= 0)) { t_sqlvar->sqldata = (unsigned char *) input_data; input_data += (unsigned long) *in_da_lens; } in_da_lens = (unsigned long *) ((char *) in_da_lens + SQLC_LONG_SIZE); } } else { /* Else we need 1 or more data se gs. */ /* Save pointer to input lengths. */ /* Save first var number of this seg. */ /* No vars saved yet. */ /* For all of the sqlvars... */ /* Not yet done with input. */ t_in_da_lens = in_da_lens; start_var = 0; total_var_space = 0; done_with_input = FALSE; for (t_count = 0; t_count < (unsigned int) num_in_sqlvars; t_count++) { /* Get the SQLVAR. */ /* Get the space needed for this var. */ t_sqlvar = (struct sqlvar *) &(in_da_ptr->sqlvar[t_coun t]); this_var_space = 0; if ((t_sqlvar->sqltype & SQL_TYP_NULINC) != 0) { this_var_space = SQLC_SHORT_SIZE; } this_var_space += (unsigned short) ((unsigned long) *in_da_lens); /* If this var won^t fit in the s eg. */ /* Allocate seg for previous vars . */ /* Get the data in the segment. */ if ((unsigned long) total_var_space + this_var_space > SQLO_MAXSEGSIZ) { alloc_space: retcode = sqloallocseg(total_var_space, (char **) &segments[num_segs_needed], SQLO_MM_SHARE_GIVE); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCP SVR", (long) SQL_RC_E954); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 106, sizeof(short), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } retcode = sqlcpgd(ddsacb, &cb_buf_ptr, ddsacb->buffe r, segments[num_segs_needed], total_va r_space, FALSE); if (retcode != 0) { sqlcperc(&ddsacb->comhandle, (struct sqlca *)dcsra->sqlrcap, "SQLCPSVR"); /* sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCP SVR", (long) SQL_RC_E30080); */ sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 112, sizeof(short), &retcode); retcode = SQLJR_RCF_TERMINATE | SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } /* Now we have to go back and upd ate */ /* the pointers for the segment. */ /* Loop through the vars in this seg. */ /* Get the SQLVAR. */ /* Update either Null ind or dat a. */ /* Move forward the length point er. */ input_data = segments[num_segs_needed]; for (t_count2 = start_var; t_count2 < t_count; t_cou nt2++) { t_sqlvar = (struct sqlvar *) &(in_da_ptr->sqlvar[t_count2]); if ((t_sqlvar->sqltype & SQL_TYP_NULINC) != 0) { t_sqlvar->sqlind = (short *) input_data; input_data += SQLC_SHORT_SIZE; } if (((t_sqlvar->sqltype & SQL_TYP_NULINC) = = 0) || ((short) *t_sqlvar->sqlind >= 0)) { t_sqlvar->sqldata = (unsigned char *) inpu t_data; input_data += (unsigned long) *t_in_da_len s; } t_in_da_lens = (unsigned long *) ((char *) t_in_da_lens + SQLC_L ONG_SIZE); } /* Set up for next segment... */ /* Save start of lengths. */ /* Current var size is current to tal. */ /* Current var is first var of se gment*/ /* Move forward to next segment. */ t_in_da_lens = in_da_lens; total_var_space = this_var_space; start_var = t_count; num_segs_needed++; /* If we were just putting the la st */ /* vars in the buffer, skip on. */ if (done_with_input) { goto exit_input; } } else { /* Just add this var to total if it */ /* fits. */ total_var_space += this_var_space; } /* Get next var^s length. */ in_da_lens = (unsigned long *) ((char *) in_da_lens + SQLC_LONG_SIZE); } /* We are done with loop, but the last*/ /* SQLVAR(s) need to be put in a seg.*/ /* Set a flag, and go back to ta ke */ /* care of them. */ done_with_input = TRUE; goto alloc_space; exit_input: ; } } /* If there^s output data and thi s is */ /* not a prepare or describe... */ if ((out_da_ptr != NULL) && (!prep_desc)) { /* If all output data fits in the */ /* one allocated segment... */ if (!parse_da_data) { /* Output data all resides in one */ /* area (need not be segmented ). */ /* For each output SQLVAR... */ /* 1) Get a pointer to the SQLV AR. */ /* 2) If this field is nullable . */ /* and there was a null poin ter */ /* on the requester... */ /* Set the pointer for the n ull */ /* indicator. */ /* Move forward in the outpu t */ /* data. */ /* 3) Set the pointer for the d ata. */ /* 4) Move forward in the outpu t data*/ if (input_data == NULL) { output_data = (char *) (buf_ptr + input_da_len + rcv_o ut_da_len); } else { output_data = (char *) (input_data); } for (t_count = 0; t_count < out_da_ptr->sqld; t_count++) { t_sqlvar = (struct sqlvar *) &(out_da_ptr->sqlvar[t_cou nt]); if (((t_sqlvar->sqltype & SQL_TYP_NULINC) != 0) && (t_sqlvar->sqlind == 0)) { t_sqlvar->sqlind = (short *) output_data; output_data += SQLC_SHORT_SIZE; } else { t_sqlvar->sqlind = NULL; } t_sqlvar->sqldata = (unsigned char *) output_data; output_data += sqlcpdlr(t_sqlvar); } } else { /* Else we need one or more outpu t */ /* data segments. */ /* Save first var number of this seg. */ /* No vars saved yet. */ /* For all of the sqlvars... */ /* Not yet done with input. */ start_var = 0; total_var_space = 0; done_with_input = FALSE; for (t_count = 0; t_count < out_da_ptr->sqld; t_count++) { /* Get the SQLVAR. */ /* Get the space needed for this var. */ t_sqlvar = (struct sqlvar *) &(out_da_ptr->sqlvar[t_cou nt]); if (((t_sqlvar->sqltype & SQL_TYP_NULINC) != 0) && (t_sqlvar->sqlind == 0)) { this_var_space = SQLC_SHORT_SIZE; } else { this_var_space = 0; } this_var_space += sqlcpdlr(t_sqlvar); /* If this var won^t fit in the s eg. */ /* Allocate seg for previous vars . */ /* Get the data in the segment. */ if ((unsigned long) total_var_space + this_var_space > SQLO_MAXSEGSIZ) { alloc_space_out: retcode = sqloallocseg(total_var_space, (char **) &segments[num_segs_needed], SQLO_MM_SHARE_GIVE); if (retcode != 0) { sqlcpsca((struct sqlca *)dcsra->sqlrcap, "SQLCP SVR", (long) SQL_RC_E954); sqlt_trace_error(SQLT_SQLC, SQLT_SQLCPSVR, 107, sizeof(short), &retcode); retcode = SQLJR_RCF_SQLCA; error_found = 1; goto rcv_end; } /* Now we have to go back and upd ate */ /* the pointers for the segment. */ /* Loop through the vars in this seg. */ /* Get the SQLVAR. */ /* Update either Null ind or dat a. */ /* Move forward the length point er. */ output_data = segments[num_segs_needed]; for (t_count2 = start_var; t_count2 < t_count; t_cou nt2++) { t_sqlvar = (struct sqlvar *) &(out_da_ptr->sqlvar[t_count2]); if ((t_sqlvar->sqltype & SQL_TYP_NULINC != 0 ) && (t_sqlvar->sqlind == 0)) { t_sqlvar->sqlind = (short *) output_data; output_data += SQLC_SHORT_SIZE; } else { t_sqlvar->sqlind = NULL; } t_sqlvar->sqldata = (unsigned char *) output_da ta; output_data += sqlcpdlr(t_sqlvar); } /* Set up for next segment... */ /* Current var size is current to tal. */ /* Current var is first var of se gment*/ /* Move forward to next segment. */ total_var_space = this_var_space; start_var = t_count; num_segs_needed++; /* If we were just putting the la st */ /* vars in the buffer, skip on. */ if (done_with_input) { goto exit_output; } } else { /* Just add this var to total if it */ /* fits. */ total_var_space += this_var_space; } } /* We are done with loop, but the last*/ /* SQLVAR(s) need to be put in a seg.*/ /* Set a flag, and go back to ta ke */ /* care of them. */ done_with_input = TRUE; goto alloc_space_out; exit_output: ; } } /* If this is a fetch request... */ /* Get the CCB. */ /* If found (blocking)... */ /* Set on the blocking flag. */ /* Set up the buffer for return . */ /* Set up the data in the retur n */ /* buffer. */ if (fetch) { sqlcpcsr(temp_ccb, svr_ccbs, *((unsigned short *) dcsra->sqlrse ct), dcsra->sqlrcrea, (unsigned short) dcsra->sqlrcrel, dcsra->sqlrpgmn, (unsigned short) dcsra->sqlrpgml); if (temp_ccb != NULL) { blocking = 1; comm_buffer = ddsacb->buffer + SQLC_SHORT_SIZE; sqlcpfet(ddsacb, &comm_buffer, temp_ccb); } } rcv_end: /*Trace the content of the input DA*/ if (in_da_ptr != NULL) { sqlt_trace_misc1(SQLT_SQLC,SQLT_SQLCPSVR,190,(short )input_da_le n, ,(void *) in_da_ptr); } return(retcode); } /*********************************-PROLOGUE-**************************** ***** * * * OCO SOURCE MATERIALS * * IBM CONFIDENTIAL (IBM CONFIDENTIAL-RESTRICTED WHEN COMBINED WITH THE * * AGGREGATED OCO SOURCE MODULES FOR THIS PROGRAM) * * * * MODULE NAME: sqlcpreq * * * * COMPONENT NAME: Distributed Data Services * * JRA data stream requestor * * * * LPP NAME: Gemstone * * * * DESCRIPTIVE NAME: Construct JRA requestor data stream * * * * COPYRIGHT: program-number (C) COPYRIGHT IBM CORP 1991 * * * * STATUS: Development Phase * * * * FUNCTION: * * This module contains a set of functions to construct the JRA data * * stream and send it to the server. * ************************************************************************ ****/ #define LINT_ARGS 1 #include "sqlz.h" #include "sqlo.h" #include "sqlocall.h" #include "sqlenv.h" #include "sqljacb.h" #include "sqljra.h" #include "sqljrai.h" #include "sqler.h" #include "sqlra.h" #include "sqlca.h" #include "sqlcc.h" #include "sqlcm.h" #include "sqlcmi.h" #include "sqle.h" #include "sqlei.h" #include "sqltc.h" #include "sqlchdda.h" #include "sqlc.h" #include "sqlci.h" #include "sqlcodes.h" #include "sqlrx.h" #include "sqlda.h" #include "sql.h" #include "sqlcitoh.h" #include "sqlcpccb.h" #include "sqltc.h" #include "sqlcpcom.h" #include "sqlcpreq.h" /*********************************************************************** ******/ /* SQLCPSND: */ /* Function: Construct JRA data stream and send it to the server. */ /* Input: */ /* Pointer to ddsacb */ /* Pointer to dcsra */ /* Output: */ /* The output SQLDA pointed by the dcsra */ /*********************************************************************** ******/ int SQLZ_LOCAL sqlcpsnd (struct sqlcacb *ddsacb, SQLJDSRA *dcsra) { unsigned int loc; /* Com buffer location pointer */ int i; /* Loop counter */ short buffer_len; /* Length of the com buffer */ SQLJDATA *triplet; /* Current triplet pointer */ char *combuf; /* Comm buffer pointer */ struct sqlcplen *dslenptr; /* Pointer to the data stream len gth */ /* structure in the com buffer */ /* Actual length of input sqlvars */ /* Static allocated */ unsigned long sqlvar_actlen_in[STATIC_VARS]; unsigned long *act_len_in; /* Actual length of input sqlvars */ /* Flag to indicate whether the a ctual*/ /* length array has been allocate d for*/ /* input DA */ unsigned short alloc_flag_in = 0; unsigned long jra_parm_len = 0; /* JRA parameter length */ unsigned int da_size; /* size of the DA */ unsigned int out_da_size = 0; /* size of the output DA */ struct sqlda *in_da; /* Input DA pointer */ struct sqlda *out_da = NULL; /* Outpout DA pointer */ struct sqlca *ca_ptr; /* SQLCA pointer */ struct sqlvar *sqlvar; struct sqlda *run_da= NULL; /* SQLDA allocated to store run s tat */ /* index list */ struct sqlda *useroutda; /* User output da */ char *index_ptr; /* index name for runstat */ unsigned int run_da_size; /* DA size allocated for runstat */ short no_index; /* Number of runstat indexes */ /* The following variables are fo r */ /* cursor operations */ struct sqlcp_ccb *temp_ccb; SQLJDSRA *comra; /* JRA in the com buffer */ int retcode = 0; int err_retcode = 0; /* Positive error return code */ short zero = 0; /*********************************************************************** ****** The communication buffer(s) contain the following in order -------------------------------------------------------------- |ll |sqljra |control strucutre length | input data length ---- ------- ----------------- ------------ ------------------ | output data length | Array of input sqlvar actual length ---------------------------------------------------------- |JRA parm length JRA parm | Input SQLDA | Output SQLDA | ---------------------------------------------------------- |Input data length ---------------------------------------------------------- *********************************************************************** *******/ in_da = (struct sqlda *)dcsra->sqlrdapi; /* Allocate space for the tempora ry */ /* output da and copy userda into it */ useroutda =(struct sqlda *)dcsra->sqlrdapo; /* pick up the com buffer address */ combuf = ddsacb->buffer; comra = (SQLJDSRA *) (combuf + loc); /*Points the the RA in the com buffer */ /* copy the dcsra into the com bu ffer */ sqlzmcpy((char *) (combuf + loc) ,dcsra, JRASIZE); /* If it is a blocked fetch, set the */ /* outpout da length in the com b uffer*/ /* to be 0. */ if (req_blocking) { comra->sqlrdaol = 0L; } /* point to next position in the buf */ loc += JRASIZE; /* points the data stream length */ /* structure */ dslenptr = (struct sqlcplen *)(combuf + loc); /* initlialize the control struct ure */ /* length */ if ((in_da != 0) && (! req_compile) && (! req_runstat)) { dslenptr->cs_len = JRASIZE + SQLCPLEN_SIZE(in_da->sqld); } else dslenptr->cs_len = JRASIZE + SQLCPLEN_SIZE(0); dslenptr->in_data_len = 0; dslenptr->out_data_len = 0; /* Ignore the input data field fo r */ /* compile request type */ if (in_da != 0 && (!req_compile)&& (!req_runstat) ) { dslenptr->num_of_vars = in_da->sqld; } else { dslenptr->num_of_vars = 0; } /* Set the number of output SQLVA Rs. */ if (out_da != NULL) { dslenptr->num_of_out_vars = out_da->sqld; } else { dslenptr->num_of_out_vars = 0; } loc +=SQLCPLEN_SIZE(0); /* points to the input sqlvar l ength */ /* array */ triplet = (SQLJDATA *) &(dcsra->sqlrflgl); /* Get total jra parm length */ /* Since JRA parameters might not be */ /* all in the first com buffer,we must*/ /* get the parameter length befor e the*/ /* first com buffer got sent */ for (i=0;i < MAX_JRA_TRIPLET ;i++ ) { /* Update total JRA parameter len gth */ jra_parm_len += triplet->sqlrdtl; triplet++; /* Point to the next triplet */ } /* endfor */ dslenptr->cs_len += jra_parm_len; /* Add total jra parameter length to */ /* control sructure length */ /* scan input DA to get the actua l */ /* data length of each sqlvar and the */ /* total input data length */ /* If the JRA request type is com pile */ /* Skip the input data */ /* If data type is nullable, add two */ /* bytes to the actual data lengt h */ if ((in_da != NULL) && (!req_compile) && (!req_runstat)) { for (i=0;i < in_da->sqld ;i++ ) { sqlvar = &(in_da->sqlvar[i]); if (SQLV_IND_EXISTS(sqlvar) && (*(sqlvar->sqlind) < 0)) { act_len_in[i]=0; } else { act_len_in[i] = (unsigned long) sqlcpdls(sqlvar); } if ( (sqlvar->sqltype & SQL_TYP_NULINC) != 0) { dslenptr->in_data_len += SQLC_SHORT_SIZE; } dslenptr->in_data_len += act_len_in[i]; } /* endfor */ } /* end in_da check */ /* scan output DA to get the tota l */ /* output data length */ /* Skip this code if it is fetch and */ /* and blocking */ if (out_da != NULL && !req_blocking) { for (i=0;i < out_da->sqld ;i++ ) { sqlvar = &(out_da->sqlvar[i]); dslenptr->out_data_len += (unsigned long) sqlcpdlr(sqlvar); /* If the data type is nullable a nd */ /* the null indicator is not null , ask*/ /* the server to allocate space f or */ /* the null indicator */ if (((sqlvar->sqltype & SQL_TYP_NULINC) != 0) && (sqlvar->sqlind != NULL)) { dslenptr->out_data_len += SQLC_SHORT_SIZE; } /*If the null indicator exists, set */ /*the null indicator value to -1 . */ /*Otherwise, set the null indica tor */ /*to 0 */ if (sqlvar->sqlind == NULL) { sqlvar->sqlind = (short *) -1; } else { sqlvar->sqlind = (short *) 0; } } /* endfor */ } /* all length information pointed by */ /* dslenptr is set. Move length a rray */ /* into data stream */ /* If there is any communcation e rror */ /* occurs, exits */ if (in_da != NULL && (!req_compile) &&(! req_runstat) ) { err_retcode = sqlcpmd( ddsacb, &loc, (char *) act_len_in, sizeof(long)*(in_da->sqld), ca_ptr); if (err_retcode == SQLJR_RCF_TERMINATE) { goto exit; } } /********************************************************************* *******/ /* Create JRA parameters data stream */ /********************************************************************* *******/ /* points to the first JRA triple t */ triplet = (SQLJDATA *) &(dcsra->sqlrflgl); /* Loop through all the triplets */ for (i=0;i < MAX_JRA_TRIPLET ;i++ ) { /* Move JRA parmeters into data s tream*/ if (triplet->sqlrdtl > 0) { err_retcode =sqlcpmd( ddsacb,&loc,triplet->sqlrdtp, (unsigned int) triplet->sqlrdtl,ca_ptr); if (err_retcode == SQLJR_RCF_TERMINATE) { goto exit; } } triplet++; } /* endfor */ /********************************************************************** ******/ /* SQLJRA and parameters have been put */ /* into the communication buffer. */ /********************************************************************** ******/ /********************************************************************** ******/ /* Move the input DA into data stream */ /********************************************************************** ******/ if (dcsra->sqlrdapi != NULL) { /* Caculate the size of the DA */ da_size = SQLDASIZE(((struct sqlda *)dcsra->sqlrdapi)->sqld); /* Move DA into the com buffer */ err_retcode = sqlcpmd(ddsacb, &loc,(char *) (dcsra->sqlrdapi), da_size, ca_ptr); if (err_retcode == SQLJR_RCF_TERMINATE) { goto exit; } } /* End sqlrdapi check */ /********************************************************************** ******/ /* Move the output DA into data stream */ /********************************************************************** ******/ if ((out_da != NULL) && (!req_blocking)) { /* Move DA into the com buffer */ err_retcode = sqlcpmd(ddsacb,&loc,(char *) out_da, out_da_size,c a_ptr); if (err_retcode == SQLJR_RCF_TERMINATE) { goto exit; } } /* End sqlrdapo check */ /*********************************************************************** ******/ /* Put input data into datastream. */ /*********************************************************************** ******/ /* If input data exists */ /* and the JRA request type is no t */ /* compile or runstat */ if ( (in_da != NULL) && (!req_compile) && (!req_runstat)) { i = 0; /* Loop through all the sqlvars */ while ((ca_ptr->sqlcode == SQL_RC_OK) && ( i < in_da->sqld) ) { /* Get the next SQLVAR. */ sqlvar = &(in_da->sqlvar[i]); /* If the data type is nullable, send */ /* null indicator contents into t he */ /* datastream */ if ( (sqlvar->sqltype & SQL_TYP_NULINC) != 0) { if ((sqlvar->sqlind != NULL ) && ((short) *(sqlvar-> sqlind) != 0)) { err_retcode = sqlcpmd(ddsacb, &loc, (char *)(in_da->sqlvar[i].sqlin d), SQLC_SHORT_SIZE,ca_ptr); } else { err_retcode = sqlcpmd(ddsacb, &loc,(char *)&zero, SQLC_SHORT_SIZE,ca_ptr); } if (err_retcode == SQLJR_RCF_TERMINATE) { goto exit; } } /* Move the data into data stream */ if (act_len_in[i] > 0) { err_retcode = sqlcpmd(ddsacb, &loc,sqlvar->sqldata, (unsigned int) act_len_in[i],ca_ptr ); if (err_retcode == SQLJR_RCF_TERMINATE) { goto exit; } } i++; } /* endwhile */ } /* end compile request type check */ /* Process the remaining data in the */ /* com buffer */ if ((ca_ptr->sqlcode == SQL_RC_OK) && (loc > SQLC_SHORT_SIZE)) { /* Store the length into the buff er */ /* byte reversed */ buffer_len = SQLC_SWAP2(loc); sqlzmcpy(ddsacb->buffer,&buffer_len,SQLC_SHORT_SIZE); /* Send it */ retcode = sqlccsen(&ddsacb->comhandle,(short) loc,ddsacb->buff er); if (retcode < 0) { sqlcperc(&ddsacb->comhandle,ca_ptr,"SQLCPREQ"); err_retcode |= SQLJR_RCF_TERMINATE; goto exit; } } /* End of sqlcode and loc check */ /*********************************************************************** *******/ /* Cleaning things up */ /*********************************************************************** *******/ exit: /* Free tempory da */ if (out_da != NULL) { retcode = sqlofblk(ddsacb->rsheap,out_da_size ,out_da); /* Terminate if error on free */ if ( retcode != 0 ) { sqlcpsca(ca_ptr,"SQLCPREQ", (long) SQL_RC_E902) ; err_retcode |= SQLJR_RCF_SQLCA; } } /* Free dynamically allocated act ual */ /* length array for input DA */ if (alloc_flag_in > 0) { retcode = sqlofblk(ddsacb->rsheap, sizeof(long) * in_da->sqld,ac t_len_in); /* Terminate if error on free */ if ( retcode != 0 ) { sqlcpsca(ca_ptr,"SQLCPREQ", (long) SQL_RC_E902) ; err_retcode |= SQLJR_RCF_SQLCA; } } /*End if on free block check */ /* Free the da space allocated fo r */ /* run stat */ if (run_da != NULL) { retcode = sqlofblk(ddsacb->rsheap, run_da_size, run_da); if ( retcode != 0 ) { sqlcpsca(ca_ptr,"SQLCPREQ", (long) SQL_RC_E902) ; err_retcode |= SQLJR_RCF_SQLCA; } } return(err_retcode); }
【0033】
【発明の効果】以上説明したように、本発明によれば、
データ構造の再構成処理におけるメモリ割当て及びメモ
リ複写を改良することにより、改良されたデータベース
・サーバを提供することが可能となる。
【図面の簡単な説明】
【図1】本発明によるパーソナル・コンピュータ・シス
テムのブロック図である。
【図2】本発明による遠隔データベース要求のシステム
制御フローの例の図である。
【図3】本発明の詳細論理を示す流れ図である。
【図4】本発明による遠隔プロトコル・サーバの詳細論
理を示す流れ図である。
【図5】本発明により通信バッファ内にデータ構造を形
成する例の図である。
【符号の説明】
200 データベース・ランタイムAPIルーチン 210 ゲートウェイ・マッパ 214 データ構造(SQLJRA及びSQLDA) 220 SQLJRAデータ・ストリーム構成器 222 データ・ストリーム 230 通信バッファ 240/250 データベース・マネージャ移送ルーチ
ン 260 SQLJRAデータ構造構成器 270 ゲートウェイ・ルータ 280 データベース 420 合計メモリ空間(M) 510 SQLJRA 520 入力SQLDAポインタ 530 出力SQLDAポインタ 540 入力SQLDA領域 560/570 データ領域
フロントページの続き (72)発明者 リロイド・ユージーン・ジョーダン、セカ ンド アメリカ合衆国78729、テキサス州オース ティン、ベイスウォーター・ガーデン 13505 (72)発明者 シャウ−ベン・シー アメリカ合衆国78726、テキサス州オース ティン、クロスランド・ドライブ 11033 (72)発明者 マーティン・ジェイ・サーキン アメリカ合衆国78759、テキサス州オース ティン、ユッカ・ドライブ 10506 (72)発明者 ポール・エドウィン・ステファンス アメリカ合衆国78613、テキサス州シダ ー・パーク、サビナル・トレイル 2706

Claims (7)

    【特許請求の範囲】
  1. 【請求項1】第2のコンピュータ上のデータベースから
    情報をアクセスするために、第1のコンピュータ上のメ
    モリ内にデータ構造を構成するための装置であって、 (a)上記第1のコンピュータ上のデータベースからメ
    モリ要求データ構造を獲得する手段と、 (b)上記データベースからのメモリ要求データ構造及
    び情報を含む通信バッファを構成する手段と、 (c)上記通信バッファを上記第2のコンピュータに伝
    送する手段と、 (d)上記第2のコンピュータ上に上記通信バッファを
    受信する手段と、 (e)上記通信バッファ内の上記メモリ要求データ構造
    を調査する手段と、 (f)既に上記通信バッファに割当てられたメモリを使
    用して、第2のコンピュータ上のメモリ要求データ構造
    にもとづきデータ構造を形成する手段と、 を含むことを特徴とする装置。
  2. 【請求項2】最小変換を有する上記通信バッファを構成
    する手段を含むことを特徴とする請求項1記載の装置。
  3. 【請求項3】上記通信バッファ内の上記メモリ要求デー
    タ構造をアクセスするためのポインタを再割当てするこ
    とを特徴とする請求項2記載の装置。
  4. 【請求項4】第2のコンピュータ上のデータベースから
    情報をアクセスするために、第1のコンピュータ上のメ
    モリ内にデータ構造を構成するための方法であって、 (a)上記第1のコンピュータ上のデータベースからメ
    モリ要求データ構造を獲得するステップと、 (b)上記データベースからのメモリ要求データ構造及
    び情報を含む通信バッファを構成するステップと、 (c)上記通信バッファを上記第2のコンピュータに伝
    送するステップと、 (d)上記第2のコンピュータ上に上記通信バッファを
    受信するステップと、 (e)上記通信バッファ内の上記メモリ要求データ構造
    を調査するステップと、 (f)既に上記通信バッファに割当てられたメモリを使
    用して、第2のコンピュータ上のメモリ要求データ構造
    にもとづきデータ構造を形成するステップと、 を含むことを特徴とする方法。
  5. 【請求項5】最小変換を有する上記通信バッファを構成
    するステップを含むことを特徴とする請求項4記載の方
    法。
  6. 【請求項6】上記通信バッファ内の上記メモリ要求デー
    タ構造をアクセスするためのポインタを再割当てするこ
    とを特徴とする請求項5記載の方法。
  7. 【請求項7】第2のコンピュータ内に常駐するデータベ
    ースをアクセスする第1のコンピュータ内の装置であっ
    て、 (a)上記第2のコンピュータ上で実行するために設計
    されるデータベース照会を生成する手段と、 (b)上記第2のコンピュータ上で実行するために設計
    される上記データベース照会を含む通信バッファを上記
    第1のコンピュータ上に生成する手段と、 (c)上記通信バッファを上記第2のコンピュータに伝
    送する手段と、 (d)上記通信バッファを上記第2のコンピュータ上に
    受信する手段と、 (e)上記第2のコンピュータ上で実行するために設計
    される上記データベース照会を実行する手段と、 (f)上記データベース照会の結果を上記通信バッファ
    内に格納する手段と、 (g)上記通信バッファを上記第1のコンピュータに伝
    送する手段と、 (h)上記通信バッファを上記第1のコンピュータ上に
    受信する手段と、 を含むことを特徴とする装置。
JP5162257A 1992-08-03 1993-06-30 サーバ・メモリの管理 Pending JPH06282481A (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US07/923,633 US5412805A (en) 1992-08-03 1992-08-03 Apparatus and method for efficiently allocating memory to reconstruct a data structure
US923633 1997-09-04

Publications (1)

Publication Number Publication Date
JPH06282481A true JPH06282481A (ja) 1994-10-07

Family

ID=25449003

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5162257A Pending JPH06282481A (ja) 1992-08-03 1993-06-30 サーバ・メモリの管理

Country Status (2)

Country Link
US (1) US5412805A (ja)
JP (1) JPH06282481A (ja)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5875442A (en) 1992-08-03 1999-02-23 International Business Machines Corporation Method and apparatus for enhancing access to a remote database employing dynamic buffer management
US5764949A (en) * 1994-09-29 1998-06-09 International Business Machines Corporation Query pass through in a heterogeneous, distributed database environment
US5657447A (en) * 1995-08-31 1997-08-12 International Business Machines Corp. Platform-transparent registration and build of stored procedures and user-defined functions
US6240065B1 (en) 1996-01-08 2001-05-29 Galileo Technologies Ltd. Bit clearing mechanism for an empty list
IL116989A (en) 1996-01-31 1999-10-28 Galileo Technology Ltd Switching ethernet controller
IL116988A (en) * 1996-01-31 1999-12-31 Galileo Technology Ltd Bus protocol
US5933820A (en) * 1996-05-20 1999-08-03 International Business Machines Corporation System, method, and program for using direct and indirect pointers to logically related data and targets of indexes
US5881379A (en) * 1996-05-20 1999-03-09 International Business Machines Corporation System, method, and program for using duplicated direct pointer sets in keyed database records to enhance data recoverability without logging
US6230247B1 (en) 1997-10-29 2001-05-08 International Business Machines Corporation Method and apparatus for adaptive storage space allocation
US6598041B1 (en) 2000-09-07 2003-07-22 International Business Machines Corporation Method, system, and program for processing modifications to data in tables in a database system
US6990477B2 (en) * 2001-03-28 2006-01-24 International Business Machines Corporation Method, system, and program for implementing scrollable cursors in a distributed database system
US6856996B2 (en) 2001-03-30 2005-02-15 International Business Machines Corporation Method, system, and program for accessing rows in one or more tables satisfying a search criteria
US7222117B1 (en) 2003-11-14 2007-05-22 Advent Software, Inc. Segmented global area database
US7318075B2 (en) * 2004-02-06 2008-01-08 Microsoft Corporation Enhanced tabular data stream protocol
US8458217B1 (en) 2009-08-24 2013-06-04 Advent Software, Inc. Instantly built information space (IBIS)
US8769350B1 (en) 2011-09-20 2014-07-01 Advent Software, Inc. Multi-writer in-memory non-copying database (MIND) system and method
US8332349B1 (en) 2012-01-06 2012-12-11 Advent Software, Inc. Asynchronous acid event-driven data processing using audit trail tools for transaction systems
US8886671B1 (en) 2013-08-14 2014-11-11 Advent Software, Inc. Multi-tenant in-memory database (MUTED) system and method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH035846A (ja) * 1989-05-15 1991-01-11 Internatl Business Mach Corp <Ibm> リモート・アプリケーシヨン実行方式

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4511964A (en) * 1982-11-12 1985-04-16 Hewlett-Packard Company Dynamic physical memory mapping and management of independent programming environments
JPS62128332A (ja) * 1985-11-30 1987-06-10 Toshiba Corp デ−タ処理装置
US5008853A (en) * 1987-12-02 1991-04-16 Xerox Corporation Representation of collaborative multi-user activities relative to shared structured data objects in a networked workstation environment
US5014221A (en) * 1988-01-29 1991-05-07 Digital Equipment Corporation Mechanism for arbitrating client access to a networked print server
US5025491A (en) * 1988-06-23 1991-06-18 The Mitre Corporation Dynamic address binding in communication networks
US5301280A (en) * 1989-10-02 1994-04-05 Data General Corporation Capability based communication protocol
US5175817A (en) * 1989-11-20 1992-12-29 Digital Equipment Corporation Data representation protocol for communications between different networks
US5265250A (en) * 1990-03-29 1993-11-23 At&T Bell Laboratories Apparatus and methods for performing an application-defined operation on data as part of a system-defined operation on the data
GB2246883B (en) * 1990-08-07 1995-01-11 Matsushita Electric Ind Co Ltd Inference processor
US5179555A (en) * 1990-09-11 1993-01-12 Microcom Systems, Inc. High speed data compression and transmission for wide area network connections in LAN/bridging applications

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH035846A (ja) * 1989-05-15 1991-01-11 Internatl Business Mach Corp <Ibm> リモート・アプリケーシヨン実行方式

Also Published As

Publication number Publication date
US5412805A (en) 1995-05-02

Similar Documents

Publication Publication Date Title
EP3667496B1 (en) Distributed computing system, data transmission method and device in distributed computing system
JPH06282481A (ja) サーバ・メモリの管理
US9213529B2 (en) Optimizing just-in-time compiling for a java application executing on a compute node
US9086924B2 (en) Executing a distributed java application on a plurality of compute nodes
Welch et al. Pseudo devices: User-level extensions to the Sprite file system
US6078955A (en) Method for controlling a computer system including a plurality of computers and a network processed as a user resource
US5950188A (en) Database system with methods for executing system-created internal SQL command statements
US8595742B2 (en) Executing a distributed java application on a plurality of compute nodes in accordance with a just-in-time compilation history
US6654741B1 (en) URL mapping methods and systems
US20060095483A1 (en) Modified computer architecture with finalization of objects
US20080140937A1 (en) System and Methodology Providing Multiple Heterogeneous Buffer Caches
US20090125611A1 (en) Sharing loaded java classes among a plurality of nodes
US7028313B2 (en) Method for transmitting function parameters to a remote node for execution of the function thereon
US20020144020A1 (en) Method for transparent, location-independent, remote procedure calls in a hetrogeneous network environment
WO2023124543A1 (zh) 用于大数据的数据处理方法和数据处理装置
KR102326280B1 (ko) 데이터 처리 방법, 장치, 기기 및 매체
US7743333B2 (en) Suspending a result set and continuing from a suspended result set for scrollable cursors
US5893926A (en) Data buffering technique in computer system
JP2694109B2 (ja) 動的バッファ管理装置および方法
US7162490B2 (en) Method for processing dynamic database in distributed processing system based on corba platform
US7613710B2 (en) Suspending a result set and continuing from a suspended result set
CN112817922B (zh) 日志动态打印方法、装置、计算机设备及存储介质
US5021942A (en) Data processing system with packets specifying functions and arguments
US20020099919A1 (en) Method of memory management
KR20010041298A (ko) 분산 시스템에서의 원격 오브젝트의 상태를 판정하기 위한 방법 및 장치