Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7801393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:56:11+00:00 2026-06-02T00:56:11+00:00

I am using following mapping to store a Serializable object to SQL Server 2008:

  • 0

I am using following mapping to store a Serializable object to SQL Server 2008:

<class name="EMSApplication.Data.Domain.Configuration, EMSApplication.Data" table="ems_Configurations" proxy="EMSApplication.Data.Domain.IConfiguration, EMSApplication.Data" lazy="true">
  <id name="Id" type="System.Int32">
    <column name="Id" not-null="true"/>
    <generator class="native"/>
  </id>
  <property name="Settings" type="Serializable">
    <column name="Settings" not-null="true"/>
  </property>   
</class>

It is generating a varbinary(8000) for column type of the database. How can I make it to use varbinary(max)?

If I use:

<property name="Settings" type="Serializable" length="2147483647">
    <column name="Settings" not-null="true"/>
</property> 

It is also truncated to 8000. I am using NHibernate3.2(not fluent).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:56:13+00:00Added an answer on June 2, 2026 at 12:56 am

    According to the nHibernate documentation, “length” is not an attribute/property of <property> but instead should be used in <column>.

    This section shows that “length” is not a part of <property> :
    http://nhibernate.info/doc/nh/en/index.html#mapping-declaration-property

    This section shows that “length” is a part of <column> :
    http://nhibernate.info/doc/nh/en/index.html#toolsetguide-s1-2

    That last section (20.1 and the Table 20.1 Summary) shows that “sql-type” is also part of <column> so try one of these variations:

    <property name="Settings" type="Serializable">
        <column name="Settings" not-null="true" length="2147483647"/>
    </property> 
    

    or

    <property name="Settings" type="Serializable">
        <column name="Settings" not-null="true" sql-type="varbinary(max)"/>
    </property> 
    

    Edit:
    This question seems to be a duplicate of:
    How do I get fluent nhibernate to create a varbinary(max) field in sql server

    but that information is almost 3 years old and the newer version of nHibernate might have corrected for this (I have no way to test this).

    The following page appears to also be the same issue and is much more recent:
    Binary Blob truncated to 8000 bytes – SQL Server 2008 / varbinary(max)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following mapping: public class LoadMap : IAutoMappingOverride<Load> { public void Override(AutoMapping<Load>
I am trying to create a mapping file for the following Model using Fluent
Using Castor to parse the following xml into POJOs using a mapping file is
I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
I am using following class to show a grid like appearance with pagination on
Using Eclipselink/MOXy 2.3 i have following usecase in marshalling to XML: abstract class MyAbstract
I'm using ElasticSearch to index documents. My mapping is: mongodocid: { boost: 1.0, store:
Let's say I have the following entities: Store: component { property name=Id fieldtype=id generator=native;
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.