Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

DSRequest - setStreamResults("true")

$
0
0
Hi isomorphic,

My enviorment is:

SGWT Power Edition 3.1-p Build 19-05-2013
Apache Tomcat with Java 1.6.0_30
MySQL Connector Driver 5.1.25 Build 28-06-2013
Browser Firefox


I am trying to fetch a large dataset from a MySQL table and I am using the attribute setStreamResults() on the DSRequest as I checked on forums.

I use the following code to fetch the data from the datasource:

Code:


DSRequest req = new DSRequest();
req.setStreamResults("true");
req.setOperationId("registroResumen");

DSCallback callback = new DSCallback() {
@Override
public void execute(DSResponse response, Object rawData, DSRequest request) {
                   
        registro = response.getDataAsRecordList();
                                                                               
        for (int i=0;i<registro.getLength();i++)
        {
                                                                                       
                System.out.println(registro.get(i).getAttribute("posicionRegistro"));                                                                                       
        }

}

};

Datasource.get("registro").fetchData(null, callback, req);

It fetches correctly the datasource and it works but it appears a memory leak.

Using a profiler I have checked that each time I fetch the datasource the resultset is retained on memory (It shows that there are instances of jdbc4Resultset class retained on memory) so it seems to be that the resultset is not closed after executing the query.

Could please tell me if this is the correct way of fetching a large dataset and also, could you please check if this is a bug on the streamResults functionality.

Thank you very much and I am looking forward your news.

Best regards,

Pablo

Viewing all articles
Browse latest Browse all 4756

Trending Articles