Click or drag to resize

IObjectDbEsentThrowOnTruncate Property

Gets or sets a flag indicating if the library should thrown an Exception if an attempt is made to save a string or byte array property value that does not fit into the database column. The default value is True. Setting this property to False will cause silent truncation of values that are too long which is the default behaviour of the library in versions prior to 3.1.

Namespace:  Orthogonal.ObjectDb.Esent
Assembly:  Orthogonal.ObjectDb.Esent (in Orthogonal.ObjectDb.Esent.dll) Version: 4.0.0
Syntax
C#
bool ThrowOnTruncate { get; set; }

Property Value

Type: Boolean
Remarks

The underlying ESENT database implementation defines string and byte array columns as being "small" or "large". Small columns can store up to 127 Unicode characters or 255 bytes. Long columns can store 1GB characters or 2GB bytes.

The introduction of this property in library version 3.1 with a default value of True is a breaking change. Applications that were previously saving truncated string or byte array values that were silently truncated will now be notified by an InvalidOperationException being thrown. This change was introduced because silent truncation (loss) of data is undesirable in robust applications.

See Also