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
FK exception keeps db3 file open
-
- Posts: 3
- Joined: Fri 08 Jun 2012 16:11
Re: FK exception keeps db3 file open
This is how I can reproduce the problem:
Any thoughts?
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 );
}
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: FK exception keeps db3 file open
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.
-
- Posts: 3
- Joined: Fri 08 Jun 2012 16:11
Re: FK exception keeps db3 file open
Thank you for fixing it.
So can you give an estimation to when it's going to be available?
So can you give an estimation to when it's going to be available?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: FK exception keeps db3 file open
We are planning to release the next public build of dotConnect for SQLite at the end of the week.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: FK exception keeps db3 file open
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
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