I could not believe it in the beginning. But that is the fact. 
 
I was updating a collection into a database table. One of the field in the 
collection is a string type. 
I debugged into nHibernate 3.3.1 code, (see my initial post). My column 
width in the table (hbm mapped) is 220. But I found that parameter.Size , 
which should have been set to 220 , was actually set to 15, which is the 
length of the string "Atlanta AAA Ltd", the value of this field at the 
first row of the collection.
I set the string other length as well, parameter.Size was always set to 
that length.
 
I could not debug any furthur into IDbDataParameter , because I don't have 
the source code.
 
Michael Fan
 
=========================
On Monday, November 19, 2012 11:07:29 AM UTC-5, Oskar Berggren wrote:

> 2012/11/19 Michael Fan <[email protected] <javascript:>> 
>
> > IDbDataParameter parameter.Size is set to the length of the string of 
> the first row in collection, instead of the column size defined in the 
> table 
>
> How do you conclude "set to the length of the string of the first row 
> in collection"? I don't quite get that part. 
>
> NH will not set the parameter size according to the column size in the 
> table, but some drivers will set the parameter size based on the 
> length attribute from your mapping. However, the SybaseAseClientDriver 
> does not appear to do that. 
>
>
> Could it be that the Sybase ADO.NET provider has a provider specific 
> behavior of changing parameter.Size when the value is assigned? 
>
> /Oskar 
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/Q244PhTV6eYJ.
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