<?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 cast from IFeatureClass to ISchemaLock&amp;nbsp; (ARCGIS) in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/cast-from-ifeatureclass-to-ischemalock-nbsp-arcgis/m-p/257449#M6600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm programming with the ARCGIS Java SDK, in Eclipse.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to cast an &lt;/SPAN&gt;&lt;STRONG&gt;IFeatureClass &lt;/STRONG&gt;&lt;SPAN&gt;to an &lt;/SPAN&gt;&lt;STRONG&gt;ISchemalock&lt;/STRONG&gt;&lt;SPAN&gt;. This cast is supposed to be allowed. There is an example of this cast in: &lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I try to perform this cast in my code, an exception appears:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception in thread "main" java.lang.ClassCastException: com.esri.arcgis.geodatabase.IFeatureClassProxy cannot be cast to com.esri.arcgis.geodatabase.ISchemaLock&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to make this cast on an IFeatureClass ? Here is the code to perform this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//Attempt to acquire an exclusive schema lock on the feature class.
ISchemaLock schemaLock = (ISchemaLock)featureClass;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate if you could try this simple line of code in one of your programs, and let me know if you get an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep me posted...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:41:18 GMT</pubDate>
    <dc:creator>EricPlante</dc:creator>
    <dc:date>2021-12-11T12:41:18Z</dc:date>
    <item>
      <title>cast from IFeatureClass to ISchemaLock  (ARCGIS)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cast-from-ifeatureclass-to-ischemalock-nbsp-arcgis/m-p/257449#M6600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm programming with the ARCGIS Java SDK, in Eclipse.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to cast an &lt;/SPAN&gt;&lt;STRONG&gt;IFeatureClass &lt;/STRONG&gt;&lt;SPAN&gt;to an &lt;/SPAN&gt;&lt;STRONG&gt;ISchemalock&lt;/STRONG&gt;&lt;SPAN&gt;. This cast is supposed to be allowed. There is an example of this cast in: &lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I try to perform this cast in my code, an exception appears:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception in thread "main" java.lang.ClassCastException: com.esri.arcgis.geodatabase.IFeatureClassProxy cannot be cast to com.esri.arcgis.geodatabase.ISchemaLock&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to make this cast on an IFeatureClass ? Here is the code to perform this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//Attempt to acquire an exclusive schema lock on the feature class.
ISchemaLock schemaLock = (ISchemaLock)featureClass;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate if you could try this simple line of code in one of your programs, and let me know if you get an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep me posted...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cast-from-ifeatureclass-to-ischemalock-nbsp-arcgis/m-p/257449#M6600</guid>
      <dc:creator>EricPlante</dc:creator>
      <dc:date>2021-12-11T12:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: cast from IFeatureClass to ISchemaLock  (ARCGIS)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cast-from-ifeatureclass-to-ischemalock-nbsp-arcgis/m-p/257450#M6601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi again Eric,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Moving you post to the ArcObjects forum so you geta better reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However if you need any Runtime Java API info, we can help you loads &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 13:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cast-from-ifeatureclass-to-ischemalock-nbsp-arcgis/m-p/257450#M6601</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2013-04-23T13:18:54Z</dc:date>
    </item>
  </channel>
</rss>

