Sign in to follow this  
Followers 0
DjDeep00

SQLite "Database Locked"

5 posts in this topic

I was wondering if there is any way that I can prevent the "Database Locked" message from happening?

Currently I am using a SQLite database which is located on a network shared folder and the SQLite.exe resides on the person's local machine. I have bout 8 people accessing the database at one time. They all are doing updates, inserts, and basic select query to the database.

Is there a way to queue up people or something else and not get the "Database Locked" message. Please help.

Share this post


Link to post
Share on other sites



Bump....Anyone?

Share this post


Link to post
Share on other sites

well sqlite is not intended for concurrent connections.

write some failovers into your apps that if they get that error to simple wait a few seconds and retry the connection.

Also make sure each app closes the connection properly after it does it's thing.

This should help some.

Share this post


Link to post
Share on other sites

You can have more then one connection, heres some tips:

When using _SQLite_Query() make sure to use:

_SQLite_QueryFinalize() and _SQLite_QueryReset ()

Make sure every Query does that.

Execs do not matter.

Share this post


Link to post
Share on other sites

Thanx Guys! I ended up writing a function that when it finds the "database locked" message, it just retry's the SQL until its good.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0