I've been trying to map a clob field using Fluent NHibernate 1.2.0.712 against Oracle 10g. I'm using System.Data provider as it's available by default and was trying to avoid adding reference to ODP.Net due to previous client issues.
However, when I try to insert entities with mapped clob properties, I get the error:
ORA-01461: can bind a LONG value only for insert into a LONG column
I've tried to fix this by using the below convention, and decorating the appropriate property with [StringLength(4000)]:
public class StringLengthConvention : AttributePropertyConvention<StringLengthAttribute>
{
protected override void Apply(StringLengthAttribute attribute, IPropertyInstance instance)
{
instance.Length(attribute.MaximumLength);
}
}
This didn't work.
Then I tried the below using "TEXT", "CLOB" and "clob" values. Neither worked:
public class plaparteMappingOverride : IAutoMappingOverride<plaparte>
{
public void Override(AutoMapping<plaparte> mapping)
{
Map(x => x.disposiciones).CustomSqlTypeIs("TEXT");
}
}
Does anyone have further suggestions for this fix other than adding ODP as the provider?