Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I'm experiencing a problem with file descriptors leaking despite disposing of commands and connections.
I can reproduce this with the sample code in the mono touch docs (running it under macosx, not the iOS simulator or an iOS device) at http://docs.xamarin.com/ios/advanced_topics/system.data#Mono.Data.Sqlite
After running that code, but before exiting if I run lsof I see 5 open file descriptors on the database.
Modifying the code so that the connection is disposed (via a using) doesn't change anything.
Adding pooling=false to the connection string doesn't change anything.
I noticed this, too, and would like to offer some additional information. An exception summary from my application seems to indicate that there is an exception thrown in Mono.Data.Sqlite.SqliteConnection:Close() which is probably causing this issue.
3 throws from:
Or rather from SQLiteBase:CloseConnection.
If you look at the exception, you'll see this message:
Mono.Data.Sqlite.SqliteException The database file is locked, unable to close due to unfinalised statements
this happens because the connection is closed before the command using the connection is disposed.
The sample code has been fixed to close the connection after disposing the command.