AnsweredAssumed Answered

ArcSDE Query (Stale/Refresh)

Question asked by koder303 on Feb 21, 2013
Latest reply on Feb 21, 2013 by koder303
I have a timer which asynchronously (via a WebService) queries a Table (Table1) in SDE every 30 seconds. I have another WebService component which makes entries into Table1 every 15 seconds. The problem is, once the first query on Table1 is made, it seems to "lock it" and does not detect new rows inserted by the second component. So before the first entry is made, my row count is 5. After a row is inserted, my count is still 5. After another row is inserted, my count remains at 5. If I restart the program, my row count is now 7 and the same process is repeated.

Inspecting the data through Catalog I am able to see the new entries being made every 15 seconds but only after I right click on the database and do a Refresh. I suspect I need to do something similar in C# but am unsure how (yet).

I have tried to release all components using System.Runtime.InteropServices.Marshal.ReleaseComObject() to no avail.

IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)ws; IFeatureClass myFC = featureWorkspace.OpenFeatureClass("Table0"); ITable myTBL = featureWorkspace.OpenTable("Table1"); IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)ws;


I get some info from myFC and use that to query myTBL. But again, the problem is after I query the Table1, those values seem to get "cached" and the same values are returned every other query attempt until I restart the program.

Specs:
ArcGIS Server 9.3.1
SQL Server 2005

Thanks,

Outcomes