On 2 Mar 2016, at 1:48pm, Itxaso Perez <iperezmuruaga at gmail.com> wrote:

> - If this occurss (power loss) using only SQLite (without NHibernate), is
> not a problem the opening of an app?
> - How can I 'execute' the DB-Jounal file just to try to 'correct' the
> database before execting NHibernate?

[This is a simplified explanation.]

Having a journal file on disk should not crash your app.  If you are using just 
SQLite you should not delete the journal file.

When you use SQLite to open the database it looks for the journal file.  If it 
finds the journal file it knows your program crashed.  It looks at the contents 
of the database file and the contents of the journal file and uses the two 
together to 'rescue' the most up-to-date data possible.  Then it lets your app 
continue as normal.  You do not have to do anything special to make this 
happen.  SQLite does it automatically.

If your app is crashing because of this journal file, the crash does not come 
from SQLite.  It may come from NHibernate or from your app's code.  It might be 
good to look for advice from an NHibernate forum.  But if they cannot help ...

It may be possible to recover your database by using a SQLite tool.  First, 
take a backup copies of the database and journal files !  Then, from this page

<https://www.sqlite.org/download.html>

download the 'Precompiled Binaries' for your platform.  Use the sqlite3 command 
line tool to open your database.

OS prompt> sqlite3 mydatabase.ext
SQLite version ...
> .quit

This should cause SQLite to try to recover the database.  Maybe it will work. 
Maybe it won't work.

Simon.

Reply via email to