Mark B.
unread,Sep 7, 2010, 1:44:08 PM9/7/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Fluent NHibernate
Hello All,
I am trying to use SQLite (version 3 in-memory db) within my
integration tests, but my tests consistenly fail throwing the
following message:
System.Data.SQLite.SQLiteException : Abort due to constraint
violation
Version may not be NULL
I have mapped a very simple object using optimistic concurrency as
follows:
Id(x => x.Id).GeneratedBy.GuidComb();
...
OptimisticLock.Version();
Version(x => x.Version)
.Column("Version")
.UnsavedValue("null")
.CustomSqlType("timestamp")
.Generated.Always();
When I run my tests against MS SQL Server, the insert statement that
is generated does not pass a value for the 'Version' field. SQLServer
creates a binary value and inserts that value into the 'Version' field
automatically.
When I try to run my tests against my SQLite in-memory db, however,
the binary value is not auto-generated by SQLite. (which leads to the
aforementioned exception)
Is there any way to map an object so that the Version field auto
generates a binary value for both MS SQL Server and SQLite? Any help
is MUCH appreciated!