https://nhibernate.jira.com/browse/NH-2528
Throw exception instead of silently truncate string and blob data

In NHibernate 3.1, mapping a property with a string and e.g. length
10. Setting the property to a string of length 20 will trigger no
exception but instead silently truncate the string to 10 characters.

In the issue report it is argued that this behavior is the behavior of
the DataProvider and that NHibernate shouldn't change that. To me this
seems like a bad position to take, since it means that by default
NHibernate and the system may destroy data. The users data should be
sacred and the least destructive alternative should be the default.
The application developer can then make an informed decision and
enable silent truncation where relevant.

As it is now, there is a big risk that the problem will only surface
much later, after having already destroyed a bunch of data...


/Oskar

Reply via email to