I've run into an unfortunate problem doing some simple stuff with the managed dll. The problem does not occur with the mixed code dll, but unfortunately I have to be able to run this on Win2008, which I wasn't able to do using the mixed code version.
I simplified the code down to this, which causes the handle leak.
using System.Data.SQLite;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SQLiteConnection conn = new SQLiteConnection("Data Source=c:\\test.db");
conn.Open();
SQLiteCommand cmd = new SQLiteCommand("select * from updates", conn);
SQLiteDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
dr.Dispose();
cmd.Dispose();
conn.Close();
}
}
Using the managed dll (v.1.0.66.0) and sqlite3.dll (3.6.23.1), every time the page is refreshed, w3wp.exe leaks another handle to c:\test.db. I've duplicated the issue on win2003x32 and win2008x64. I tried recycling the app pool to see if that would clear it, but that unfortunately didn't work. The only way to clear it is to restart IIS.
Any ideas on how to work around this? I'm not averse to using the mixed code dll if I can get it running under win2008. I found some mentions of having to switch IIS to full trust to get that to work, but was unable to get that working. I'm also a bit unsure about altering machine.config files, since this will be residing on servers owned by others and residing in their data centers.