Hi,
i found a solution for me. My approach is to limit the scale of the
number field in my table.
In my case i used number(38,16).
After setting this, the error was gone.

I know this is only a solution if you can live with this limitations,
but for me this works great.

If you have any other ideas, please let me know about it.

Regards

Ralph

On Nov 8, 11:48 am, Ralph <[email protected]> wrote:
> Hi,
> i'm using nHibernate with the Oracle.DataAccess Components
> (2.111.7.20).
> I get an "System.OverflowException: Arithmetic operation resulted in
> an overflow." exception when i want to read an Decimal with more than
> the .net supportet digits. I looked around in various forums and
> searched for an solution but the only solutions were to manipulate the
> sql statements like truncating or doing rounds. Ok this sounds good.
> But what could be the solution when you want to load mapped entities
> lazily?
> Is there any way to tell nhibernate to automatically generate an
> statement with the trunc or round function?
>
> My Mapping (NHibernateMappingAttributes) looks like this:
>
> [Property(Column = "MYNUMBERVALUE")]
> public virtual Decimal MyNumberValue{ get; set; }
>
> I tried to set the Precision or Length Attribute without the desired
> result.
>
> The Exception looks like this:
> System.OverflowException: Arithmetic operation resulted in an
> overflow.
>    at Oracle.DataAccess.Types.DecimalConv.GetDecimal(IntPtr numCtx)
>    at Oracle.DataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
>    at Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
>    at Oracle.DataAccess.Client.OracleDataReader.get_Item(Int32
> i)........
>
> An this is how i will use the Entity:
> TheAffectedEntity a = p.SomeOtherEntity.TheAffectedEntity;
>
> I hope you understand what my problem is.
> Thanks in advance for your replies.
>
> Regards
>
> Ralph

-- 
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