JMC Hangs - Local SQLite Database locked - after getting new comments

Administrator Seatech August 18, 2014

I am using the latest JMC tag named "tip" and I am using JIRA on demand

I just incorporated JIRA mobile connect into my ios app and it is behaving a bit oddly.

After turning the debug mode on, I was able to dig a bit deeper and I find the source of this problem is that the sqlite database is locked.

The sequence of events is like follows:-

1. I launched my app for the first time

2. I created an issue successfully using JIRA mobile connect

3. I shut down my app

4. I updated the issue by adding comments in JIRA online via the web interface

5. I re-started my ios app

6. JMC gets the updates from JIRA rest api using https://xxxx.atlassian.net/rest/jconnect/1.0/issue/updates?sinceMillis=1408380024967&uuid=9371F70F-12CD-47EC-AB3E-4B0398FF453E&apikey=YYY&project=AAA- and it is able to find the updates that I had made in step 4

7. Since it finds changes,

JMCIssueStore.m

calls

updateWithData

method which has logic in it i.e.

[self createSchema:YES]

which attempts to drop the existing 2 tables and recreate the schema.

8. On the 1st table drop attempt i.e.

[db executeUpdate:@"DROP table if exists ISSUE"],

the database is found to be locked and JMC goes in an infinite loop retrying to execute this statement.

Has anyone encountered this or something similar? Any pointers would be greatly appreciated.

3 answers

1 accepted

1 vote
Answer accepted
Administrator Seatech August 20, 2014
The whole issue stemmed from a documentation error in the integration process of JIRA Mobile Connect specifically step 9 here where they asked to exclude all the JMC files from using ARC - which I had done. This is the root cause of the problem.

After going through the Angry Nerds JMC files and comparing it with my own, I realised they were exactly the same and still the Angry Nerds sample worked and mine didnt. So, I retraced all my integration steps and on reaching step 9, it struck me that when I was going through the code, there were no sign of any manual release statements - which was odd if the code was indeed not using ARC.

I removed all my -fno-objc-arc flags from all the JMC files. And hey presto! the crashing issue isnt there anymore.

Nick
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2014

Thanks for this.

ARC was enabled to JMC a while back, and obviously the documentation was not updated.

If you provide a PR, with the ammended README, I will definitely merge it to master.

Cheers,

Nick

Administrator Seatech August 24, 2014

Sure. I will make the changes and send you a PR.

Administrator Seatech August 24, 2014

Thanks. Quick Question. I am a bit new to this community and I was wondering how I can keep track of what are the things that people are working on / bucket list that need doing so that I can maybe contribute in some way.

Nick
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2014

Cheers!

Just merged :)

Nick
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2014

The issue tracker for JMC is at https://connect.atlassian.net/browse/CONNECT/?selectedTab=com.atlassian.jira.jira-projects-plugin:issues-panel.

There is no work-in-flight I currently know of. Feel free to kick something however if you wish.

The new screensizes will probably need some changes to be working well, so if you're up for that challenge, it'd be very welcome!

ravi December 22, 2014

Hi , i am trying to add jira mobile connect to my xcode project and it gives out 165 errors when i compile. can you please let me know why as there is nothing wrong with my project . i have even added to a sample project and when i compile i get 160 errors because of jira mobile connect . please let me know i have been waiting this issue to get resolved from past 2 weeks . Thanks

0 votes
ravi December 22, 2014

Hi , i am trying to add jira mobile connect to my xcode project and it gives out 165 errors when i compile. can you please let me know why as there is nothing wrong with my project . i have even added to a sample project and when i compile i get 160 errors because of jira mobile connect . please let me know i have been waiting this issue to get resolved from past 2 weeks . Thanks

0 votes
Administrator Seatech August 24, 2014

Thanks. Quick Question. I am a bit new to this community and I was wondering how I can keep track of what are the things that people are working on / bucket list that need doing so that I can maybe contribute in some way.

Suggest an answer

Log in or Sign up to answer