This discussion is archived
0 Replies Latest reply: Mar 30, 2012 6:46 AM by 922347 RSS

Bug: int16 vs. int32

922347 Newbie
Currently Being Moderated
There is obviously a bug in ODAC 11.2.0.3.0:

Example: For a column defined as NUMBER(5,0) a short (int16) will be generated instead of a int (int32).

When there is a value smaller than -32,768 or bigger than 32,767 the following exception will be thrown: Value was either too large or too small for an Int16.
StackTrace:
at System.Decimal.ToInt16(Decimal value)
at System.Decimal.System.IConvertible.ToInt16(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Oracle.DataAccess.Client.OracleDataReader.ChangeType(Object sourceValue, Type targetType)
at Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.RowNestedResultEnumerator.MoveNext()
at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.TryReadToNextElement()
at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.ReadElement()
at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.MoveNext()

At the moment we're using the following workaround: Changing Int16 to Int32 in the generated C# model (it is a bit more then just a Search & Replace). This is only a workaround of course since that changes will be lost after the model needs to be regenerated.

Any chance to get a fix for this?

--hfrmobile                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points