7 Replies Latest reply: Oct 11, 2013 4:14 PM by Alex.Keh .Product.Manager-Oracle RSS

    Managed Dirver InputOutput Param Issue

    Dronkoff

      Hi!

      How do you think, can we treat behavior difference between managed and unmanaged as an issue?

       

      Fake procedure:

      PROCEDURE in_out_test( p_some_id number)

      is

      begin

      null;

      end;

       

      Sample code:

      using System;
      using System.Data;
      //using Oracle.DataAccess.Client;
      using Oracle.ManagedDataAccess.Client;

      namespace ManagedODPInOutParamTest
      {
      class Program
      {
        static void Main(string[] args)
        {
         Console.WriteLine("go");
         try
         {
          using (var conn = new OracleConnection())
          {
           conn.ConnectionString = "Data Source=vos;User ID=tf2_cust;Password=bla-bla-bla;";
           conn.Open();
           using (var cmd = new OracleCommand("TEST.in_out_test", conn))
           {
            cmd.CommandType = CommandType.StoredProcedure;
            var param = cmd.Parameters.Add("p_some_id", OracleDbType.Decimal, ParameterDirection.InputOutput);
            param.Value = 123456;

            Console.WriteLine("param val befor execute: " + param.Value);

            cmd.ExecuteNonQuery();

            Console.WriteLine("param val after execute: " + param.Value);
           }
           conn.Close();
          }
         }
         catch (Exception ex)
         {
          Console.WriteLine(ex.ToString());
         }
         Console.WriteLine("press");
         Console.ReadLine();
        }
      }
      }


      Using Oracle.DataAccess we got:

      go

      param val befor execute: 123456

      param val after execute: 123456

      press

       

      Using Oracle.ManagedDataAccess we got:

      go

      param val befor execute: 123456

      param val after execute: null

      press

       

      I know that procedure is declared without IN OUT keyword on parameter, but the behavior of managed driver differs from the unmanaged one and this makes them not fully compatible.

      Will this be fixed? Or in order to move to managed driver we have to rewrite code, that works fine with unmanaged?

       

      PS: Server version: 11.2.0.3.0, Client version: 12.1.0.1.0, OS: Win7 x64.