1.a: Our web services are stateless. So the memory consumption only lasts the duration of the service call-response.
The server side does not keep locks outside of the call-response cycle. Commitment control ends after the service call is completed.
For us this means record locks are released after the response is sent to the front-end (Rich UI).
1.b: We don't have a progress bar, because it is not necessary if the response is very fast.
2: We issue a get next with an integer specifying the start index within the resultset
Downsides:
No frontend searching or sorting
If you want to be able to jump to the last page, you need an extra return value specifying the total number of records returned by the query. You could loop through all the results, but we chose to execute a separate query with a count, because this is much faster than retrieving all the results.
so: the process for searching with us is:
User enters a search
- The rui application calls a service with the following parameters: search parameters, startindex (1), numberOfRows (20)
- The web service executes a prepare and an open statement. (at this time I believe nothing is retrieved in our java web service yet, no load on the heap space)
- The web service executes a for statement, retrieving record by record with a get next.
- Only when our for counter is at startindex (1 in this case), we start by copying the result from the get next into our result array.
- If we are at startIndex + numberOfRows (21 in this case), we exit the for loop and return the results in the result array to the rich ui application.
- All locks on the database are released, because the logical unit of work (on the service side) has completed.
-
When the users asks for the next page the same logic is ran again, but with startindex 21 and numberOfRows 20.
The first 20 records are looped through but not added to the result array. records 21 through 41 are added. At 41 we return the results.
Kind regards,
Bram
Bram_Callewaert