<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unstable Row.Handle in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unstable-row-handle/m-p/789496#M1432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're correct. &amp;nbsp;`Row.Handle` is not stable. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under the hood, the Handle property is just a pointer to an underlying ArcObjects object. &amp;nbsp;When you open the same table twice, ArcObjects reuses the same COM objects, so Table.Handle is identical for both Table objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With rows, this isn't true. &amp;nbsp;Fetching the same two database rows with two cursors will create two different row objects (and different Row.Handle values). &amp;nbsp;Flipping it around, if you use a recycling cursor, all of the rows fetched from that cursor will use the same underlying object, and Row.Handle will be the same for every one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Since I've seen your other post, I'll also add that Table.Handle will have a different value every time you start ArcGIS Pro.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2020 16:10:53 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2020-05-26T16:10:53Z</dc:date>
    <item>
      <title>Unstable Row.Handle</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unstable-row-handle/m-p/789495#M1431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Row.Handle property is not stable but it should according to the docs:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#unique-instancing" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#unique-instancing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Other handles are. Table.Handle for instance. Am I doing something wrong? Help is much appreciated, thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code snippet below is a unit test. The Row.Handle is not stable in Pro App context either, e.g. running in QueuedTask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Test&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Compare_row_handles_SDE_LearningTest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; osaConnection &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;DatabaseConnectionProperties&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;EnterpriseDatabaseType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Oracle&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		Instance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"bla"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
		AuthenticationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; AuthenticationMode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OSA
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

	&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; geodatabase &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Geodatabase&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;osaConnection&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; featureClass &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geodatabase&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OpenDataset&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureClass&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"foo"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; row0 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetRow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2453&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; row1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetRow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2453&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

		Console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"rows are equal: {0}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Equals&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row0&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		Console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"rows are reference equals: {0}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ReferenceEquals&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row0&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		Console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"row handles are equal: {0}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Equals&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row0&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Handle&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Handle&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

		Assert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AreNotEqual&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row0&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Handle&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Handle&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; Row &lt;SPAN class="token function"&gt;GetRow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Table table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;long&lt;/SPAN&gt; oid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; table&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Search&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryFilter&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		WhereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $&lt;SPAN class="string token"&gt;"{table.GetDefinition().GetObjectIDField()} = {oid}"&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MoveNext&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; row &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		Assert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MoveNext&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"more than one row found"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;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PAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:01:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unstable-row-handle/m-p/789495#M1431</guid>
      <dc:creator>DanielRoth</dc:creator>
      <dc:date>2021-12-12T09:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unstable Row.Handle</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unstable-row-handle/m-p/789496#M1432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're correct. &amp;nbsp;`Row.Handle` is not stable. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under the hood, the Handle property is just a pointer to an underlying ArcObjects object. &amp;nbsp;When you open the same table twice, ArcObjects reuses the same COM objects, so Table.Handle is identical for both Table objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With rows, this isn't true. &amp;nbsp;Fetching the same two database rows with two cursors will create two different row objects (and different Row.Handle values). &amp;nbsp;Flipping it around, if you use a recycling cursor, all of the rows fetched from that cursor will use the same underlying object, and Row.Handle will be the same for every one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Since I've seen your other post, I'll also add that Table.Handle will have a different value every time you start ArcGIS Pro.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2020 16:10:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unstable-row-handle/m-p/789496#M1432</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2020-05-26T16:10:53Z</dc:date>
    </item>
  </channel>
</rss>

