1

I have looked at the SQLite documentation and I can't find anything clear about the value "Default Timeout".

Looking at other websites, it seems to refer to some sort of "Connection timeout", while other sites indicate that it is more of a "Command timeout"

Some quick tests don't seem to indicate that it has anything to do with Commands.

Can anybody confirm/reference what the purpose of that value in the connection string is for?

Edit this is using the official SQLite .NET library

2

1 Answer 1

3

I found this out by looking at the source code: The timeout value of a command is initialized to DefaultTimeout and passed to the internal SQLite3.Prepare function.

This is used to control a loop that automatically retries statements that fail with a Locked or Busy error. When the timeout has expired (as measured by Environment.TickCount), then an exception is thrown with whatever the most recent error code was. Otherwise, it sleeps for a random amount of time (between 1 and 150 ms) and tries again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.