skip to main content
Getting started with OData : Setting OData options
 

Try DataDirect Cloud Now

Setting OData options

After configuring a schema map as described in Configuring an OData schema map, set the fields on the OData tab of a Data Source definition as follows:
1. Set OData options to the desired values:
*Data Source Caching — controls caching of results. A value of 0 results in a stateless session, requiring DataDirect Cloud to access the data store for each request. A value of 1, the default, allows DataDirect Cloud to cache results, improving performance for repeated requests for the same entity. DataDirect clears the cache after ten minutes of inactivity or at the end of a session.
*Page Size — controls the number of results returned in one response. By default, the value in this field is 0 which causes DataDirect Cloud to return up to 2,000 top-level entities per response. If the response contains more than 2,000 entities, the first 2,000 entities are returned and end of the response contains a link that the OData client can use to fetch the next set. You can set the page size by using values from 1 to 10,000. Client requests can also specify the size of results with query parameters as described in Paging through results.
*Refresh Result — determines whether DataDirect Cloud returns results from the cache (for entities in the cache) or queries the data source again. A value of 1, the default, allows DataDirect Cloud to satisfy requests from cached results. A value of 0 forces queries to the backend data store. If caching is not enabled, this parameter has no effect.
*Inline Count Mode — controls how DataDirect Cloud handles requests that include the $inlinecount parameter with a value of allpages. The response includes the total number of entities that satisfy the query. A value of 0 causes DataDirect Cloud to skip counting. A value of 1 causes DataDirect Cloud to run a separate query to get the count before the query that returns the entities. This can result in the first page of results being returned faster for large result sets for some data store types. A value of 2, the default, causes DataDirect Cloud to fetch all results and calculate the total number before returning the first page of results to the client.
*Top Mode — allows DataDirect Cloud to better handle requests that include the $top parameter. A value of 0, the default, indicates that clients using $top to limit result set size will rarely attempt to get additional entities using the $skip parameter. A value of 1 indicates that clients generally use $top and $skip together to paginate results.
*OData Read Only — controls read/write access. For a new Data Source definition, this option is not selected by default. For a Data Source definition where OData was enabled before this option was available, it will be checked by default. Remove the check mark to enable write access.
2. Click Update to save your work.
Now you are ready to test using an OData request.
Note: If you modify the schema map or change these settings, you need to update the Data Source definition.