Good Afternoon

I wanted to pass along a really strange issue we just ran into in with one
of our products. We have a simple table with an INTEGER column set with a
NOT NULL DEFAULT 0 constraint.

We have no clue how it happened, but some how a null value was successfully
inserted into this column with out the constraint triggering an error or
defaulting to 0.

The application communicating with the DB is a .NET Framework app running
System.Data.SQLite. The strange thing is that the .NET application itself
will also not allow for NULL values as it converts them to 0 before sending
back to the database. This somehow occurred with no errors occurring during
the transaction.

Once the transaction completed, then we started seeing errors in both our
application and SQLite. SQLite. SQLite just kept triggering the following
message anytime we tried to adjust the null value to fix the issue":

*"database is locked release restore point sqlite"*

My first thought was a hung journal file keeping it locked, but it wasn't
the case. An application still had hold on the database though, almost as
if it hung. We closed anything that may have had the file open. Once that
was done we were able to successfully update the column with a value and
everything continued to work.

The database locking mode is set to NORMAL but the database is always
opened exclusively. Could this been a concurrency issue in which 2
connections hit the database at the exact same time? No data loss was
reported yet.

I've been working with SQLite for a while now, and this was the first time
I've seen a constraint not catch something like this. Just wanted to pass
along as I found it odd.

Have a great day

-Justin
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to