<?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: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107696#M202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The library is documented as being NOT thread-safe.&amp;nbsp; You'll need to structure&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;your multi-threaded code to take this into account.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2013 12:12:54 GMT</pubDate>
    <dc:creator>VinceAngelo</dc:creator>
    <dc:date>2013-06-18T12:12:54Z</dc:date>
    <item>
      <title>CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107690#M196</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;Came across what looks to be a linux 64-bit specific bug when opening the same gdb twice (using different FileGDBAPI::Geodatabase instances) simultaneously - the CloseDatabase call is never returning.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ive attached some code to reproduce this (just need to modify the path to the gdb to point to something valid).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the same linux rhel6 (64 bit) machine, this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* works fine when built as 32-bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* hangs forever on the first CloseDatabase call (debugger shows it is stuck in FileGDBAPI::Geodatabase::CloseGeodatabase() ), when built as 64-bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its based on one of the samples, so Im just using "make" to build 64-bit and "make ARCH=32" to build 32-bit.. And Im using v1.3 of the API, but also happens with earlier versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume this is a fundamentally supported thing to do (?) - I can't see anything in the docs to the contrary..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 00:35:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107690#M196</guid>
      <dc:creator>SimonWood</dc:creator>
      <dc:date>2013-01-31T00:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107691#M197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What do you gain by opening the same geodatabase twice in the same application?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Multiple queries and/or inserts from a single connection are supported (though multi-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;threaded access is not).&amp;nbsp; Given the additional overhead, I'd think this would be a&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;practice to avoid, just on general principle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 01:35:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107691#M197</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2013-02-01T01:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107692#M198</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;Yep there is no specific reason to open the same geodatabase more than once... really just a consequence of the implementation (fitting the FileGDB API into existing data structures made this easiest thing to do). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will add in some reference counting code to handle this in my particular context.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 03:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107692#M198</guid>
      <dc:creator>SimonWood</dc:creator>
      <dc:date>2013-02-06T03:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107693#M199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Although having done that, it would still be good to avoid the hanging in this scenario to prevent occurences that are difficult to detect in client code (ie its not necessarily easy to resolve two paths to the same underlying file due to things like symbolic links, relative paths, alternative mount points, exotic file systems etc etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 20:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107693#M199</guid>
      <dc:creator>SimonWood</dc:creator>
      <dc:date>2013-02-07T20:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107694#M200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't imagine why this would only be happening on 64 bit Linux.&amp;nbsp; There have been some investigations into this issue, but I don't think any insight has yet been gained.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Having said that, you shouldn't have to resort to ref-counting of the geodatabase object in your application.&amp;nbsp; We are already doing that for you.&amp;nbsp; In general, the geodatabase depends on the single instance model for objects of various types.&amp;nbsp; For example, this includes the geodatabase and table objects.&amp;nbsp; When a call is made to open a geodatabase or table, we first search an object cache to see if that object has already been instantiated.&amp;nbsp; If so, rather than re-instantiating the same object, we add-ref the existing object and return a reference to it.&amp;nbsp; This avoids needless overhead, but also ensures that the internal state of the object remains consistent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 20:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107694#M200</guid>
      <dc:creator>DavidSousa</dc:creator>
      <dc:date>2013-06-03T20:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107695#M201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I too observed this issue, but on Windows-7 64-bit OS with C++ FileGDB 1.3 VS 2010 API.&amp;nbsp; I have a class that has Geodatabase as the member variable where in destructor of my class I am trying to close the Geodatabase and it gets destroyed when the instance of my class goes out of scope.&amp;nbsp; I designed my class assuming that each Geodatabase object is independent and can be used independently in their independent multiple threads.&amp;nbsp; But the above replies reveals that Geodatabase objects are pointing to the same memory internally, and hence leading to problems in our code. I think the same holds good for Table object as well.&amp;nbsp; If the internal implementation of Geodatabase wants to reuse the same instance and using reference counting internally, then it seems there is a bug in Geodatabase implementation that destructing or closing one instance is causing problems in other instance.&amp;nbsp; This problem is more evident in 64-bit.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help or suggestions on this issue would be of great help.&amp;nbsp; Otherwise I need to use my own reference counting mechanism as used by simonwood74.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 06:29:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107695#M201</guid>
      <dc:creator>ViksitAgarwal</dc:creator>
      <dc:date>2013-06-18T06:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107696#M202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The library is documented as being NOT thread-safe.&amp;nbsp; You'll need to structure&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;your multi-threaded code to take this into account.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 12:12:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107696#M202</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2013-06-18T12:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107697#M203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The library is documented as being NOT thread-safe.&amp;nbsp; You'll need to structure&lt;BR /&gt;your multi-threaded code to take this into account.&lt;BR /&gt;&lt;BR /&gt;- V&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, I have search the entire File Geodatabase API documentation and can find no text that states the FGDB API is not thread safe.&amp;nbsp; Can you point me to it, please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 19:46:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107697#M203</guid>
      <dc:creator>DaveBrann</dc:creator>
      <dc:date>2013-06-18T19:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107698#M204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is in the Unix read me file, but is missing from all of the others. It's been added in for the next release.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 21:03:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107698#M204</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2013-06-18T21:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107699#M205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The UNIX README states "3) There is no multi-threading support at this time.".&amp;nbsp;&amp;nbsp; But this is a little vague to me.&amp;nbsp;&amp;nbsp; Does that mean an app can only have a single thread accessing the FGDB API?&amp;nbsp;&amp;nbsp; Therefore, effectively have an STA environment for accessing the API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I would like to do is have several worker threads, such that each worker independently creates the Geodatabase object over an FGDB database, and create an EnumRows, iterates over the table rows, and then deleted all objects it created.&amp;nbsp;&amp;nbsp; The above discussion indicates there is a problem doing this at the Geodatabase object level.&amp;nbsp;&amp;nbsp; But could I have a locking mechanism to ensure only one thread accesses the Geodatabase object at a time?&amp;nbsp;&amp;nbsp; This won't work if the Geodatabase uses thread local storage or is a COM object that requires and STA thread, I suppose.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 12:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107699#M205</guid>
      <dc:creator>DaveBrann</dc:creator>
      <dc:date>2013-06-19T12:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107700#M206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The API does not use COM.&amp;nbsp; There are no COM objects, no STA, just C++ classes.&amp;nbsp; There is no use of thread local storage either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The limitation on multi-threading is due to the use of LibXML by the API.&amp;nbsp; LibXML has global state and cannot be used concurrently by more than one thread per process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There might be certain workflows that don't make any use of LibXML during processing.&amp;nbsp; In those cases, multi-threading might just work.&amp;nbsp; But even then, if an individual database or table was being accessed simultaneously by more than one thread it might lead to trouble.&amp;nbsp; It would be better to segregate access to tables to separate threads.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 15:03:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107700#M206</guid>
      <dc:creator>DavidSousa</dc:creator>
      <dc:date>2013-06-19T15:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107701#M207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks again for the information.&amp;nbsp;&amp;nbsp; It is very helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a post in the discussion, it was mentioned that FGDB code caches Geodatabase and Table objects and just reference count them if the same database and table are requested by an API user.&amp;nbsp;&amp;nbsp; If that is true, then it seems like it would not be possible to segregate access to tables in separate threads.&amp;nbsp;&amp;nbsp; Correct?&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 16:42:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107701#M207</guid>
      <dc:creator>DaveBrann</dc:creator>
      <dc:date>2013-06-19T16:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: CloseDatabase hanging on 64 bit Linux when same File Geodatabase opened twice</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107702#M208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It would mean using a separate thread for each table.&amp;nbsp; That is under your control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure this would work, but it's much more likely to work this way than it would if the same table was accessed by more than one thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This also assumes that whatever processing is happening is not making any use of LibXML in more than one thread at a time.&amp;nbsp; The main use of LibXML is when the API is doing anything related to schema, e.g., creating a new table, describing an existing table, adding or removing a column, etc.&amp;nbsp; All of those operations involve the use of XML.&amp;nbsp; But XML usage in minimized if all you are doing is opening a table and getting its rows.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 19:37:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/closedatabase-hanging-on-64-bit-linux-when-same/m-p/107702#M208</guid>
      <dc:creator>DavidSousa</dc:creator>
      <dc:date>2013-06-19T19:37:26Z</dc:date>
    </item>
  </channel>
</rss>

