barbaragg

Create feature in Annotation feature class (ArcSDE Oracle)

Discussion created by barbaragg on Jul 30, 2012
I have to copy features from Annotation feature class in FilegeoDB (ArcGIS 10) to another Annotation Feature Class (ArcSDE Oracle 10).
I use the Store Method to insert new feature and CreateFeature Method.
When I use
pFeatureDest = pFeatureClassDest.CreateFeature();
RAM grow up and my application crash.

I have no problem when I copy feature from Filegeodb to Filegeodb; in this case RAM is released with FinalReleaseComObject Method.

How can I release RAM in Oracle?

This is my code:

IFeatureCursor pFeatureCursorAnno = pFeatureClass.Search(pQueryFilter, false);
IFeature pFeatureAnno = pFeatureCursorAnno.NextFeature(); //feature to copy in pFeatureClassDest
IFeature pFeatureDest = pFeatureClassDest.CreateFeature();       //new feature
while (pFeatureAnno != null)
{
pFeatureDest = pFeatureClassDest.CreateFeature();  //at this point RAM grow up and I cannot relaese RAM
IFields fields = pFeatureClass.Fields;
int iField = 0;
string[] arrayCampi = sElencoCampiDaAggiornare.Split(';');
pFeatureDest.Shape = pFeatureAnno.ShapeCopy;
foreach (string sCampo in arrayCampi)
{
  if (sCampo != "")
  {
   iField = pFeatureClassDest.Fields.FindField(sCampo);
   if (iField > 0)
    pFeatureDest.set_Value(iField, pFeatureAnno.get_Value(pFeatureClass.FindField(sCampo)));
  }
}
pFeatureDest.Store();
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(pFeatureDest);
numRec++;
pFeatureAnno = pFeatureCursorAnno.NextFeature();
}

System.Runtime.InteropServices.Marshal.FinalReleaseComObject(pFeatureAnno);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(pFeatureCursorAnno);

Thanks
Barbara

Outcomes