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

  • Home
  • SEARCH
  • 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 6378197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:58:28+00:00 2026-05-25T01:58:28+00:00

I currently successfully use a SQLite database which is populated with data from the

  • 0

I currently successfully use a SQLite database which is populated with data from the web. I create an array of values and add these as a row to the database.

Currently to update the database, on starting the activity I clear the database and repopulate it using the data from the web.

Is there an easy method to do one of the following?

A: Only update a row in the table if data has changed (I’m not sure how I could do this unless there was a consistent primary key – what would happen is a new row would be added with the changed data, however there would be no way to know which of the old rows to remove)

B: get all of the rows of data from the web, then empty and fill the database in one go rather than after getting each row

I hope this makes sense. I can provide my code but I don’t think it’s especially useful for this example.

Context:

On starting the activity, the database is scanned to retrieve values for a different task. However, this takes longer than it needs to because the database is emptied and refilled slowly. Therefore the task can only complete when the database is fully repopulated.

In an ideal world, the database would be scanned and values used for the task, and that database would only be replaced when the complete set of updated data is available.

  • 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-25T01:58:29+00:00Added an answer on May 25, 2026 at 1:58 am

    Your main concern with approach (b) – clearing out all data and slowly repopulating – seems to be that any query between the empty and completion of the refill would need to be refused.

    You could simply put the empty/repopulate process in a transaction. Thereby the database will always have data to offer for reading.

    Alternatively, if that’s not a viable solution, how about appending newer results to the existing ones, but inserted as with an ‘active’ key set to 0. Then, once the process of adding entries is complete, use a transaction to find and remove currently active entries, and (in the same transaction) update the inactive entries to active.

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

Sidebar

Related Questions

I have some XML data retrieved from a web service that I use to
Currently I'm doing some unit tests which are executed from bash. Unit tests are
I am currently trying to use a web service I developed within an Integration
Currently I have an application that receives an uploaded file from my web application.
I currently use pretty exclusively the PHP stream context functionality (see https://www.php.net/manual/en/function.stream-context-create.php ) to
I am currently looking into implementing a client which will use an existing extensive
I currently have the following objects persisting successfully: Person first name, etc. Exams title,
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
I am currently evaluating JMS and I don't get what I could use it
I am currently working on a Java EE project. I have successfully developed a

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.