May 13, 2008

A couple of times in my recent past, I have experienced issues when I have a long running process working on SDE data that suddenly crashes.  On adding detailed logging in the code, I pinpointed the issue to the SDE connection being lost between the workstation and the server. One possible reason was our backup systems kicked in at mid-night causing the database to disconnect or maybe a network issue.

To add fault-tolerance in such cases, IWorkspaceFactoryStatus is a very handy interface. IWorkspaceFactoryStatus.WorkspaceStatus gives the current connected status to the SDE geodatabase. If the connection status is esriWCSDown, then use PingWorkspaceStatus method to check if the workspace can be reconnected to. If the PingWorkspaceStatus method returns a WorkspaceStatus of available, the open a new workspace. It is important to note that the old workspace can not be reclaimed.

ESRI Documentation is here and an interesting blog post on the topic is here


What’s Coming in ArcGIS 9.3

April 30, 2008

A very useful link listing all the new features coming in ArcGIS 9.3.

Here is the link (http://www.esri.com/software/arcgis/about/whats-coming.html)

Converting ESRI ITable to .NET DataTable

April 30, 2008

Ran into this interesting ArcObjects utility class yesterday.
To convert records of an ITable to an inMemory DataTable, use ESRI.ArcGIS.Utility.Converter.ToDataSet.

This works really well for data viewing.
However this interface seems to be now depracated and replaced with ESRI.ArcGIS.ADF.
The ToDataSet method is missing in the new interface.

Sample code:
ITable table = featureWorkspace.OpenTable(tableName);
IRecordSetInit recordSetInit= new ESRI.ArcGIS.Geodatabase.RecordSetClass();
recordSetInit.SetSourceTable(table, new QueryFilterClass());
IRecordSet recordSet= recordSetInit as IRecordSet;

System.Data.DataSet netDS = ESRI.ArcGIS.Utility.Converter.ToDataSet(recordSet);

Five Best Practices for Maintaining an ArcSDE Geodatabase

April 29, 2008

ArcSDE team has a very good blog posting on best practices for maintaining an SDE geodatabase. A must read for all users who are involved with working and maintaining geodatabases.

Here is the link