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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:35:00+00:00 2026-06-12T13:35:00+00:00

I am using c# application and running the application in server machine as windows

  • 0

I am using c# application and running the application in server machine as windows service.When i perform insert , update delete operation from client machine it throws database lock error as below,

database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   at System.Data.SQLite.SQLiteTransaction.Commit()

Below is my code

public int ExecuteNonQuerySQL(SQLiteCommand cmd)
   {
        int ireturn = 0;
         if (conn.State != ConnectionState.Open)
               Open(DataFile);
          using (SQLiteTransaction dbtrans = conn.BeginTransaction(IsolationLevel.ReadCommitted))
            {
                  using (cmd.Connection=conn)
                    {
                         cmd.CommandText =cmd.CommandText ;
                          cmd.Transaction = dbtrans;
                           ireturn = cmd.ExecuteNonQuery();
                           dbtrans.Commit();
                           cmd.Dispose();
                        }
                   }
               }

Please help me in this , I have done lot of googling and i must find some solution to solve this .
Regards

  • 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-06-12T13:35:01+00:00Added an answer on June 12, 2026 at 1:35 pm

    From the code provided it seems that you do not close the connecttion.

    Pay attention also on fact, don’t know if it’s relevant in your case or not, that the Sqlite not very good on supporting concurent inserts and sometimes db got lock, if you operate on it from multiple threads.

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

Sidebar

Related Questions

I have a Java server application running on a windows 2008 machine, and I
I am using WCF to develop a client-server application. The WCF service is secured
I am running a Java Application as a Service in Windows that's using JDBC
I am running a server application using JVM sunjava-1.6.0_21 . My application is data
While developing an application using gwt in ecliplse crashed. Now the server is running
I'm re-writing a legacy Windows application using Python and running on Linux. Initially, the
I am using Struts application while running welcome page is run successfully after that
I have developed a Phone Gap application using this link . Application is running
I have an application running under WebLogic that is using standard forms authentication. The
We have an application running on Tomcat 6.0.32 and using JSSE (Java 1.6.0_26) for

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.