Why it might happen, that a SQLite database file gets locked?

568 views
Skip to first unread message

Darius Damalakas

unread,
Jul 16, 2009, 9:22:43 AM7/16/09
to nhusers
I have upgraded to NH 2.1.x, and now the tests running on SQLite
database now fail with this exception:

----> System.Reflection.TargetInvocationException : Exception has been
thrown by the target of an invocation.
----> NHibernate.TransactionException : Begin failed with SQL
exception
----> System.Data.SQLite.SQLiteException : The database file is
locked
database is locked


--SQLiteException
at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
at System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection
connection, Boolean deferredLock)
at System.Data.SQLite.SQLiteConnection.BeginTransaction(Boolean
deferredLock)
at System.Data.SQLite.SQLiteConnection.BeginDbTransaction
(IsolationLevel isolationLevel)
at
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction
()
at NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel
isolationLevel)



Any ideas why it was working before and now does not?

Fredy Treboux

unread,
Jul 17, 2009, 11:25:46 AM7/17/09
to nhu...@googlegroups.com
How about providing the test?

J M

unread,
Jul 17, 2009, 12:40:42 PM7/17/09
to nhusers
SchemaUpdate is not supported by SQLite. You'll have to move to
another database type that does support it if you really need it.

I can't find a complete list of which databases support SchemaUpdate,
but I know at least SQL Server does.

J M

unread,
Jul 17, 2009, 1:09:37 PM7/17/09
to nhusers
Sorry, ignore that. Wrong thread.

Nelson Cabral

unread,
Sep 11, 2009, 6:22:30 PM9/11/09
to nhusers
To make it clear : SchemaUpdate works with SQLite. The SQLite file
lock problem is due to multithreaded access to an SQLite db (file).
Reply all
Reply to author
Forward
0 new messages