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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:45:51+00:00 2026-05-12T09:45:51+00:00

I have an sqlite database I am writing and reading from. Most of the

  • 0

I have an sqlite database I am writing and reading from. Most of the time I am writing, but occasionally I read something.

The routine for writing (skeletonized, error checking removed etc..) goes something like this: st1 and st2 are already prepared along with the initialization of the database.

-(BOOL) saveHvalue:(int) fid time:(int) t value:(double) v type:(int) ftype
{

    {
        sqlite3_bind_int(st1, 1, fid);
        sqlite3_bind_int(st1, 2, t);
        sqlite3_bind_int(st1, 3, ftype);
        sqlite3_bind_double(st1, 4, v);


        sqlite3_step(st1);
        sqlite3_reset(st1);
        sqlite3_clear_bindings(st1);
    }

    return YES;
}

The routine for reading is:

-(double) getHvalue:(int) fid time:(int) t type:(int) ftype
{
    double v=0;

    {
        sqlite3_bind_int(st2, 1, fid);
        sqlite3_bind_int(st2, 2, t);
        sqlite3_bind_int(st2, 3, ftype);
        sqlite3_step(st2);
        v = sqlite3_column_double(st2, 0);

        sqlite3_reset(st2);
        sqlite3_clear_bindings(st2);
        return v;
}

Most of the time I am using saveHvalue, but occasionally I read back something. The instant I try this the journal file created fails to go away and it seems the writing is killed immediately.

Do I need to do something to transition between writing and reading?

  • 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-12T09:45:52+00:00Added an answer on May 12, 2026 at 9:45 am

    Have you tried executing a COMMIT (e.g. with sqlite3_exec) after each write completes?

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

Sidebar

Related Questions

I have 2 processes: 1 is writing to a sqlite database, 1 is reading
I have an sqlite database, and I would like to keep it read-only without
I have an SQLite database file exported from Scraperwiki with .sqlite file extension. How
I am have a sqlite database in the iPhone application I am writing. I
I'm writing a program for a running contest using SQLite database, and I have
I'm writing a WinForms database application using SQLite and C#. I have a sqlite
I have a database of questions from an external SQlite manager. I would like
I have one Sqlite Database file. I want to share my sqlite database between
I have a SQLite database that contains a huge set of log messages. I
I have an SQLite database, eventually will be a MySQL database and I'm using

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.