This is an answer to the post of Dr. Hipp to my question. I tried several
times to send the mail as
"Re: [sqlite] database is locked and is malformed" but it did not work. So
I have to create a new thread.
Hello Dr. Hipp,
thank you for your response. First off all I want to apologize for my
entry in the ticket on sqlite.org, feel free to delete it.
I will also look for an other possibility to format my emails, we use a
Lotus Notes Client in the company and I don`t have
an influence on footers, perhaps I find something about the sending
format. Should I add some html-tags for line feed?
We don`t use the PRAGMA synchronous=off anymore.
I read the information about the atomic commit behaviour when I started
programing 2 or 3 years ago and now I had problems,
in studied it in detail again.
As far as I can judge it, we nearly fit all assumtions, but
1. We use a SiliconDrive SSD-D04G-3500 Flash Drive as Harddisk
2. We had problems in the past that fsync() was very slow (that`s why we
had to use the pragma command)
The compilation of sqlite3 is done by our qnx expert, but I can get all
settings and arrange changes very fast.
When I logged on to the corrupted machine there was the normal data.s3db
with around 200k and a data.s3db-journal file.
I tried to use the database, but only got errors. Than I tried to .dump
it, but this also did not work. Than I, perhaps unfortunately,
deleted the journal file and dumped again, with the result, that the new
data.s3db was only 80k big and the most important
table was completely empty. Afterwards I told the customer to restore a
backup which is one week old (absolutely healthy).
I still could get the corrupted database, but after all I read it want
help without the journal file.
I did that all under extreme time pressure, the machine was standing the
whole sunday and the customer was very angry.
So I did`t try something with the journal file, I can´t say something
about the size and the readability. Next time I know better.
To the situation on the machine:
I tried to do most ot the inserts to the database by a single thread. All
other programs send message to that "database manager"
and it makes the inserts. That is true for about 95% off all inserts. Now,
after thinking two days about the crash and reading your
advices, I believe that the crash had nothing to do with concurrent
inserts. On power off I may get many errors from devices of the
machine (most devices loose power earlier than the controll unit). So the
possibility of writing exact at the time when the controll
unit losses power is very high.
What I`m going to do next:
1. I will try to make the behaviour in case off power loss saver. There
must be a way to check the situation before starting an insert.
2. I will try to make all Inserts that belong together as one atomic
commit. Is it enought to write serveral Inserts in one sqlite3_exec() call
or must I do such a procedure with manual steps ?
3. I will try the PRAGMA journal_mode=PERSIST option to increase the speed
of inserts
4. I will test the sqlite3_busy_timeout() command as I`m not happy with my
current solution
Best regards / Mit freundlichen Grüssen
Stefan Breitholz
-----------------------------------------------------------------------------------------------------------
Staeubli GmbH - Theodor-Schmidt-Str. 19
DE - 95448 Bayreuth
Phone: +49(0)921/883-126 Fax: +49(0)921/883-58126
mailto:[email protected]
http://www.staubli.com
Registered under HRB 175 - Local Court Bayreuth - Managing Director: Karl
Kirschner
-----------------------------------------------------------------------------------------------------------
This e-mail and any attachment (the 'message') are confidential and privileged
and intended solely for the person or the entity to which it is adressed. If
you have received it in error, please advise the sender by return e-mail and
delete it immediately. Any use not in accordance with its purpose, any
dissemination or reproduction, either whole or partial, by entities other than
the intended recipient is strictly prohibited.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users