1. yes the methods should still work.
2. PRAGMA synchronous= OFF and PRAGMA journal_mode = OFF
will put your DB at risk of corruption, I'd only do this if you can
re-create the db from scratch.
3. Using threads will not help Only one connection to the DB can be writing.
4. OK
TRY:
BEGIN transaction
open select cursor, (use either method 1 or 2 from post). Use method 2 if
small result set is expected.
Perform updates...
Close select cursor (fiinalize or reset).
Commit transaction.
--- On Tue, 8/5/08, Yatin Salian <[EMAIL PROTECTED]> wrote:
From: Yatin Salian <[EMAIL PROTECTED]>
Subject: [sqlite] Using transactions gives SQLITE_ERROR
To: sqlite-users@sqlite.org
Date: Tuesday, August 5, 2008, 2:12 PM
hi,
I am currently using sqlite version 3.5.9 on WinCE 5.0. As per the posts
in the forums I do understand that when a cursor is open on a connection we
cannot update the database using transactions on the same thread.
open cursor...
begin transaction;
update statements
commit transaction.
finalize cursor
But I found the below post in the forums which suggests different methods
for updating the database using transactions when a cursor is open.
http://www.mail-archive.com/sqlite-users@sqlite.org/msg08044.html
I tried the first method in the post .. But I am still getting SQLITE_ERROR
.. with the error description as "cannot commit transaction - SQL
statements
in progress".
Some tips on the queries listed below may help me in resolving the issue.
1) Do the methods mentioned in the link above still hold or am I missing
something... ??
2) The whole reason of using the transactions is to increase the speed as
the updates take time on USB disks. Is there any other way of increasing the
speed other than PRAGMA synchronous= OFF and PRAGMA journal_mode = OFF ??
3) Can updating the database using transaction from different threads with
work around solve this issue? If yes, then I would be greatful if the
details of the work around are provided.
4) If I update the database in the below mentioned sequence without
transactions then everything works fine
open cursor...
update statements
finalize cursor
As per the sqlite documentation every statement that is executed is
treated as a transaction and the database is updated even if the cursor is
open.How is this transaction in auto commit mode different from the
transactions created by using "begin transaction" and "commit
transactions"??
/cheers,
Yatin Salian
The people who mind don't matter and the people who matter don't mind.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users