Added explicit dispose to Sqlite commands and data reader. #184

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

brndmg commented Jan 19, 2013

I was having issues when performing inserts while looping and discovered that after ~15 iterations/inserts it would lock the database file. Upon adding the explicit dispose to the commands, the issue did not reoccur. I also added a dispose to the reader object for good measure.

The issue and resolution are also described here in Sqlite's ticketing system.
http://system.data.sqlite.org/index.html/info/3186bfc523

Contributor

CreepyGnome commented Jan 21, 2013

First I tried getting him to accept this as a bug in a previous pull request for all 4 files. Second don't call dispose directly, place the command in a using statement so it follows the pattern and it will get disposed no matter what. If you call dispose directly and there is an exception prior to the dispose it will not get called, and a using is cleaner than a try/finally.

@brndmg brndmg closed this Jan 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment