Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8700325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:08:56+00:00 2026-06-13T02:08:56+00:00

I am developing an app for ipad and i am using sqlite sentences (select,

  • 0

I am developing an app for ipad and i am using sqlite sentences (select, update, insert, delete).

I open (sqlite3_open) the database at the beginning and close (sqlite3_close) at the end of each sentence. But sometimes i´ve got the “database is locked” message.

I don´t know what can i do to solve this.

Thanks and sorry for this little information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:08:56+00:00Added an answer on June 13, 2026 at 2:08 am

    If I’m not mistaken , the problem with sqllite is that you can only access it once at a time.
    If you have multiple threads, you can run in this situation. Example:

    Run method1 (which accesses the database) on thread t1.
    Run method2 (which accesses the database) on thread t2 after x seconds.

    If method1 is not finished in those x seconds , both methods will access it at the same time.
    And , as I said , I know that sqllite does not support this.

    You should try to flag the usage of your database and if you want to access it but it is in use , try again after x seconds. Like this:

    - (void) generalMethodThatUsesDatabses
    {
        if(databaseIsUsed)
        {
             [self performSelector:@selector(generalMethodThatUsesDatabses) withObject:nil afterDelay:5];
              return;
        }
    
        databaseIsUsed = TRUE;   //global bool variable
    
    
        //your code here
    
        databaseIsUsed = FALSE;
    
    }
    

    Hope this helps. Cheers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an app on iPad which has only animations. I am using
I am developing an app for iPhone/iPad using Objective C. In my app I
I am developing iPad app which reads data (around 5000 rows) from sqlite and
I'm developing an iPad app that will be distributed in-house using the Enterprise Program
I'm developing a simple text editing app for iPad using UITextView. I always had
I'm currently developing a simple text editing app for iPad using UITextView. I want
I am developing an iPad app and found some memory leaks using Instruments and
I'm developing an iPad app that needs read-only access to an Oracle database. Is
I'm developing an app for iPad (using Titanium Appcelerator) that is designed to record
I am developing an App for the iPad/iPhone and I am using an AdBanner

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.