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

The Archive Base Latest Questions

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

java.sql.SQLException: database is locked at org.sqlite.DB.throwex(DB.java:288) at org.sqlite.NestedDB.prepare(NestedDB.java:115) at org.sqlite.DB.prepare(DB.java:114) at org.sqlite.Stmt.executeQuery(Stmt.java:89) When I

  • 0
java.sql.SQLException: database is locked
    at org.sqlite.DB.throwex(DB.java:288)
    at org.sqlite.NestedDB.prepare(NestedDB.java:115)
    at org.sqlite.DB.prepare(DB.java:114)
    at org.sqlite.Stmt.executeQuery(Stmt.java:89)

When I make a query I get this exception. I read up on it on SA and Google, and the most common conclusion is that someone started making another query which never finished. The problem I’m having is that I’ve never made a query on this DB on this machine before. I downloaded the db file from where I hosted it (I created it earlier) and haven’t done anything with it, so I don’t know why it would be locked. When I do a query using a program called SQLite Database Browser, it works just fine. Thanks for the help, I’ll provide more info if need be, just let me know.

adapter = new DbAdapter();
ResultSet info;
ResultSet attributes;
for (int i = 1; i < 668; i++) {
    if (i%50 == 0) {
        System.out.print('.');
    }
    info = adapter.makeQuery("SELECT * FROM vehicles WHERE id = '" + i + "'");
    attributes = adapter.makeQuery("SELECT * FROM vehicle_moves WHERE vehicle_id = '" + i + "'");
    if(info.next()) {
        base = new (info, attributes);
    }

    vehicleArray[i] = base;
}
System.out.println("Done.");
info.close();
attributes.close();
adapter.close();

Above is the code where this is occurring. I did some homework throughout my code and sure enough the problem is in this code, other DB queries work just fine. Anything jump out at you guys?

  • 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-23T11:46:14+00:00Added an answer on May 23, 2026 at 11:46 am

    SQLite itself can most certainly handle doing a query while the results of another query are being processed. It’d be terribly useless if that couldn’t be done! What’s more likely to cause problems is if you’ve got two connections to the database open at once. I don’t know that DbAdapter class at all – not what package it is in, or what module provides it – but if it is assuming that it can open many connections (or if it isn’t maintaining proper connection hygiene) then that most certainly would be a cause of the sort of problems you’re seeing. Look there first.

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

Sidebar

Related Questions

I have an error in log after when trying to update the database: java.sql.SQLException:
package database; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import database.Dbconnect; public class
package dao; import java.sql.ResultSet; import java.sql.SQLException; import org.krams.tutorial.oxm.SubscriptionRequest; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport; public class
I am having this error in my j2ee web application. java.sql.SQLException: ORA-00604: error occurred
Oracle JDBC connection with Weblogic 10 datasource mapping, giving problem java.sql.SQLException: Closed Connection I
The following is my Class code import java.net.*; import java.util.*; import java.sql.*; import org.apache.log4j.*;
I am having difficulty connecting my java code to sql server database. I can
java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; class test{ def selectAuther(){
/** * */ package ORM; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; /** * @author

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.