Re: [sqlite] database locked in PHP

2015-01-25 Thread Hick Gunter
Maybe you can use the (linux, c) code I posted recently to determine which 
process/thread is locking the database file.

-Ursprüngliche Nachricht-
Von: Lev [mailto:leventel...@gmail.com]
Gesendet: Sonntag, 25. Jänner 2015 01:36
An: sqlite-users@sqlite.org
Betreff: Re: [sqlite] database locked in PHP

On Sat, 24 Jan 2015 20:59:22 +
Simon Slavin <slavins-drl2ohjjk6tg9huczpv...@public.gmane.org> wrote:

> and set it to 6 (60 seconds) or so.

Okay, I try that, but I still don't understand how can a single threaded 
application get a locked error.

Levente

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] database locked in PHP

2015-01-25 Thread Dan Kennedy

On 01/25/2015 07:35 AM, Lev wrote:

On Sat, 24 Jan 2015 20:59:22 +
Simon Slavin  wrote:


and set it to 6 (60 seconds) or so.

Okay, I try that, but I still don't understand how can a single threaded
application get a locked error.


Was the error message "database is locked" or "database table is locked"?

When you say "single threaded", are you also implying "uses a single 
connection"?


Is the statement that is hitting the SQLITE_LOCKED a DROP TABLE or DROP 
INDEX statement? If so, do you also have active statements associated 
with the same connection?


Dan.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] database locked in PHP

2015-01-24 Thread Lev
On Sat, 24 Jan 2015 20:59:22 +
Simon Slavin  wrote:

> and set it to 6 (60 seconds) or so.

Okay, I try that, but I still don't understand how can a single threaded
application get a locked error.

Levente

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] database locked in PHP

2015-01-24 Thread Simon Slavin

On 24 Jan 2015, at 8:13pm, Lev  wrote:

> I sometimes get a database locked error when I access the database by
> calling the execute() call. This is on PHP.

Have you set a timeout ?  Immediately after opening the connection use



and set it to 6 (60 seconds) or so.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] database locked in PHP

2015-01-24 Thread Lev
Hi list,


I'm currently working on a www frontend that uses SQLite.

I sometimes get a database locked error when I access the database by
calling the execute() call. This is on PHP.

Reading the document

http://www.sqlite.org/rescode.html#locked

I learned that locked error occurs only on the same database connection or
when shared cache is used.

I open the database with

$db = new SQLite3($db_filename);

then

$stmt = @$db->prepare($query);

$result = $stmt->execute();

Does these function calls enable shared cache? Or I can't see why I get
locking error.

Could you please help.

Thanks,
Levente

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users