[solved] Too many ampers derived from URL gives (FOC206) INSUFFICIENT MEMORY
I am passing wf a long url (via Post method) where there are hundreds of variables X1,X2... which are then being translated into amper variables &X1,&X2 etc and I get this message once a certain limit is passed.
(FOC206) INSUFFICIENT MEMORY IS AVAILABLE FOR PROGRAM/CACHE
Is there a simple method of increasing the memory available.
Regards
JohnThis message has been edited. Last edited by: hammo1j,
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 05, 2008, 06:28 AM
<JG>
John
Normally a FOC206 is associated with FOCUS not WebFOCUS.
Make sure that you do not have SET CACHE = nnnn anywhere in your code or in a profile.
This is not a valid setting in WebFOCUS and has been know to cause the problem.
December 05, 2008, 10:41 AM
hammo1j
Here's the code to create the error in WebFOCUS (sorry JG) With 100 iterations of :LOOP on our system it gives FOC206. With 2 or 3 it works fine. What also is surprising is the time taken to render by IE.
I didn't have time to work out the limit, but would be interested if anyone knows a way to increase since it seems quite small.
-* testinput.fex
-SET &ECHO=ON ;
-? &
FILEDEF HOLD DISK HOLD.FTM ( APPEND
-REPEAT : LOOP FOR &I FROM 1 TO 100
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD
END
-RUN
-:LOOP
DEFINE FILE HOLD
MSG_NO/I3 WITH COUNTRY = LAST MSG_NO + 1 ;
COUNTERR/A3=PTOA(MSG_NO,'(P3)','A3');
COUNTER/A3=LJUST(3,COUNTERR,'A3');
SPONSORX/A120V='<tr><td><input type=text name="COUNTR' || COUNTER || '" size="11" value="' || COUNTRY || '" >' || '</td></tr>' ;
END
-RUN
TABLE FILE HOLD
PRINT
SPONSORX AS 'Sponsor'
ON TABLE HOLD AS MESSAGES FORMAT HTMTABLE
ON TABLE SET PAGE-NUM NOPAGE
ON TABLE SET HTMLCSS ON
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Test Input</title>
</head>
<body>
<form name="form" method=post action="/ibi_apps/WFServlet">
<table width="100%" >
<tr>
<td width="100%" COLSPAN="2">
<INPUT TYPE="BUTTON" NAME="Submit" VALUE="Submit" onclick="submit();">
<input type=hidden name="IBIF_ex" id="IBIF_ex" value="testinput">
<input type=hidden name="IBIAPP_app" id="IBIAPP_app" value="UTILITIES">
<input type=hidden name="IBIMR_random" id="IBIMR_random" value=0>
</td>
</tr>
<tr><td nowrap width="100%">!IBI.FIL.MESSAGES;</td></tr>
</table>
</form>
</body>
</html>
-HTMLFORM END
-EXIT
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 05, 2008, 10:59 AM
j.gross
Two things to note:
1. Your amper vars are &COUNTR1, &COUNTR2, etc. If you shorten that to &X1, &X2, ..., the available memory will (I presume) stretch further.
2. If you name all the INPUT tags identically, the CGI process will index them (assigning the series of "name='X'" parameters to &X1, &X2, ...) -- so if the index numbers have no real significance you can further reduce the size of the generated HTML code, and the volume of data transmitted by the submit.
- Jack Gross WF through 8.1.05
December 05, 2008, 11:07 AM
GinnyJakes
John,
I just ran your code on our system and I didn't have any problems. I am on a Unix platform however.
moi non plus i changed &I to I changed REPEAT : LOOP to REPEAT :LOOP and didn't have any problems i'm on unix as is Ginny
something about providing code snippets... its simply irresistible... ya gotta try it
as jack says, shortening parm names as much as possible..i run in to this problem with long multidrills... the limit in length to a url in ie is 2k..i don't know if POST vs GET addresses that issue at all, does it?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 07, 2008, 02:41 PM
Jim Morrow
We have a process where we send over 150 varies in a query string from some Microsoft Excel VBA code. But we send is a one varaible seperated by ~ (tilta). It is parsed using the GETTOK function. Of course everything is positional.
The VBA also code "scrubbs" the input for special characters. Just about any thing other then a letter or number will cause problems, some place in the process.
Jim Morrow Web Focus 7.6.10 under Windows 2003 MVS 7.3.3
December 07, 2008, 05:02 PM
Waz
Post doesn't have the limitations of a GET.
I've passed a couple of thousand variables my self, most being small.
There is another post in this forum where Gerry says WebFOCUS has no limit on variable except for available resources.
I have also done what Jim has done pass a single long string delimited by a unique char or string.
The code you posted also works for me as well.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 07, 2008, 09:34 PM
susannah
and servlet is POST by default, is that right, Waz?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 08, 2008, 05:26 AM
hammo1j
Thanks very much guys for your input.
I did not make the point clear about where the problem occurs. This is not when the original HTML is rendered but when the Submit button is pressed.
Please could you let me know if you pressed Submit in your tests because I think this issue may have been resolved by a later release of wf because I note you are all on 766/767 who said it worked.
John
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 08, 2008, 08:59 AM
hammo1j
More stuff:
On failure I get this in the log.
12/08/2008 13:33:41 error in COMP: Memory Allocation Failure.
In addition it seems that the limiting factor is the size of the query string (ie variable name plus data ) which seems to have a maximum size of about 4800.This message has been edited. Last edited by: hammo1j,
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 08, 2008, 09:31 AM
GinnyJakes
Ok, I saved the posted code and ran it 6-7 times in succession and had no problems. I am on 7.6.5 and on AIX.
to set an echo prior to the execution of the fex I only got.
SET GRAPHSERVURL=http://electra:80/ibi_apps/IBIGraphServlet
SET GRAPHENGINE=GRAPH53
-INCLUDE testinput
Maybe I need to look at server traces...
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 08, 2008, 10:40 AM
hammo1j
looking at the wfservlet traces we can see that indeed it does build a .fex to run before your actual fex.
The variables in the querystring come across in the reverse order they are defined but there is no particular order in which they are issued as -set commands
The problem occurs because we are passing the query_string in site.wfs
<set> QUERY_STRING(pass)
wf obligingly reconstructs the string with a mass of concatenation which blows the execution stack!
So if you dont pass query_string you are ok!
I shall find a way around this.This message has been edited. Last edited by: hammo1j,
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 08, 2008, 01:23 PM
susannah
does it work if you escape the & in the qstring -SET &QUERY_STRING='COUNTR559=E+GERMANY'|'&|'|'COUNTR558=CROATIA'|'&|'|'COUNTR557=FRANCE'
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 08, 2008, 02:03 PM
hammo1j
It does not work when you escape. The problem is that the expression is too big.
The servlet builds the expression as a dummy query string from the HTML post portion of the query. If it was just passing a string, rather than doing a concatenation, then there would be no problem.
Unfortunately it seems there is no easy way of stopping QUERY_STRING being passed to the server by the servlet. See my other post!This message has been edited. Last edited by: hammo1j,
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 08, 2008, 02:06 PM
hammo1j
Could someone out there just confirm.
1. They have QUERY_STRING passed as an amper ie -? & shows up QUERY_STRING.
2. They can run the example fex and click on the submit button and not get FOC206.
3. What release they are on to do this.
This would be much appreciated so I could know if upgrading will solve the problem
Thanks for all the help so far
Regards
John
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
December 08, 2008, 04:04 PM
Waz
John,
I don't get QUERY_STRING
I have run the fex and clicked on the Submit button, and got no error.
I ran it on 7.1.6
Susannah, the method depends on the submission.
An HTML form can be either, METHOD=POST|GET
A URL call is always a GET.
A GET passes the parameters via the URL call, this has a limit. A POST passes the parameters via the header of the call.
Just added the code to the custom settings, and got the error
0 ERROR AT OR NEAR LINE 25 IN PROCEDURE _vartestfexFOCEXEC
(FOC206) INSUFFICIENT MEMORY IS AVAILABLE FOR PROGRAM/CACHE
Had to do this on 7.6.7 on Windows, not risking out Prod or Test environments.
Why do you need the QUERY_STRING ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 08, 2008, 05:52 PM
hammo1j
Hi Waz
Thanks for your answers.
Logging in from home before kip but I know its the start of the day in Oz. (How are those new posters which say you're looking for revenge on us Poms in 2012?)
The QUERY_STRING is used to check the contents of &IBIF_adhoc (IIRC) which is examined to see if it contains markers of a RA generated procedure in which case a filter proc is run from our site profile to counteract a security flaw in our ERP. No, not making that up.
The problem I need to solve is setting Querystring conditionally
Into my fex above and thus conditionally switch off the passing of QUERY_STRING.
Unfortunately my release 762 seems to give me QUERY_STRING no matter what.
But I would be interested to see if you could insert this line into the code you have running under 767 and see whether it stops the problem occuring. Then all!$? I would have to do is upgrade to 767...
Thanks for all your efforts. Put one on the Barbie for me!
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
<ifdef> NOPASSQUERY
QUERY_STRING=' '
<endif>
<set> QUERY_STRING(pass)
# this stops it being sent by default
# <set> QUERY_STRING(dontpass)
The dontpass syntax seems to be much better at stopping things than the nopass syntax but was not eventually used.
Now our input screens work ok with a lot of values.
Thank you very much everyone and, in particular, Waz
Regards
John
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
October 16, 2009, 06:48 PM
KeithD
We have a very large html "application" where we have had to code around the "save parameter" size issue by saving the parameters to an Oracle table and then retrieving for subsequent runs. We are able to save 20,000 bytes of saved parameters in a test application with only a few parameters being passed to the "save_my_parameters" fex. However, when we try to use the same coding in the large html application, we get the FOC206 error. I have reviewed the posts along this thread, but I am confused about where I need to place the various solutions to this problem.
Where do you put the following? fex or html
<ifdef> NOPASSQUERY
QUERY_STRING=' '
<endif>
<set> QUERY_STRING(pass)
# this stops it being sent by default
# <set> QUERY_STRING(dontpass)
Also, if I use this solution, do I lose the ability to pass ANY parameters to the "save_my_parameters" fex? I need to be able to pass about 8 parameters to the "save_my_parameters" fex.
ThanksThis message has been edited. Last edited by: KeithD,
7.6.9 Windows for development/reporting server, Unix webserver, Unix DB Server (Oracle) HTML, PDF and Excel