System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: b4795f3011238fb1af0737e1195bd327ce7b3897
Title: Database Schema Changed Error
Status: Closed Type: Question
Severity: Important Priority: Medium
Subsystem: Integration_Via_PInvoke Resolution: Works_As_Designed
Last Modified: 2020-10-29 02:38:10
Version Found In: 1.0.111.0
User Comments:
anonymous added on 2020-05-18 09:27:05:

We are using System.Data.SQLite dll with version 1.0.111.0 for one of the database operation.

In this operation, we are creating a new sqlite connection with following properties.

var connectionStringBuilder = new SQLiteConnectionStringBuilder { SyncMode = SynchronizationModes.Normal, Version = 3, DataSource = fileInfo.FullName, ReadOnly = false, };

Once we create a new instance of connection, opening the connection and creating a simple table with following query within a transaction.

CREATE TABLE IF NOT EXISTS TestTable( Guid Blob, Increment INTEGER NOT NULL )

Successfully able to create the table.

In our next business logic, we need to query this table to read some data and this call is happening in a another thread using a same connection which is already created during creation of table. This operation is still a synchronous operation.

SELECT Increment FROM TestTable WHERE Guid = @Guid

Problem Statement:

Whenever while executing the above mentioned select statement we are getting following error in Application Console:

"SQLite error <17>: Statement aborts at 9: [SELECT Increment FROM TestTable WHERE Guid = @Guid] Database schema has changed"

Our Analysis on this issue:

  1. Whenever this error logs in our console, not getting SQLite Exception or any base exception(verified through our logging mechanism).
  2. This error not causing any issues to our workflows. Hence not seeing any side effects or application crash.
  3. This error not occurring when we do the SELECT operation second time. Hence error is coming during first SELECT operation only.
  4. We are able to see the same error with earlier version of System.Data.SQLite(1.0.102.0)

Workaround we found to avoid this error in console:

  1. Create new SQLite connection during SELECT operation. Hence avoiding using the same connection created during table creation.

Our Questions:

  1. Why we are seeing this error in Console?
  2. Is there any retrying mechanism to prepare the SQL statement in SQLite whenever this error occurs? That's the reason still our application behaving as per the expectation.
  3. How critical this error?Do we need to ignore this error?User feels bad to see this error in his console.

mistachkin added on 2020-05-23 23:56:36:
I'm not sure what is being asked here.  However, given the complexity of the
situation you are describing, this question might be best asked on the forum:

[https://sqlite.org/forum/forumnew]