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 6106211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:03:19+00:00 2026-05-23T14:03:19+00:00

I really get frustrated with the error .I have spent two days in for

  • 0

I really get frustrated with the error .I have spent two days in for getting solve that .But it not get fix ,When getting data from database at that time there no problem .But when fire the insert statement.I get this errors:

Assertion failure in -[NewJourney addJourney], /Users/HarishYadav/Desktop/JourneyMapper/Journey/NewJourney.m:114
2011-07-05 17:23:13.739 Journey[24328:207] * Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Error while inserting data. ‘database is locked”
*
Call stack at first throw:

Here is my code for inserting the value in database

-(void)addJourney
{
if (addStmt == nil)
{

    const char * sql = "insert into UserJourney(JourneyName,LocationName,Description) Values (?,?,?)";
    if (sqlite3_prepare_v2(database, sql, -1,&addStmt ,NULL) != SQLITE_OK)

        NSAssert1(0,@"Error while creating add statement. '%s'",sqlite3_errmsg(database));

    }
    sqlite3_bind_text(addStmt, 1, [journeyname UTF8String], -1,SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 2, [journeylocation UTF8String],-1, SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 3, [journeydescription UTF8String],-1 , SQLITE_TRANSIENT);

    if (SQLITE_DONE != sqlite3_step(addStmt)) 

        NSAssert1(0,@"Error while inserting data. '%s'",sqlite3_errmsg(database));

    else 

        journeyID = sqlite3_last_insert_rowid(database);

    sqlite3_reset(addStmt);

}

What was the problem in this

Thanks in advance

  • 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-05-23T14:03:20+00:00Added an answer on May 23, 2026 at 2:03 pm

    You need to use after you complete your statement

    sqlite3_finalize(statement);

    in every function where you use database interaction.

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

Sidebar

Related Questions

I have read other related question but i cant really get them to relate
I'd really like to get into some D3D coding, but I don't have the
I have decided that I really need to get some flowcharts for reverse engineering
I have an issue with PDO that I'd really like to get an answer
I'm really quite frustrated at this point. I have an existing hg repository that
I'm getting really frustrated as I'm trying to get an array to my _Click-Event
I am really getting frustrated now! I have a new problem now, all I
I have encountered something weird (probably not, it's more likely that I don't really
I don't really get lambda expressions. While they've been around since the days of
The title may not really explain what I'm really trying to get at, couldn't

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.