Standalone tables are getting scrambled in SQLite geodatabases

907
10
Jump to solution
01-24-2017 08:57 AM
AndyWright
Occasional Contributor

I've created a SQLite geodatabase from within ArcMap 10.4.1 by sharing its contents as Runtime Content.  There are 28 map layers in there and 10 standalone tables.  The geodatabase gets created successfully and a I can load all map layers and tables into the map in my application without issue.  The problem surfaces when I try to instantiate a GeodatabaseFeatureTable object against one of the standalone tables.  The table name is correct which makes you think you've got the right stuff, but the fields collection contains fields that are part of a completely different table.  Obviously that makes it pretty, pretty hard to do anything meaningful with respect to the tables.  Prior to running into this issue I had been using a SQLite geodatabase with 28 map layers and 1 standalone table in it and had no problems with queries against that 1 table. 

Has anyone else experienced this or worked around it?  I've been running into quite a few issues with this API lately and calling in a ticket to tech support has been, shall we say, painful at best.  It doesn't appear that Esri has resources that are familiar with the new API and how to set up and recreate even minor issues.  So hopefully someone from the development team can help us all out here.  Thanks in advance ...

0 Kudos
1 Solution

Accepted Solutions
AndyWright
Occasional Contributor

Hi Michael,

I was able to give this a shot on 10.5 and all seems well in the SQLite geodatabases with more than one standalone table.  I still have not had the chance to dig into Christopher's suggestion, but I am going to be pushing our customers to use 10.5 for this type of workflow.

View solution in original post

10 Replies
MoreHavoc
New Contributor III

I have had this problem before.  I have found that when exporting to a .geodatabase, the tables get kind of "crossed" in the process.  I tried testing an export in 10.5 and I don't see the issue at the moment.  The way I got around it was to edit the configuration tables in the .geodatabase.  I believe the issue was in GDB_Items, the Name, Path and Description columns didn't all match, they were crossed.  I fixed it by updating that table so that the records all matched for the appropriate table.  I wrote a Python script to just alter the rows in the database via SQLite.

My experience was similar to yours in that the FeatureClasses always came out right, but the tables had the wrong schema, seems to only happen when there are multiple tables.

Does that help?  I have done a fair bit of digging around in those system tables, so let me know if I can be of more assistance.

AndyWright
Occasional Contributor

Hi Christopher,

Thanks for the feedback.  The first thing I was going to ask you was if you had reported this to Esri as a bug, but based on your comment about not seeing it in a 10.5 created geodatabase I'll assume this bug no longer exists at that version.  I'll head down the path you described and let you know if I hit any walls.  Thanks again man ...

Andy

0 Kudos
AndyWright
Occasional Contributor

Hi Christopher,

Would you be able to give some more specifics on exactly what you did and/or post some code snippets?  I haven't been able to crack the code of what's going on under the hood in the Esri maintained tables.  We've actually found that it's not just the tables that are problematic, but the data in the fields seems to be jacked up as well.  We'd love to just go to 10.5 and be done with it, but this customer isn't ready to make the move yet.  Thanks a lot for your help ...

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

What version of ArcGIS Desktop is your customer using?

Cheers

Mike

0 Kudos
AndyWright
Occasional Contributor

10.4.1

0 Kudos
MoreHavoc
New Contributor III

Hey Andy,

In my case, the data in the tables was correct, it was just the metadata that was all messed up.  If the data in the fields is messed up, it may be really hard to fix.  

I don't have 10.4.1 right now, so I can't build a test database and look.  I would try making a really simple one with maybe a couple of feature classes and a couple of tables, and then start poking around that GDB_Items table and see what things look like.  You may have to actually pull out that XML string and look at it and see if there are any issues there.  I seem to remember that I had to pull out the XML and make a few changes, and then put it back in a different row (the one that actually matched the table).  

If you make a database and want to send it over I'm happy to look at it and see what I can see, I just can't build one right now.

Christopher

MichaelBranscomb
Esri Frequent Contributor

Hi,

I believe it was addressed in 10.5 as: 

BUG-000092058 The Share As menu item to create ArcGIS Runtime Content does not generate the correct .geodatabase files for stand alone tables (http://downloads.esri.com/support/downloads/other_/105-IssuesAddressedList_12082016.pdf).

Cheers

Mike

AndyWright
Occasional Contributor

Hi Michael,

I was able to give this a shot on 10.5 and all seems well in the SQLite geodatabases with more than one standalone table.  I still have not had the chance to dig into Christopher's suggestion, but I am going to be pushing our customers to use 10.5 for this type of workflow.

MichaelBranscomb
Esri Frequent Contributor

Hi,

Just recalled that there was another issue addressed in 10.5 that you might also be running into in the same area:

BUG-000095159 The QueryRelatedAsync method in ArcGIS Runtime SDK for .NET returns the following error, "Exception: Item not found in the database." http://downloads.esri.com/support/downloads/other_/105-IssuesAddressedList_12082016.pdf 

Cheers

Mike

0 Kudos