SQLite AccessViolationException in WCF service SQLite AccessViolationException in WCF service sqlite sqlite

SQLite AccessViolationException in WCF service


The error is consistent With the provider loosing track of which Connections are open:

  • Trying to Close a Connection that does not exist
  • Trying to use a Connection that does not exist

The error looks like a problem with Connection pooling, but Your Connection string does not use Connection pooling and it is turned off by default.

Does anything else Access the same database With Connection pooling turned on?

The first thing you must do is to log the exception.


Your class may not be thread safe. Check that multiple thread does not call the Save method at the same time.

Also make sure you implement IDisposable to dispose of your SQLiteConnection object if it is a private member of your class.