[sqlite] database is locked

2007-02-05 Thread anis chaaba
Hello, I have processes that access to my database, one writing on it and the other just reading. when this case take place an error message occure saying that database is locked. I saw in sqlite3 docs that sqlite3 enable this type of access but i don't know how can I activate this option. Is

Re: [sqlite] Re: Shared Lock Transactions

2007-02-05 Thread anis chaaba
How do I enable shared locking? 2007/1/25, Ken <[EMAIL PROTECTED]>: From os_unix.h:... After reading this, locking makes more sense! Although the Lock may physically be an exclusive lock, the implementation is actually a logcially "SHARED" lock. /* The following describes the

Re: [sqlite] Appropriate uses for SQLite

2007-02-05 Thread Chris Hanson
On Feb 2, 2007, at 8:59 AM, Clark Christensen wrote: FWIW, I'm not convinced Samba has locking working correctly. Using a very recent Samba version, I managed to corrupt a SQLite database last fall by (I think) doing simultaneous writes from the Linux host box, and my WinXP client box

[sqlite] database is locked

2007-02-05 Thread anis chaaba
Hello Please can you tell me how can i avoid having error message "database is locked'? thanks

[sqlite] DROP TABLE IF EXISTS my_table

2007-02-05 Thread Cecilia VIGNY
Hi, I'm using SQLite with a PHP program and I would like to execute this SQL request : DROP TABLE IF EXISTS clients; See my code : $allsqls=<<$sqlite = sqlite_open('pac.sdb') or die ('Impossible de se connecter a la base SQLite'); //Création des tables dans la base SQLite

[sqlite] malformed database schema

2007-02-05 Thread Paolo Vernazza
A client of mine reported a problem with a malformed DB. I tried to recovery the DB but without success. If I edit the file with an hex editor I see any data, but using sqlite I can't access it. >sqlite3 data.sqlite SQLite version 3.3.12 Enter ".help" for instructions sqlite> PRAGMA

Re: [sqlite] two process problem

2007-02-05 Thread Dennis Cote
Joe Wilson wrote: --- Dennis Cote <[EMAIL PROTECTED]> wrote: On 2/3/07, Tom Shaw <[EMAIL PROTECTED]> wrote: SQLSTATE[HY000]: General error: 1 SQL logic error or missing database and SQLSTATE[HY000]: General error: 8 attempt to write a readonly database Tom what wrapper are you

Re: [sqlite] BNF for sqlite3?

2007-02-05 Thread Dennis Cote
WB Stow wrote: Does anyone have a BNF file (http://en.wikipedia.org/wiki/Backus-Naur_form) for SQLite3? I want to generate a parser with it. If not, I guess I can start with the SQL92 BNF that I have and add the sqlite3 stuff to it... Wayne, The documentation at

Re: [sqlite] database is locked

2007-02-05 Thread Dennis Cote
anis chaaba wrote: Hello Please can you tell me how can i avoid having error message "database is locked'? thanks You will have to provide more details about exactly what you are doing and how you are doing it for anybody to be able to assist you. SQLite does support multiple process

Re: [sqlite] DROP TABLE IF EXISTS my_table

2007-02-05 Thread Dennis Cote
Cecilia VIGNY wrote: Why ? Can't we use "IF EXISTS" with php ? Does another solution exist ? What version of sqlite are you using? You can check with select sqlite_version(); The IF EXISTS clause was added to SQLite in version 3.3.8. Older version will not accept that syntax. HTH

[sqlite] Re: DROP TABLE IF EXISTS my_table

2007-02-05 Thread Igor Tandetnik
Cecilia VIGNY wrote: I'm using SQLite with a PHP program and I would like to execute this SQL request : DROP TABLE IF EXISTS clients; When I test my program, this error occures : Warning: sqlite_query(): near "EXISTS": syntax error in on line 61 IF EXISTS clause is supported with

Re: [sqlite] database is locked

2007-02-05 Thread anis chaaba
I have multiple thread reading the database and a thread inserting in or updating the database. when i try to simulate this case by executing sqlite3 from shell by beginning a transaction from a shell and retrieving data from other shell eveything works fine. But when it's the cas from my C

Re: [sqlite] database is locked

2007-02-05 Thread Markus Hoenicka
anis chaaba <[EMAIL PROTECTED]> was heard to say: > I have multiple thread reading the database and a thread inserting in or > updating the database. > when i try to simulate this case by executing sqlite3 from shell by > beginning a transaction from a shell and retrieving data from other shell >

[sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread A. Pagaltzis
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2007-02-04 13:35]: > "A. Pagaltzis" <[EMAIL PROTECTED]> wrote: > > It's a pity that INSERT OR IGNORE (apparently?) does not set > > last_insert_id properly regardless of outcome, > > Consider this case: > > CREATE TABLE t1(x INTEGER PRIMARY KEY, y

Re: [sqlite] Re: DROP TABLE IF EXISTS my_table

2007-02-05 Thread Dennis Cote
Igor Tandetnik wrote: IF EXISTS clause is supported with SQLite v3.3.0 and up. Igor, Right you are, version 3.3.0. I was mistakenly looking at the entry for IF EXISTS on create and drop of triggers and views, that didn't happen until 3.3.8. Sorry if I caused any confusion. Dennis Cote

[sqlite] long text on pocketpc

2007-02-05 Thread Pepa
I can't read more then 2KB from text column. I use http://www.codeproject.com/ce/SQLite3Wrapper.asp and compile dll library from newest sqlite source. I use VS 2005 and target platform is wm5 pocketpc (arm). Other test application on .net cf with .net library (not original source) and sqlite3

RE: [sqlite] BNF for sqlite3?

2007-02-05 Thread WB Stow
I would use the existing parser if my program were written in C, but it's not. I will look at it as a reference when writing the BNF though. Through my search I could see that this is not the first time that this question has been asked. So, once I'm done I will provide you all with the file.

Re: [sqlite] database is locked

2007-02-05 Thread John Stanton
You cannot avoid it if you have competing processes accessing the same database. What you have to do is synchronize access in your code. anis chaaba wrote: Hello Please can you tell me how can i avoid having error message "database is locked'? thanks

Re: [sqlite] DROP TABLE IF EXISTS my_table

2007-02-05 Thread John Stanton
If you can find a way of dropping a table which doesn't exist, use it. Otherwise just drop the table. Cecilia VIGNY wrote: Hi, I'm using SQLite with a PHP program and I would like to execute this SQL request : DROP TABLE IF EXISTS clients; See my code : $allsqls=<<$sqlite =

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Shane Harrelson
On 2/5/07, A. Pagaltzis <[EMAIL PROTECTED]> wrote: * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2007-02-04 13:35]: > "A. Pagaltzis" <[EMAIL PROTECTED]> wrote: > > It's a pity that INSERT OR IGNORE (apparently?) does not set > > last_insert_id properly regardless of outcome, > > Consider this case: >

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Dennis Cote
Shane Harrelson wrote: However, in an effort to provide some useful performance data for everyone, I'm making available the results of my testing with the various suggested insertion algorithms below. The fastest was my "Hack" version, followed closely by the "Insert/Select/Insert" version

Re: [sqlite] database is locked (my solution)

2007-02-05 Thread Andrew Teirney
I have multiple thread reading the database and a thread inserting in or updating the database. when i try to simulate this case by executing sqlite3 from shell by beginning a transaction from a shell and retrieving data from other shell eveything works fine. But when it's the cas from my C

[sqlite] newbie ask saving

2007-02-05 Thread Hariyanto
I have 2 table: 1. Table A : no INTEGER PRIMARY KEY, name varchar(15); 2. Table B : no smallint, (Foreign key) Address varchar(20); Telpvarchar(10); Usually I use this step when I save data : - insert A (name) VALUES ("Mr.X"); - x = Select no_id FROM A where name =

Re: [sqlite] database is locked (my solution)

2007-02-05 Thread Ken
Andrew, Nice modification.. Did you buy any chance post this into the sqlite ticketing system? It would be nice if sqlite would let you acquire a shared lock via the BEGIN statement. Andrew Teirney <[EMAIL PROTECTED]> wrote: > I have multiple thread reading the database and a

Re: [sqlite] database is locked (my solution)

2007-02-05 Thread Andrew Teirney
Andrew, Nice modification.. Did you buy any chance post this into the sqlite ticketing system? It would be nice if sqlite would let you acquire a shared lock via the BEGIN statement. No i didn't actually post this to the ticketing system, to be honest i am very new to all this open

[sqlite] Re: newbie ask saving

2007-02-05 Thread Igor Tandetnik
Hariyanto <[EMAIL PROTECTED]> wrote: I have 2 table: 1. Table A : no INTEGER PRIMARY KEY, name varchar(15); 2. Table B : no smallint, (Foreign key) Address varchar(20); Telpvarchar(10); Usually I use this step when I save data : - insert A (name) VALUES ("Mr.X"); - x =

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Dennis Cote
Shane Harrelson wrote: Perform 50 transactions of 1000 inserts each (5 total). Shane, Is this your normal usage pattern? Inserting records in blocks of around 1000 per transaction. Or would you be more likely to insert using 1000 transactions of 50 records, or perhaps only a single

Re: [sqlite] Re: newbie ask saving

2007-02-05 Thread Hariyanto
Can you give me sample code how to use it? I still not understand when I read capi3ref.html thx. On Mon, 5 Feb 2007 18:36:04 -0500 "Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > Hariyanto <[EMAIL PROTECTED]> wrote: > > I have 2 table: > > > > 1. Table A : > > no INTEGER PRIMARY KEY, > > name

Re: [sqlite] OR, IN: which is faster?

2007-02-05 Thread chueng alex1985
Thank you , Joe Wilson. 2007/2/3, Joe Wilson <[EMAIL PROTECTED]>: --- chueng alex1985 <[EMAIL PROTECTED]> wrote: > I don't think so. If the field has been indexed, searching speed will be > imprved very much. The query "f1 = value1 OR f1 = value2 OR f1=value3 OR > ..." will be faster if the

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Shane Harrelson
On 2/5/07, Dennis Cote <[EMAIL PROTECTED]> wrote: Shane Harrelson wrote: > Perform 50 transactions of 1000 inserts each (5 total). > Shane, Is this your normal usage pattern? Inserting records in blocks of around 1000 per transaction. Or would you be more likely to insert using 1000

[sqlite] How to keep syncronized between two DB on different severs?

2007-02-05 Thread Alex Cheng
Hi all, I encountered a problem. I have two servers (A and B) which host two same DBs, each of them may be modified. If the DB has been modified on server A, the DB on server B should also keep synchronized with server A. If the DB on server B has been modified, the DB on server A should also be

Re: [sqlite] How to keep syncronized between two DB on different severs?

2007-02-05 Thread Joe Wilson
http://www.mail-archive.com/sqlite-users@sqlite.org/msg19628.html --- Alex Cheng <[EMAIL PROTECTED]> wrote: > I encountered a problem. I have two servers (A and B) which host two same > DBs, each of them may be modified. If the DB has been modified on server A, > the DB on server B should also

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Joe Wilson
--- Shane Harrelson <[EMAIL PROTECTED]> wrote: > On 2/5/07, Dennis Cote <[EMAIL PROTECTED]> wrote: > > Shane Harrelson wrote: > > > Perform 50 transactions of 1000 inserts each (5 total). > > > > > > > Shane, > > > > Is this your normal usage pattern? Inserting records in blocks of around >

Re: [sqlite] database is locked (my solution)

2007-02-05 Thread Joe Wilson
--- Andrew Teirney <[EMAIL PROTECTED]> wrote: > If you are interested in the "BEGIN SHARED" transaction i posted a > simple patch to this mailing list within the last month if i recall > correctly. http://www.mail-archive.com/sqlite-users@sqlite.org/msg21260.html Do you find that using this

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Shane Harrelson
On 2/5/07, Joe Wilson <[EMAIL PROTECTED]> wrote: --- Shane Harrelson <[EMAIL PROTECTED]> wrote: > On 2/5/07, Dennis Cote <[EMAIL PROTECTED]> wrote: > > Shane Harrelson wrote: > > > Perform 50 transactions of 1000 inserts each (5 total). > > > > > > > Shane, > > > > Is this your normal

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-05 Thread Joe Wilson
--- Shane Harrelson <[EMAIL PROTECTED]> wrote: > On 2/5/07, Joe Wilson <[EMAIL PROTECTED]> wrote: > > > Yes, it's typical. Each database instance is typically composed of > > > around 50k records, all inserted in a single pass. If I could do > > > larger transactions (or not do them at all) I