I looked on Scott's website. I can only find JDBC examples. Unless the
customer is wrong, I need an ODBC example that is writing on the iSeries.
I changed Program A and the service program to run out of a unique
activation group.
Unless I am wrong, since the execution of Program B is via a call to QCMDEXC
(CALL QCMDEXC PARM(CALL Program B)) and QCMDEXC runs in QILE, there is no
way Program B can ever run in Program A's activation group. Even if it is
*CALLER, that would put it in QILE. PLEASE tell me if I am wrong.
I do not know what Program B's activation group is but I do know two
things...
1) There is no way it matches the activation group of Program A.
2) I can't make our customers change the activation group of every program
they want to put in our tool.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck
Calabro
Sent: Wednesday, November 29, 2017 7:13 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
<rpg400-l@xxxxxxxxxxxx>
Subject: Re: SQL with connections to multiple databases
On 29 November 2017 at 18:05, John R. Smith, Jr.
<smith5646midrange@xxxxxxxxx> wrote:
I know I can write a program on Windows or Unix that connects to DB2
via ODBC but is there an ODBC driver that runs on the iSeries to allow
an iSeries program to connect to the DB2 that it is running on?
Yes. See Scott Klement's web page for one example.
I'm guessing at this point that Program B is not cleaning up after
itself
It's the guessing part that makes this so hard. I've had success working
the problem from the other side; write an example that makes it always
behave this way. Simply thinking about how to write the minimal example to
demonstrate the situation has brought me to Aha!
about half the time. The other half, I've at least had code that
illustrates the problem. I have shown that code to my colleagues and to the
debugger :-) It sure beats the long feedback delay from the customer.
How do I get the job to disconnect from the QSQSRVR job before the
update in JOB_END?
I didn't see if you tried Dieter's suggestion. Something like
PROGRAM_A AG(FIRST_AG)
callp JOB_START() in SRVPGM_S ACTGRP(*CALLER)
callp PROGRAM_I ACTGRP(ISOLATION)
call PROGRAM_B ACTGRP(???)
ODBC/JDBC/SQL CONNECT/something to DB2
return to PROGRAM_I
CONNECT / RCLACTGRP ISOLATE / ?????
return to PROGRAM_A
callp JOB_END() in SRVPGM_S ACTGRP(*CALLER)
With this model, PROGRAM_A and the service programs it uses all run in
ACTGRP(FIRST_AG).
PROGRAM_I and service programs _it_ uses all run in ACTGRP(ISOLATION)
Program_B runs in... we're guessing ACTGRP(*CALLER), and if true, it will
now run in ACTGRP(ISOLATION), which presumably has nothing but CALL
PROGRAM_B in it.
Good luck.
--buck
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.