Page 1 of 1
FK exception keeps db3 file open
Posted: Fri 08 Jun 2012 16:36
by adrian.petrescu
Hi,
I'm encountering a problem where after I get a FK constraint exception, after I execute connection.Close(), the db3 file remains open in the process (pooling is disabled). I've managed to reproduce this with other exception types as well.
I can see this problem both while using Devart ADO.NET connection or Entity Framework.
I really need to close the file because the app involves moving db3 files around. Any quick fix or workaround for doing this?
Thanks,
Adrian
Re: FK exception keeps db3 file open
Posted: Wed 13 Jun 2012 10:34
by adrian.petrescu
This is how I can reproduce the problem:
Code: Select all
string connString = "Data Source=C:\\Temp\\TestDb\\TestDbEf.db; Pooling=False;";
SQLiteConnection conn = new SQLiteConnection( connString );
conn.Open();
try
{
SQLiteCommand cmd = new SQLiteCommand( "INSERT INTO TestTable VALUES (5, 'hello')", conn );
cmd.ExecuteNonQuery();
//the next command throws exception because of uniqueness constraint violation
cmd = new SQLiteCommand( "INSERT INTO TestTable VALUES (5, 'hello')", conn );
cmd.ExecuteNonQuery();
}
catch( SQLiteException e )
{
//do nothing
}
finally
{
conn.Close();
}
try
{
//deletion fails, file still held open;
//if I comment out the second insert, deletion succeeds
File.Delete( "C:\\Temp\\TestDb\\TestDbEf.db" );
}
catch( Exception e )
{
Console.WriteLine( e.Message );
}
Any thoughts?
Re: FK exception keeps db3 file open
Posted: Thu 14 Jun 2012 07:31
by Pinturiccio
We have reproduced and fixed the bug with locking the database file after a database exception occurs. We will notify you when the corresponding build of dotConnect for SQLite is available for download.
Re: FK exception keeps db3 file open
Posted: Mon 18 Jun 2012 13:53
by adrian.petrescu
Thank you for fixing it.
So can you give an estimation to when it's going to be available?
Re: FK exception keeps db3 file open
Posted: Tue 19 Jun 2012 09:25
by Pinturiccio
We are planning to release the next public build of dotConnect for SQLite at the end of the week.
Re: FK exception keeps db3 file open
Posted: Thu 21 Jun 2012 13:22
by Pinturiccio
The new build of dotConnect for SQLite 4.0.25 is available for download now!
It can be downloaded from
http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to
http://forums.devart.com/viewtopic.php?t=24362