When using "SQL domain" constrains are checked and exception is thrown in case some required field is not entered:

Xtensive.Orm.CheckConstraintViolationException : Error 'CheckConstraintViolation' while executing query 'INSERT INTO  (...)' Original message: Cannot insert the value NULL into column 'Organization.Id', table 'xyz'; column does not allow nulls. INSERT fails.
 The statement has been terminated.
  ----> System.Data.SqlClient.SqlException : Cannot insert the value NULL into column 'Organization.Id', table 'xyz'; column does not allow nulls. INSERT fails.
 The statement has been terminated.

But for in-memory database the same code works without any problem - this bring us to problem, we can't use in-memory database for unit testing, because results from these test will be inconclusive with actual SQL domain behavior.

Is this a known issue, that will be fixed somehow soon, or is there some settings to force constrains check on in-memory database?

asked Oct 04 '11 at 03:56

Martin%20Suchan's gravatar image

Martin Suchan
5112

edited Oct 04 '11 at 03:56


One Answer:

Hello Martin,

Try using Validation framework, it is expected to work for both kind of storages (in-memory & sql). Here is the link to the manual.

answered Oct 04 '11 at 06:06

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

edited Oct 04 '11 at 06:08

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×4

Asked: Oct 04 '11 at 03:56

Seen: 2,182 times

Last updated: Oct 04 '11 at 06:08

powered by OSQA