Read this.

http://social.msdn.microsoft.com/forums/en-US/sqlce/thread/9fe8e826-7c20-466c-8140-4d3b0649ac09/

If you can check that the problem is similar to this then you may open a
JIRA and point to this...(or better send a patch for it, if it needs to be
corrected)

As it seems the problem is that if not specfying that a string parameter is
ntext it will assume the 4000 limit of a varchar.

Gustavo

On Mon, Dec 29, 2008 at 11:20 PM, jeff.jarrell <[email protected]>wrote:

>
> I created the DB using
>
> SqlCeEngine engine = new SqlCeEngine(_db.ConnectionString);
> engine.CreateDatabase();
>
> Then I used the SchemaExport to create the table.  The column is the
> PropertyXml and I have been round and round with the length hint. Now
> it is off.
>
>  <property name="PropertyXml" type="String"  >
>       <column name="PropertyXml" sql-type="ntext" />
>    </property>
>
> This is the output from Schema Export...
> create table PanelDesign (
>  Id NVARCHAR(16) not null,
>   DisplayElementType NVARCHAR(20) null,
>   PropertyXml ntext null,
>   DeviceId NVARCHAR(255) null,
>   primary key (Id)
> )
>
> The max is still there...
>  System.InvalidOperationException : @p1 : String truncation: max=4000,
> len=20595, value='<FlexProperties>
>
> Thanks for looking at this.
> jeff
>
> On Dec 29, 3:58 pm, "Gustavo Ringel" <[email protected]> wrote:
> > The sqlce database was created using SchemaUpdate or SchemaExport or did
> you
> > work with an already created DB? maybe the limit is in the column
> > definition.
> >
> > If you are creating the schema using one of those i will recommend
> removing
> > the hint every string greater than 4000 is supposed to be understand as
> > ntext definition for MsSqlCe dialect
> >
> > Gustavo.
> >
> > On Mon, Dec 29, 2008 at 10:35 PM, jeff.jarrell <[email protected]
> >wrote:
> >
> >
> >
> >
> >
> > > I have been working with a mapping where I am storing an xml fragment
> > > in an NText field.  The xml is about 28k bytes.  If I am working in
> > > MsSql it works fine.
> >
> > > When I change the dialect to go against MsSql Ce I get an
> > > InvalidOperationException.  When I look at the stack trace i get
> > > System.InvalidOperationException : @p1 : String truncation: max=4000,
> > > len=20595, value='<FlexP...
> >
> > > Where is the max = 4000 coming from?  I am using the SchemaExport tool
> > > to drive table creation from the mapping.
> >
> > > Here is the mapping...
> > > <?xml version="1.0" encoding="utf-8" ?>
> > > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
> > >  <class
> > > name="Crestron.Tools.DeviceLibrary.PanelDesign.DisplayElement,
> > > Crestron.Tools.PanelDesigner.UnitTests" table="PanelDesign">
> > >    <id name="Id" column="Id"  type="String" unsaved-value="" length
> > > ="16"
> > >      access="field.camelcase-underscore">
> > >      <generator class="Crestron.Tools.Core.Data.IdGenerator,
> > > Crestron.Tools.Core"/>
> > >    </id>
> >
> > >    <!-- String on the DBSide, Enum in class, note use of EnumMapper --
> >
> > >    <property name="DisplayElementType" length="20"
> >
> > >
> type="Crestron.Tools.DeviceLibrary.PanelDesign.DisplayElementTypeEnumMapper­,
> > > Crestron.Tools.PanelDesigner.UnitTests"
> > >              />
> >
> > >    <property name="PropertyXml" type="String" length="30000">
> > >      <column name="PropertyXml" sql-type="ntext"/>
> > >    </property>
> >
> > >    <property name="DeviceId" type="String"/>
> >
> > >  </class>
> > > </hibernate-mapping>
> >
> > > Thanks,
> > > jeff- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to