On Thu, 15 Mar 2012 10:58:34 +0900 (KST), [email protected]
wrote:

>Hello. 
>
>I am an elementary programmer in Korea. 
>
>My company uses SQLite for some kinds of project. We use it without any 
>problems. but recently we got a problem, 
>so I searched solutions from internet. but I couldn't find it. so I need helps 
>and contact you. 
>
>In my situation, our project is many people can SELECT some data from database 
>file by using multi-threads. As I 
>know, SQLite can perform the request after former request finished. The 
>request for 'SELECT data' locks 
>database file and after doing all request, it unlocks the file.
>We don't have any problem on Window server, but we get a problem on Unix 
>server. When we use our project on 
>Unix server, if more than 3 requests per second occur, database file don't 
>unlock and we get 
>"SQLite_BUSY". then the server is down.

You propably run into a deadlock.

> so in this situation, can I unlock the 'LOCK'
> forcibly by using command? If I can do that, how can I do it? 

It's locked by an implicit or explicit "BEGIN TRANSACTION;" .
Romove the lock by rolling back the transaction with "ROLLBACK
TRANSACTION" and try again from the beginning.

You could avoid the situation by claiming an exclusive lock with "BEGIN
IMMEDIATE TRANSACTION;"

> or we only use select query from SQLite,
> so can we make database file never unlock? 

I think you mean "never deadlock".

Read the docs about "PRAGMA journal_mode=WAL;", it allows multiple
readers and one writer concurrently.

Apart from that, in a multithreaded application, you have to be very
careful. Preferably use a connection per thread.

> and If Using SQLite has differences between on Window server
> and Unix server, Please let me know it. 

Not really, as far as I can tell.

>Thank you for read my letter. 


-- 
Regards,

Kees Nuyt

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to