*DEFER won't really help - that just means that the service program is not loaded until a program attempts to call one of its procedures. As an aside, it is a very much more efficient way of working - we use *DEFER for all service programs and it makes that start up times and memory usage much better. Things are just "lazy loaded" on demand. Your issue will still occur as soon as program two calls a procedure in it.

We don't let Apache do anything with the library list. We ensure that every request goes through a routing program that sets the library list appropriately before calling the target program.

-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Vicki Wilson
Sent: 12 March 2016 03:48
To: web400@xxxxxxxxxxxx
Subject: Re: [WEB400] 500 Error when trying to call a program with a service

Click. The light bulb finally went off on the drive home from work.
This is actually a set of two programs. A header and a detail. The only service program reference is the detail program.When the header is first call and I sign-in a CGI job is established with my user and I can see that the library list has changed for that job. Then a header record is picked and the detail program is called. Again if any library list changes are triggered they happen here.I have a jquery dialog box as a form. The two ajax calls happen when the user tabs out of the field. I think the first ajax call is likely processed by my original job. And the second is probably initiating a new job. And the new job would not have had the library list set.

Re-reading Brad's response I think he explained that. But besides being frustrated with the problem I haven't had to pay much attention to the apache jobs.

I've been doing web work regularly for a few years but just did basic stuff. I thought I had the whole statelessness thing worked out - but clearly not. I'm stepping up the game with lots of javascript/jquery/ajax and having fun with it.

Now I'm wondering how to handle this - insight on QZHBHTTP would be helpful. Will have to test changes on Monday. Also wondering if the *DEFER that Charles mentioned will work. Or...
Thanks again Brad - your explanation was good I just needed to step away from the problem.

Vicki
From: Vicki Wilson <victwyh@xxxxxxxxx>
To: "web400@xxxxxxxxxxxx" <web400@xxxxxxxxxxxx>
Sent: Friday, March 11, 2016 4:34 PM
Subject: Re: 500 Error when trying to call a program with a service

Brad,
Nice explanation that explains how this work however the problem still isn't making sense.
The program is a websmart program and they do change the library list.Except the library list doesn't get changed until the program gets invoked. And in this case the program is not getting invoked.

I get a dump under a separate job with two spool files QZSRHTTPTR & QPJOBLOG.
QZSRHTPPTR looks like thisUser Trace Dump for job 909364/QTMHHTTP/LP_ACCESS. Size: 300K, Wrapped 0 times.
--- 03/11/2016 15:31:55 ---
0000033F:598216 ExceptionHandler_Default(), exception occurred
0000033F:598240 F4BAC17FAF:0064F0 L:0007 zsrvhjob.c : Exception ID:
0000033F:598256 F4BAC17FAF:0064F0 C3F2D4F1 F6F0F1 *C2M1601.........*
0000033F:598272 F4BAC17FAF:006530 L:0030 zsrvhjob.c : Exception data:
0000033F:598288 F4BAC17FAF:006530 F9F2998A 26FFDE20 00000000 00100000 *92r.............*
0000033F:598304 F4BAC17FAF:006540 C6E12686 C1003610 00000000 FE0F23B4 *F..fA...........*
0000033F:598320 F4BAC17FAF:006550 FFFFFFFF FE0D9310 00000000 00000002 *......l.........*
TRCTCPAPP Output
------------------------------

So I'm stumped as to why it sometimes executes correctly and other times not. And just to add a wrinkle to the picture - I have just realized the jobd for QZHBHTTP is different on production. A whole slew of libraries has been added to it including the program in question.
I can't seem to find much info on QZHBHTTP except for warnings about changing it. But I did see the suggestion on another midrange post to add the desired library to QZHBHTTP jobd.
This still does not explain the inconsistency of the execution. I did resolve the problem - by combining my two ajax calls to 1. In this case they all seem to execute correctly. Not a satisfactory resolution.And I'm still seeing this error in our logs for other executions. Thanks.Vicki
message: 3
date: Thu, 10 Mar 2016 13:52:23 -0600
from: Bradley Stone <bvstone@xxxxxxxxx>
subject: Re: [WEB400] 500 Error when trying to call a program with a
service program

Do both programs call a function in the same service program?

Do any programs you call manipulate the library list? Maybe leaving a library that contains the service program in the library list for one job, while another job hasn't called a program that adds this library?

Remember that calls to the HTTP server are not always to the same job (they are not persistent). If you have 3 requests coming in it will be split up (most of the time) to 3 different jobs.

So, lets say you run a CGI program from your browser. It adds library MYSRVPGM to the library list but does not remove it when it ends.

Now you call a CGI program (or a static page) that includes 2 AJAX calls.
Each call will most likely be run in a different job. The first call may get the first job (that we used earlier) and have no issues since MYSRVPGM is in the library list.

The second call will get a different (or even newly created in some cases) job without MYSRVPGM in the library list and crash with that error.

The idea is, don't think of web jobs as interactive green screen type jobs. They are "take requests as they come" and spread them out to available jobs. And, as before, sometimes new jobs are started depending on your server settings.

Brad
www.bvstools.com

On Thu, Mar 10, 2016 at 1:39 PM, Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

By default, the resolution happens when the program is
loaded(activated)...unless you have *DEFER specified for the service
program on the BNDSRVPGM() parm of CRTPGM. Once activated, the
program & services programs remain active till the activation group is
ended or reclaimed.

Do both Ajax calls call the same program?

Do both Ajax calls make use of procedures from the ITMCHNGSRV *SRVPGM?

Charles

On Thu, Mar 10, 2016 at 2:08 PM, Vicki Wilson <victwyh@xxxxxxxxx> wrote:

Charles,
I agree it's a library list issue. But I need to work my way back a
little to determine why the library list changed for the first ajax
call but not for the second???
I don't know the Apache config/QHTTPSVR jobs well enough to
understand
why
the job gets invoked correctly on the first call but not the second.
And I
don't know where to look. Also - I realize that maybe I'm assuming
that
the
binding reference is resolved every time the program is called. I
think this is correct.
Vicki Wilson








--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailing list To post a message email: WEB400@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailing list To post a message email: WEB400@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.




------------------------------

Subject: Digest Footer

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) digest list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.



------------------------------

End of WEB400 Digest, Vol 14, Issue 30
**************************************





--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/


________________________________

NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
25 Barnes Wallis Road
Segensworth East, Fareham
PO15 5TT

Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton, UK
SO15 2EA
VAT Registration Number 834 1020 74.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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 [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.