Re: Writing an Open Access handle that will either read/write to the Db2 file or make a REST call
Subject: Re: Writing an Open Access handle that will either read/write to the Db2 file or make a REST call
From: "D*B" <dieter.bender@xxxxxxxxxxxx>
Date: Wed, 16 Jan 2019 08:41:10 +0100
Arc-authentication-results: i=1; mx.google.com; spf=neutral (google.com: 184.108.40.206 is neither permitted nor denied by best guess record for domain of dieter.bender@xxxxxxxxxxxx) smtp.mailfrom=dieter.bender@xxxxxxxxxxxx
And if I were mapping to a DB2 table and needed to do read next type
operations that would matter to me - but I'm having trouble seeing why it
matters when I'm changing the UPDATE in the RPG to and SQL update on another
system. Normally doing that I'd be using some kind of handle/cursor/whatever
to keep track of the connection anyway and if that is stored in the state
info then I'm golden.
chain and insert are trivial. For update and delete it might depend, because
rla is using positioned updates. the best way to keep track of the position
I see, is a SQL cursor, but you can't create dynamicly cursor instances with
embedded sql, so you would end up with SQL CLI or use bind by copy.
Can't you handle all the state info you'd need by passing it a pointer back
to it in the stateInfo subfield?
The only issue I see at this time (other than having to do a handler for
each logical) is that if PGMA calls PGMB and both use the handler, and I
don't need to hit the web service...then I might have to pay for extra I/Os
to reposition the local table.
I suppose a bound by copy handler wouldn't have that problem. Didn't
realize that was a possibility.
For your requirement, making virtual nothing or call some other function
(might be REST or something else is all the same to me) we have two problems
- doing virtual nothing:
the handler would have the same logic, use the same file specification etc.
simply doing what the programm would have done itself, giving back the same
data. Using bind by copy this should be a technical one to one solution. Not
without effort, as all examples I've seen stay in the trivial area. I don't
see additional I/O needed, you should forget to worry about this, one REST
call will dominate hundreds of native I/O operations!!!
Maybe another aproach might be easier (and so better!!!). If the programm
would know what to do, I would think about to switch between two diffrent
implementations, one using the original f spec, another using OA. (or maybe
- calling some other function: Problems will come up, if you would have to
emulate ISAM access methods, especialy the positioning logic with reading
forwards and back. The called functions would need to translate this to SQL
logic!!! Another problem could be share and OVRDBF, this should be evaluated
very carefull. (sometimes I was told: we don't use ... and first evaluation
brought up, that they didn't have all sources of their programms...)
Some additional remarks: First heared of OA, my idee was to have a generic
OA handler translating all rla operations to SQL, with the final goal to
enable existing RLA programms to use true SQL indexes. This would decouple
RLA programms from the database without major changes, opening up the
possibility for redesign steps of the database.
This thread ...
Re: Writing an Open Access handle that will either read/write to the Db2 file or make a REST call, (continued)
This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact