Why don't you create an issue at nhibernate.jira.com, with a simple test?
I can confirm that the problem happens. As a workaround, you can try 
disabling the preparation of commands:

cfg.SetProperty(NHibernate.Cfg.Environment.PrepareSql, Boolean.FalseString);


RP

On Tuesday, September 16, 2014 2:40:27 PM UTC+1, Carlos Souto wrote:
>
> Hi Stefan.
>
> I am struggling with the same issue.
>
> Could you please post your workaround? I am trying to use it but still no 
> luck.
>
> Cheers
>
> Carlos
>
> On Tuesday, 11 December 2012 09:39:19 UTC, Stefan EHRET wrote:
>>
>> Hi everyone!  I think I'm going crazy on this one : it's a fairly simple 
>> scenario and should be documented, but... no!
>>  
>> Here is my stored procedure declaration:
>>  
>>
>>> CREATE PROCEDURE [dbo].[spImport] ( @xmlDocument AS XML )
>>> AS
>>> --
>>> GO
>>>
>>  
>> Here is my mapping:
>>  
>>
>>> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"assembly="XXX"
>>> namespace="XXX.Entities"><sql-query name="spImport">
>>>
>> <![CDATA[EXEC [dbo].[spImport] @xmlDocument = :xmlDocument]]> 
>>> </sql-query>
>>>
>> </hibernate-mapping>
>>
>>  
>>
>> And Here is the calling method:
>>
>>> session.GetNamedQuery("spImport").SetParameter("xmlDocument", document, 
>>> NHibernateUtil.XmlDoc).ExecuteUpdate();
>>
>> Now, I'm getting the follinging error:
>>
>>> While preparing EXEC [dbo].[spImport] @xmlDocument = @p0 an error 
>>> occurred InnerException: SqlCommand.Prepare method requires all variable 
>>> length parameters to have an explicitly set non-zero Size.
>>
>> Thanks for your help, Stefan
>>
>> PS: I DO have a workaround! I'm looking for a clean solution
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to