Pagination using Database or XPath?

0
We are using List View Control pagination widget and we tried it using both database and XPath.  Pagination response is more faster with XPath than DB. I have a strong belief that DB call should perform much better than XPath, however its not.  Can some one please clarify which one is better and why?  
asked
2 answers
1

You should read the documentation. You should never use the database option, unless you are building an offline mobile app.

 

Depending on how Mendix has implemented the data source Database, every call may try to access the offline database, and when it finds none, only then try to access the server database. This could be an explanation for the behavior you see (although it's just a guess).

answered
0

(I already started this answer before I saw Rom's response. I'll just post it anyway. I think Rom's answer is spot on.)

What type of app are you developing? Online/Offline and how many items does the list contain?

I assume that you are using the liew view control widget(s) to add paging functionality to a list view. And that you are changing the Data source properties of the List View between database and XPath.

It is important to understand the difference between the Database and XPath data source. I'll quote parts of the documentation below:

Database Source
If database is selected as the data source for a widget then the object or objects shown are retrieved directly from the database with a query. This data source is also supported in offline applications in which case the data will come from the database on the mobile device.

XPath Source
If database is selected as the data source for a widget then the object or objects shown are retrieved directly from the database with a query. As such, the data supplied is limited by the following factor:

  1. The access rules defined in the security section of the project.
  2. The XPath constraint supplied in the widgets settings.
  3. An association, if the widget is nested in another data widget and the data path described runs over an association.
answered