1
votes

In my Flex Java BlazeDS application I fetch the data from DataBase by the following method.

  1. Request Data from Flex by initiating a RemoteObject call to Java
  2. Execute the respective query in Java, get the result set and pass the resultset as list back to Flex
  3. Recieve the data in resultHandler of the Remote Object, convert it into Array Collection and display the data.

While this procedure is the text book method for BlazeDS DataSerilization, the time taken is very huge when data contains millions of records. Please find some stats below.

  • Time taken to call Java from Flex : 5ms
  • Time taken to establish database connection : 3000ms
  • Time taken to execute query : 120ms
  • Time taken to iteriate through the resultset and add data to list : 8000ms
  • Time taken to pass data from Java back to Flex : 2000ms
  • Time taken to convert event.result to Array Collection : 6000ms

Total Time Taken : 19125ms (for MySQL DataBase) and more for Oracle DataBase for 143,000 records in database.

Clearly the problem lies while converting ResultSet into List in Java (have to iteriate each record) and while converting List to ArrayCollection in Flex.

Is there any methods or procedures where I could speed up the process.

One possible process may be is to avoid these iteriations in Java and directly pass the ResultSet to Flex. Is that possible???

1
Don't load 150000 records at once. Use a lazy loading strategy instead.RIAstar
I wonder what your code is to convert the event.result to an ArrayCollection. I wonder what your Java code is to iterate through your result set and add data to the list. I think 20 seconds for that many records is pretty good. On one app I've worked on; it takes, roughly, twice that to get that many records [and render it in a DataGrid]. In our case, we decided that it was such a fringe case that folks could wait.JeffryHouser

1 Answers

1
votes

Consider using a different database technology for example an ORM technology on the backend should be faster. Am currently working on an application that though does not pull a lot of records at once has a lot of Users that pull records at one and the ORM technology we chose gives us significantly faster response as compared to when we started the project using JDBC.