In a SQL server db I have a Name column in the Departments table, with nvchar(25) not null, unique. I test to see what happens if I try and save a Department with a Name that is bigger than that and get an "NHibernate.Exceptions.GenericADOException" making it clear that ""String or binary data would be truncated". So far, so good.
In another table I have a Description column in a Projects table, with nvchar(50) not null, but doesn't have the unique constraint. I put it through the exact same test (of course making sure that the Description is bigger than 50), but no exception is thrown...
I prefer the very clear exception, but I'll settle for understanding what the rules are. Also how specific do NHib exceptions tend to be across different db's. What am I missing?
Cheers,
Berryl
ANSWER
My fault! I was using a test fixture that used SqlLite instead of SqlServer. This is one of the reasons I stopped using SqlLite in the first place (there must be a reason why so many smart people seem to love it, but it's useless for verifying nhibernate mapping IMO).
Thanks!