Select to view content in your preferred language

Refresh SDE Table or FeatureClass

2159
4
02-20-2013 12:39 PM
AlexeiB
Deactivated User
I have a timer which queries a Table (Table1) in SDE every 30 seconds. I have another 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 am using IFeatureWorkspace to both make entries into the table and query it.

Do I need to release the IFeatureWorkspace in the same fashion as a Cursor so the next time it connects it establishes a brand new connection?

Any suggestions would be appreciated.

Thanks,
0 Kudos
4 Replies
VinceAngelo
Esri Esteemed Contributor
You've left out  a lot of necessary details (version of ArcGIS, RDBMS, version of ArcSDE,
critical code blocks for review), but that's actually okay, since you'd probably be better
off posting this (with those details) over in the ArcObjects forum. 

The important thing to keep in mind is that databases work hard to preserve a consistent
view of tables inside a transaction -- You want to defeat this feature, so you need to make
sure each new query is within a new transaction (not a new connection; that would be
far too wasteful).  The AO folks should be able to translate that into API calls for you.

- V
0 Kudos
AlexeiB
Deactivated User
Thanks for the direction Vince, I'll take my problems elsewhere (ArcObjects forum) 😉
0 Kudos
Vara_PrasadM_S
Frequent Contributor

Hi Alexei B‌,

Could you please let me know what solved your problem. I am running into a similar issue.

Thanks in advance!

With Regards,

Vara Prasad

0 Kudos
Vara_PrasadM_S
Frequent Contributor

Can be done through IVersion::RefreshVersion

0 Kudos