[Mono-bugs] [Bug 667236] New: OracleClient OUT parameters have decimal values instead of integer values

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 26 02:32:27 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=667236

https://bugzilla.novell.com/show_bug.cgi?id=667236#c0


           Summary: OracleClient OUT parameters have decimal values
                    instead of integer values
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Kalyanov.Dmitry at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=410432)
 --> (http://bugzilla.novell.com/attachment.cgi?id=410432)
The test program

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13
(KHTML, like Gecko) Chrome/9.0.597.19 Safari/534.13

To insert an entity into Oracle database NHibernate issues queries like this:

"INSERT INTO NEWS (Id, Header, NEWS_DATE) VALUES (hibernate_sequence.nextval,
:p0, :p1) returning Id into :nhIdOutParam"

In this query, "nhIdOutParam" is a parameter with OUT direction and with Int32
type. NHibernate uses it to retrieve identifier of newly added row. But after
executing this command the "nhIdOutParam" parameter gets value of type
System.Decimal (instead of expected System.Int32) and NHibernate crashes when
it tries to assign this value to the Id property of an object:

NHibernate.PropertyAccessException: The type System.Decimal can not be assigned
to a property of type System.Int32 setter of
Bars.EAS.DataAccess.PersistentObject.Id ---> System.ArgumentException: failed
to convert parameters

A minimal program that shows a similar behavior is attached.

The attached patch fixes this problem.

Reproducible: Always

Steps to Reproduce:
1. Change the oracle database credentials in the attached program and compile
it  with "mcs oracleout.cs -r:System.Data.OracleClient"
2. run "mono oracleout.exe --create-table"
3. run "mono oracleout.exe"
Actual Results:  
"System.Decimal" is printed to the console

Expected Results:  
"System.Int32" is printed to the console.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list