sqlite3_get_table() failed with error "database is locked"

classic Classic list List threaded Threaded
4 messages Options
ldl
Reply | Threaded
Open this post in threaded view
|

sqlite3_get_table() failed with error "database is locked"

ldl
Hi,


Multiple applications called sqlite3_get_table() to read data in a same db file at the same time, got error "database is locked"? Why read-only access is locked? How to resolve the issue?


Thanks,
Liu
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_get_table() failed with error "database is locked"

Clemens Ladisch
ldl wrote:
> Multiple applications called sqlite3_get_table() to read data in a same db file at the same time, got error "database is locked"

Somebody has a write lock.

> Why read-only access is locked?

Because one access is not read only.

> How to resolve the issue?

Find out who locked it.
Do you know which processess could access the DB file?


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
ldl
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_get_table() failed with error "database is locked"

ldl



Hi Clemens,


Just the same application started in multiple processes doing the same things. The accesses to the db were all readonly.


I print the error from sqlite3_get_table(). The error is "database is locked".


Thanks,
Liu






At 2018-09-24 18:27:24, "Clemens Ladisch" <[hidden email]> wrote:

>ldl wrote:
>> Multiple applications called sqlite3_get_table() to read data in a same db file at the same time, got error "database is locked"
>
>Somebody has a write lock.
>
>> Why read-only access is locked?
>
>Because one access is not read only.
>
>> How to resolve the issue?
>
>Find out who locked it.
>Do you know which processess could access the DB file?
>
>
>Regards,
>Clemens
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_get_table() failed with error "database is locked"

Simon Slavin-3
On 4 Oct 2018, at 10:57am, ldl <[hidden email]> wrote:

> Just the same application started in multiple processes doing the same things. The accesses to the db were all readonly.
>
>
> I print the error from sqlite3_get_table(). The error is "database is locked".

Set a timeout of 60,000ms and see whether this makes the errors go away:

<https://www.sqlite.org/c3ref/busy_timeout.html>

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users