Re: [sqlite] TRANSACTION-question

2004-12-03 Thread P. Morandi
Yes, you do it.
Bye
  - Original Message - 
  From: Steven Van Ingelgem 
  To: [EMAIL PROTECTED] 
  Sent: Friday, December 03, 2004 10:02 AM
  Subject: Re: [sqlite] TRANSACTION-question


  Do you automatically end a transaction when committing?

  At 09:11 3/12/2004, you wrote:


Hi Steven,
I used transactions in C++ code (windows and linux) with sqlite 2.8;
try the sequence " BEGIN; DELETE ...; INSERT ...; COMMIT; ", it works in 
2.8.
Regards
Paolo 
  - Original Message - 
  From: Steven Van Ingelgem 
  To: [EMAIL PROTECTED] 
  Sent: Friday, December 03, 2004 8:51 AM
  Subject: [sqlite] TRANSACTION-question


  Hi,

  I do the following (SQLite 308 from C++ source in windows):

  BEGIN DEFERRED TRANSACTION;DELETE FROM Inbox;INSERT...;COMMIT 
TRANSACTION; END TRANSACTION;

  Now, nothing is done? Nothing inserted, nothing deleted from Inbox...

  Then I tried to execute the same afterwards, but then I got that I am 
already in a transaction? Is that possible or should I look further?

  Does a commit end the transaction, or should I end it anyhow?


  Thx,



  KaReL (aka Steven)

  Main Webpage : http://www.karels0ft.be/
  ICQ #: 35217584

  KaReL (aka Steven)

  Main Webpage : http://www.karels0ft.be/
  ICQ #: 35217584



Re: [sqlite] TRANSACTION-question

2004-12-03 Thread P. Morandi
Hi Steven,
I used transactions in C++ code (windows and linux) with sqlite 2.8;
try the sequence " BEGIN; DELETE ...; INSERT ...; COMMIT; ", it works in 2.8.
Regards
Paolo 
  - Original Message - 
  From: Steven Van Ingelgem 
  To: [EMAIL PROTECTED] 
  Sent: Friday, December 03, 2004 8:51 AM
  Subject: [sqlite] TRANSACTION-question


  Hi,

  I do the following (SQLite 308 from C++ source in windows):

  BEGIN DEFERRED TRANSACTION;DELETE FROM Inbox;INSERT...;COMMIT TRANSACTION; 
END TRANSACTION;

  Now, nothing is done? Nothing inserted, nothing deleted from Inbox...

  Then I tried to execute the same afterwards, but then I got that I am already 
in a transaction? Is that possible or should I look further?

  Does a commit end the transaction, or should I end it anyhow?


  Thx,



  KaReL (aka Steven)

  Main Webpage : http://www.karels0ft.be/
  ICQ #: 35217584



Re: [sqlite] DATABASE SCHEMA HAS CHANGED

2004-11-19 Thread P. Morandi
Thank you Tito.
I'll try it.
Bye

- Original Message - 
From: "Tito Ciuro" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 19, 2004 12:38 PM
Subject: Re: [sqlite] DATABASE SCHEMA HAS CHANGED


> Hello Paolo,
> 
> On Nov 19, 2004, at 10:24, P. Morandi wrote:
> 
> > Hi everybody.
> >
> > After using VACUUM on a sqlite db, the first time I try to do an 
> > INSERT in a table
> > (always the same table) I get the "DATABASE SCHEMA HAS CHANGED" error, 
> > but later
> > queries have no problems, only the first one.
> > If I don't pack the db (no using of VACUUM) no problem.
> > Does anyone have any idea of the causes of this error message?
> 
> I believe VACUUM changes the schema version numbering. After you 
> VACUUM, your sqlite3 struct holds information about your previous 
> database version. Solution: reopen the database and SQLite will pick up 
> the new changes. After that, INSERT will not report an error (until you 
> VACUUM again, that is.)
> 
> I hope this helps,
> 
> -- Tito
> 
> 
> 



[sqlite] DATABASE SCHEMA HAS CHANGED

2004-11-19 Thread P. Morandi
Hi everybody.

After using VACUUM on a sqlite db, the first time I try to do an INSERT in a 
table
(always the same table) I get the "DATABASE SCHEMA HAS CHANGED" error, but later
queries have no problems, only the first one.
If I don't pack the db (no using of VACUUM) no problem.
Does anyone have any idea of the causes of this error message? 

Thanks.
Paolo Morandi



[sqlite] Library routine called out of sequence

2004-10-22 Thread P. Morandi
Hi everybody.
Does anybody know the main causes of error 'Library routine called out of sequence'
after a sqlite_exec()  calling?

Thank you.
P. Morandi

[sqlite] library routine called out of sequence

2004-10-20 Thread P. Morandi
Good morning. I just subscribed to the list. 
I've been using Sqlite for an year without problems, but recently I have to face up
quite often with the error "library routine called out of sequence" and it seems I 
can't solve
it definitely. 

I'll explain better:
I'm programming under Linux (I'm not very skilled in Linux) 
and using 2.8.5 library version (july 2003) after downloading 2.8.5.tar.gz file from 
your site.
In practice I produced the library files libsqlite.a, libsqlite.la, libsqlite.lai, 
libsqlite.so, libsqlite.so.0, libsqlite.so.0.86
using the flag THREADSAFE = 1.
My program contains 4 threads all accessing the same database Sqlite, a file called 
MwpCom.sql,
composed by many tables.
Every thread updates or makes sql inserts in his own tables, but, as I wrote, all the 
tables belong
to same file MwpCom.sql.
During my first tests I used to share between the 4 threads the pointer returned by  
sqlite_open() ,
to tell the truth I used many sqlite_open() so I shared many pointers, all pointing to 
the same file Sqlite.
I always obtained the error "library routine called out of sequence" while trying to 
access any table.
Later, reading some hints about Sqlite concurrency, I discovered that this way of 
using pointers was wrong, 
so I changed my code in order not to share the pointers anymore (every thread now has 
his own connections,
alias his own sqlite_open()), and things improved immediately. But unfortunately 
sometimes one of the 4 threads,
while attempting to access his tables, gives "library routine called out of sequence".

I don't know what to do. If I restart my program for a while it runs ok, so I think 
the database isn't corrupted,
but first or later, i get the error.  
Can you suggest me something? Should I try with the last release of libraries (2.8.15) 
?

I hope you can help me.
Thank you in advance.