Metro - Problem with journal file

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
dilbert
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Metro - Problem with journal file

Post by dilbert » Mon 04 Mar 2013 12:17

I also experience problem with LinqConnect for Metro sometimes when running asynchronous queries updating database.

Sometimes there is an exception thrown randomly:
"Some kind of disk I/O error occurred" or
"Unable to open database file"

After a long debugging I found out the problem occurs only if the journal_mode of SQLite is set to "DELETE" (which is default value). If I changed it e.g. to TRUNCATE it executes correctly.

So I have to use following statement as a workaround for initializing a datacontext:

Code: Select all

SQLiteConnection conn = new SQLiteConnection(_connectionString);
conn.Open();
MyDatabaseContext dbContext = new MyDatabaseContext(conn);
SQLiteCommand cmd = new SQLiteCommand("PRAGMA journal_mode = TRUNCATE", conn);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
return dbContext;

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Metro - Problem with journal file

Post by MariiaI » Wed 06 Mar 2013 13:21

This issue may be caused for the same reasons as in the topic http://forums.devart.com/viewtopic.php?t=26117.
So we recommend you to upgrade your version of LinqConnect for Metro to a newer one in case you use a version older than 4.1.184.
In other case, please send us a sample project with which this error could be reproduced so that we are able to investigate it in more details.

Post Reply