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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:20:47+00:00 2026-05-26T12:20:47+00:00

My application manages all its data in a a SQLiteDatabase that is accessed by

  • 0

My application manages all its data in a a SQLiteDatabase that is accessed by a number of threads.

Right now I’ve been keeping all my DB calls synchronized on the database itself.

The reason I want to do this is that occasionally I want to refresh the table by grabbing the most recent version from a server and reconstructing the table from stratch. To save time I’m actually making a second table and then replacing the original when I’m done (locking it out with a synchronized while I’m doing this).

The problem is either I occasionally have my SQL calls stall for a long while (due to the synchronous locks) or I get an error when a SQL call tries to run itself in the brief period when my one table is getting copied over.

Is there a was for me to lock my database from other operations while it refreshes but let operations A,B,C,etc run concurrently?

Cheers!

  • 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-26T12:20:47+00:00Added an answer on May 26, 2026 at 12:20 pm

    I’m pretty sure what you want is a ReadWriteLock. Basically, it puts two different locks on your database, one for reading and one for writing. While the write lock is locked, nobody else can read or write. If any of the read lock is locked (by any number of threads), the write lock won’t be able to lock until everyone is finished reading.

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

Sidebar

Related Questions

When an iPhone application manages its own preferences, rather than using a bundle, it
I'm developing an application that manages network interfaces on behalf of the user and
We have a web application that manages inventory for our computer support group. One
I am creating an application that manages multiple instances of an external utility, supplying
We have a hosted application that manages pages of content. Each page can have
We have an ASP.NET application that manages it's own User, Roles and Permission database
So I'm using hibernate and working with an application that manages time. What is
In one of my projects, I have an application that manages several clients (or
I have an application processing network communication with blocking calls. Each thread manages a
I'm currently developing an application that needs to store data in it's on database,

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.