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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:46:51+00:00 2026-05-23T08:46:51+00:00

In an sqlite3 -console: sqlite> CREATE TABLE items (id PRIMARY KEY); BEGIN; SELECT *

  • 0

In an sqlite3-console:

sqlite>
    CREATE TABLE items (id PRIMARY KEY);
    BEGIN;
    SELECT * FROM items;
    INSERT INTO items VALUES(78);
sqlite> _

And then in a second console:

sqlite>
    .timeout 10000;
    BEGIN;
    SELECT * FROM items;
    INSERT INTO items VALUES(78);
Error: database is locked
sqlite> _

The “database is locked”-error happends instantly, which can’t be right, right?

If I omit the SELECT in the second console the busy handler waits for 10 seconds at the INSERT. I’ve found that using BEGIN EXCLUSIVE also makes the second transaction wait for 10 seconds, but then at the BEGIN-statement. (Which I’ve resolved to as a workaround.)

My question: Is this a bug, or as it should be? If this the expected behaviour, then why?

Thanks!

(SQLite v3.7.6)

  • 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-23T08:46:52+00:00Added an answer on May 23, 2026 at 8:46 am

    Yes this is normal. Please read: http://www.sqlite.org/lockingv3.html

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

Sidebar

Related Questions

Using sqlite3, if my query is SELECT * FROM table WHERE title LIKE '%x%'
I have a file with contents something like this: INSERT INTO table VALUES (NULL,'°
I am trying to test insert a row into sqlite3 db, for the Rails
I'm writing some console applications to move some data between SQLite databases. The classes
I have following requirement, I have C#/.Net console application, which refers to 'System.Data.Sqlite.dll' 'System.Data.Sqlite.dll'
SQLite3::SQLException: SQL logic error or missing database error when do insert, update and delete
I'm trying to extract column names from a SQLite result set from sqlite_master's sql
I have a python script that reads raw movie text files into an sqlite
I have a console-mode program that uses SQLite3 to maintain a database file. It
I'm doing a migration from sqlite to oracle backend. The oracle database already exists

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.