title: NHibernate is truncating long strings when saving
body: <p>I am having issues saving very long strings to the database using <code>NHibernate</code>. The strings are being truncated to 43,680 characters. The string is a very long <code>XML</code> packet that varies in size, but sometimes is very long.</p>
  
  <p>The database data type is <code>nvarchar(max)</code> so the limitation is not there.</p>
  
  <p>Can somebody help me understand why <code>NHibernate</code> is truncating this, and how I can prevent it?</p>
  
  <p>Here is my mapping:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    assembly="Application.DataObjects"
    namespace="Company.Application.DataObjects.Transaction.Domain"&gt;
  
    &lt;class name="TransactionDO" table="Transactions"&gt;
      &lt;id name="TransactionID"&gt;
      &lt;/id&gt;
      &lt;property name="Created" /&gt;
      &lt;property name="LongXML"  type="StringClob"&gt;
        &lt;column name="LongXML" sql-type="nvarchar(max)"/&gt;
      &lt;/property&gt;
      &lt;property name="ProcessConstructor" /&gt;
      &lt;property name="VeryLongXML" type="StringClob"&gt;
        &lt;column name="VeryLongXML" sql-type="nvarchar(max)" /&gt;
      &lt;/property&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>