Select to view content in your preferred language

Is there danger of getting cached data when querying a featurelayer that has been added to the map?

121
3
Jump to solution
3 weeks ago
Gurunara
Occasional Contributor

Found that by adding featurelayers to the current active map using something like:

LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, MapView.Active.Map);

it's faster to query against this feature layer using:

var featureLayer = //get from layer added to map already

using (var table = featureLayer.GetTable())
var queryFilter = new QueryFilter
{WhereClause = whereClause,};
using (var rowCursor = table.Search(queryFilter))
...



I know there is a setting on the featurelayer from ArcPro to refresh the layer periodically... (see attachment)

My concern is does this mean that data can be stale between these refresh intervals, or even if the setting is turned off? Does query return the latest/real time data always, or does it return the cached data?

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

@Gurunara 

A direct query to the data/layer made in the SDK should always hit the database.

View solution in original post

0 Kudos
3 Replies
UmaHarano
Esri Regular Contributor

@Gurunara 

A direct query to the data/layer made in the SDK should always hit the database.

0 Kudos
Gurunara
Occasional Contributor

So (just to confirm) you're saying that the query i am using, as below, is always hitting the database?

var featureLayer = //get from layer added to map already

using (var table = featureLayer.GetTable())
var queryFilter = new QueryFilter
{WhereClause = whereClause,};
using (var rowCursor = table.Search(queryFilter))
...

Thanks.

0 Kudos
UmaHarano
Esri Regular Contributor

Correct! It should query the underlying database. 

0 Kudos