Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3585

Re: XSJS out of memory error

$
0
0

Hi Thomas,

 

Same problem here. I need to generate and download a BIG text file. Knowing that XS doesn't handle big result sets that good, we usually generate the file at the database level, concatenating the strings into a CLOB.

 

But, unfortunately, by using the SQL command CONCAT in HANA the maximum length of the concatenated string is 8,388,607 and we need more than that. Send it to the application cause an out of memory error and as you said above, it's not a good idea..

 

I was trying to understand this sections of the XS Reference:

 

The second parameter of setBody method cannot be used for a mult-part respose ?


setBody(body, index)

Sets the body of the entity; The method supports all elemental JavaScript types, ArrayBuffers, WebResponses and WebEntityResponses. When using WebResponse or WebEntityResponse as arguments, the headers identifying that the body is a WebResponse/WebEntityResponse (Content-Type: application/http, content-transfer-encoding: binary) are automatically added to the parent WebEntityResponse.

Parameters:
NameTypeArgumentDescription
bodyany | ArrayBuffer | $.web.WebResponse |$.web.WebEntityResponseCan be any elemental JavaScript type, an ArrayBuffer, WebResponse or WebEntityResponse.
indexNumber<optional>If the first argument is of type ResultSet, the number specifies the index of a Blob column.

 

 

And we also have this example ;

 

Example
// Handling of multipart requests and responses in xsjs files:var i;var n = $.request.entities.length;var client =new $.net.http.Client();for(i =0; i < n;++i){var childRequest = $.request.entities[i].body.asWebRequest(); client.request(childRequest, childRequest.headers.get("Host")+ childRequest.path);var childResponse = client.getResponse();var responseEntity =  $.response.entities.create(); responseEntity.setBody(childResponse);}

 

But none of those were able to handle a mult-part response for downloading... That leaves me with my hands tied, I can't generate the file using the database neither using the XS, I've to go back and generate it using ABAP. I look forward for the improvement in the XS to handle this kind of situation..

 

Thanks a lot!


Viewing all articles
Browse latest Browse all 3585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>