Query local geodatabase replica directly

3555
1
Jump to solution
09-25-2014 04:01 PM
JustinBurns1
New Contributor II

Hi,

Has anyone had success executing queries against a local (offline) geodatabase replica through non-ESRI libraries?  When we execute a query containing a JOIN statement using FMDatabase for iOS recently added records from all tables are essentially deleted.

For example, consider a geodatabase that has a point feature class representing baseball stadium locations (BallparkLocations), a table containing information on the team (TeamInfo) and tables for events (Events, Games, etc).  Say I create a new ball park and associated team info, using the ArcGIS Runtime SDK for iOS saveFeature method.  The records are linked by primary key/foreign key GUID values.  If I then turn around and execute a query using FMDatabase that contains a JOIN statement, something like:

SELECT e.Name, e.StartTime, g.Opponent FROM Events_evw e JOIN Games_evw g ON e.primaryGuid = g.foreignGuid WHERE e.BallparkGuid = '{some ballpark guid}'

The query executes fine and returns results, but the records I just added to BallparkLocations and TeamInfo are gone.  This is a real problem with complex applications since the SDK does not provide a means to execute complex select statements and querying multiple tables with the asynchronous blocks, the only option provided by the SDK, is very cumbersome.  Any ideas or lessons learned would be appreciated.

Thanks,

Justin Burns

Sr. Geospatial Developer

GISi

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JustinBurns1
New Contributor II

I think I found my issue.  I was creating multiple instances of the FMDatabase connection across threads.  I isolated each thread to have only one instance of FMDatabase and our issue appears to be resolved.  Hopefully this helps someone out.

View solution in original post

0 Kudos
1 Reply
JustinBurns1
New Contributor II

I think I found my issue.  I was creating multiple instances of the FMDatabase connection across threads.  I isolated each thread to have only one instance of FMDatabase and our issue appears to be resolved.  Hopefully this helps someone out.

0 Kudos