Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic pagination of rich:dataTable/rich:datascroller with large datasets

I currently have a Richfaces dataTable bound to a backing bean that contains all the data. This table is bound to a Richfaces data scroller.

Users can then enter scroll between the data.

There is also a text box that dynamically updates the data table results displayed to them, based on text they enter into it. It reRenders the dataTable and datascroller on the keyUp event.

The backing bean it’s bound to first pulls all the data from a number of database tables. This data is pulled when the user submits a normal post request to the server, and it’s the results of this request that are used for all subsequent Ajax related queries (Results saved as list of objects, no more database calls made).

I have a problem in that the dataset can be huge at times, 100,000s of records. This causes the initial request to the server to take a very long time.

A possible solution I'm looking at is pulling back only a small amount of the data in one thread for the initial user port request. This data can then be displayed in the data table while the main thread works in the background pulling the bulk of data back.

Is this feasible? Would it be possible to update my datatable/datascoller as the main thread pulls back new data? Would it be difficult?

Database and query optimization has been looked at, so no more improvements of any significance can be made there.

Thanks in advance (I know this probably is not an easy question to answer)

like image 578
Thomas Buckley Avatar asked Oct 13 '22 17:10

Thomas Buckley


1 Answers

Implement SerializableDataModel to hold your data for sorting and paginating.

like image 147
nesvarbu Avatar answered Oct 18 '22 04:10

nesvarbu