[Mono-bugs] [Bug 530954] New: System.Data OracleClient - Timestamp parameter regression - exception when calling stored proc

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Aug 13 13:27:39 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=530954


           Summary: System.Data OracleClient - Timestamp parameter
                    regression - exception when calling stored proc
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86-64
        OS/Version: SLES 11
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: bnc-blr-team-mono at forge.provo.novell.com
        ReportedBy: webservices at landmarkdigital.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11)
Gecko/2009060200 SUSE/3.0.11-0.1.1 Firefox/3.0.11


When trying to execute an oracle stored procedure with a timestamp input
parameter, you get this error.  Changing the type to DateTime, this does not
fail.  (Of course, DateTime does not support sub-second accuracy)

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.Data.OracleClient.OracleParameter.Bind
(System.Data.OracleClient.Oci.OciStatementHandle statement,
System.Data.OracleClient.OracleConnection con, UInt32 pos) [0x00ce5] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs:798 
  at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleParameter:Bind
(System.Data.OracleClient.Oci.OciStatementHandle,System.Data.OracleClient.OracleConnection,uint)
  at System.Data.OracleClient.OracleCommand.BindParameters
(System.Data.OracleClient.Oci.OciStatementHandle statement) [0x00007] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:272 
  at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal
(System.Data.OracleClient.Oci.OciStatementHandle statement, Boolean
useAutoCommit) [0x00021] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:402 
  at System.Data.OracleClient.OracleCommand.ExecuteNonQuery () [0x0003f] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:435 
  at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleCommand:ExecuteNonQuery ()
  at example.MainClass.Main (System.String[] args) [0x00082] in
/home/kray/Projects/example/example/Main.cs:30 

Reproducible: Always

Steps to Reproduce:
deomonstration app

using System;
using System.Data;
using System.Data.OracleClient;

namespace example
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            System.Environment.SetEnvironmentVariable("TNS_ADMIN",
"/home/tns");
            System.Data.OracleClient.OracleParameter param = new
System.Data.OracleClient.OracleParameter();
              param.ParameterName = "TimestampParam";
              param.OracleType    =
System.Data.OracleClient.OracleType.Timestamp;
              param.Direction     = System.Data.ParameterDirection.Input;
              param.Value         = DateTime.Now;

            System.Data.OracleClient.OracleConnection conn = new
System.Data.OracleClient.OracleConnection();
            conn.ConnectionString = "Data Source=TNS_ENTRY;User
Id=UserName;Password=Password";
            conn.Open();

            System.Data.OracleClient.OracleCommand cmd = new
System.Data.OracleClient.OracleCommand();

            cmd.CommandText = "ProcedureName";
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Connection = conn;

            cmd.Parameters.Add(param);

            cmd.ExecuteNonQuery();
        }
    }
}
Actual Results:  
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.Data.OracleClient.OracleParameter.Bind
(System.Data.OracleClient.Oci.OciStatementHandle statement,
System.Data.OracleClient.OracleConnection con, UInt32 pos) [0x00ce5] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs:798 
  at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleParameter:Bind
(System.Data.OracleClient.Oci.OciStatementHandle,System.Data.OracleClient.OracleConnection,uint)
  at System.Data.OracleClient.OracleCommand.BindParameters
(System.Data.OracleClient.Oci.OciStatementHandle statement) [0x00007] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:272 
  at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal
(System.Data.OracleClient.Oci.OciStatementHandle statement, Boolean
useAutoCommit) [0x00021] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:402 
  at System.Data.OracleClient.OracleCommand.ExecuteNonQuery () [0x0003f] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:435 
  at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleCommand:ExecuteNonQuery ()
  at example.MainClass.Main (System.String[] args) [0x00082] in
/home/kray/Projects/example/example/Main.cs:30 

Expected Results:  
should work as it did in Mono 2.2


This affects an application currently in production that we were trying to move
to SLES 11 / Mono 2.4.2.

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


More information about the mono-bugs mailing list