Why Oracle ManagedDataAccess (4.121.1.0) throws a System.FormatException "first chance" exception to the debugger when you use OracleCommand.BindByName (on some machines, but not others)?

Why Oracle ManagedDataAccess (4.121.1.0) throws a System.FormatException "first chance" exception to the debugger when you use OracleCommand.BindByName (on some machines, but not others)?

This occurs when calling a ref cursor-returning packaged function stored with OracleCommand.BindByName set to true.

When BindByName undefined, it works as expected.

I've only been able to recreate this problem on a machine in my control. This issue has also reported to me by a customer.

I tried to change the locale of the system of EN - UK EN-US, but I was not aware of any change in behavior.

Similarly, I've tried explicitly overriding the default locale of the system with the OracleGlobalization parameters, and it also had no effect.

Please see the example below.

---

Environment (default):

Windows 7 Professional 64-bit SP1

Visual Studio 12.0.21005.1 REL / / CAN BE SIGNIFICANT

.NET framework 4.5.51209

Local system: EN - UK (but also does not, EN-US).

Oracle.ManagedDataAccess 4.121.1.0

"< supportedRuntime version ="v4.0"sku =". NETFramework,Version=v4.5.1"/ >

Environment (base):

Windows 7 Professional 64-bit SP1

Updated Visual Studio 12.0.31101.00 //SEE above 4

.NET framework 4.5.51209

Local system: EN - UK

Oracle.ManagedDataAccess 4.121.1.0

"< supportedRuntime version ="v4.0"sku =". NETFramework,Version=v4.5.1"/ >

Call stack:

mscorlib.dll. Unknown System.Number.StringToNumber(string str, System.Globalization.NumberStyles options, ref System.Number.NumberBuffer number, System.Globalization.NumberFormatInfo info, bool parseDecimal)
mscorlib.dll. Unknown System.Number.ParseInt32(string s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info)
Oracle.ManagedDataAccess.dll! Oracle.ManagedDataAccess.Types.OracleRefCursor.OracleRefCursor (connection Oracle.ManagedDataAccess.Client.OracleConnection, OracleInternal.ServiceObjects.OracleRefCursorImpl refCursorImpl, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long initialLongFS, long initialLobFS, long [] scnFromExecution) unknown
Oracle.ManagedDataAccess.dll! OracleInternal.ServiceObjects.OracleParameterImpl.ExtractRefCursorFromAccessor (Oracle.ManagedDataAccess.Client.OracleConnection conn, accessor OracleInternal.TTC.Accessors.Accessor, long fetchSize, Oracle.ManagedDataAccess.Client.PrmEnumType enumType, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long longFetchSize, long lobFetchSize, long [] scnFromExecution, int currentRow) unknown
Oracle.ManagedDataAccess.dll! OracleInternal.ServiceObjects.OracleParameterImpl.GetRefCursorFromBytes unknown (Oracle.ManagedDataAccess.Client.OracleConnection conn, accessor OracleInternal.TTC.Accessors.Accessor, long fetchSize, Oracle.ManagedDataAccess.Client.PrmEnumType enumType, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long longFetchSize, long lobFetchSize, long [] scnFromExecution)
Oracle.ManagedDataAccess.dll! Oracle.ManagedDataAccess.Client.OracleParameter.PostBind_RefCursor (connection Oracle.ManagedDataAccess.Client.OracleConnection, OracleInternal.TTC.Accessors.Accessor bindAccessor, long fetchSize, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long longFetchSize, long lobFetchSize, long [] scnFromExecution) unknown
Oracle.ManagedDataAccess.dll! OracleInternal.ServiceObjects.OracleCommandImpl.ExtractAccessorValuesIntoParam (Oracle.ManagedDataAccess.Client.OracleParameterCollection paramColl, Oracle.ManagedDataAccess.Client.OracleConnection connection, string commandText, long longFetchSize, long lobFetchSize, long [] scnFromExecution) unknown
Oracle.ManagedDataAccess.dll! Unknown Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(bool requery, bool fillRequest, System.Data.CommandBehavior behavior)
Oracle.ManagedDataAccess.dll! Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader (unknown)

> ManagedSimpleRefCursor1.exe! NoddyConsole.Program.Command_ExecuteReader_BindByName_Fails (Line 63 c#)

Example:

----

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Oracle.ManagedDataAccess.Client;

using Oracle.ManagedDataAccess.Types;

using System.Data;

namespace NoddyConsole

{

public class Program

{

public static int Main (string [] args)

{

Error int = 0;

Errors += Command_ExecuteReader_BindByName_Fails();

Errors += UseReturnValue_Command_ExecuteNonQuery_BindByName_Fails();

return errors;

}

public static int Command_ExecuteReader_BindByName_Fails()

{

Error int = 0;

Try

{

var conn = new OracleConnection ("UID = USER; Password = PASS; ("Data Source = / / your-host: 1521 / yours-sid");

var conn = new OracleConnection ("user Id = UNIT620; Password = UNIT620; ("Data Source = / / ln1apidb01:1521 / fm");

Conn. Open();

IRRELEVANT

OracleGlobalization og is conn. GetSessionInfo();

og. DateFormat = "HH24:MI:SS MON-DD-YYYY";

Conn. SetSessionInfo (og);

var cmd is conn. CreateCommand();

cmd.CommandType = CommandType.Text;

BindByName. cmd = true;

cmd.CommandText = "START: rc: = SHAUN.recreate_issue_1 (in_code = >: in_code); END; « ;

var prm1 is cmd. CreateParameter();

PRM1. ParameterName = "rc";

PRM1. Direction = ParameterDirection.ReturnValue;

PRM1. OracleDbType = OracleDbType.RefCursor;

cmd. Parameters.Add (prm1);

/ * SHAUN.recreate_issue_1 * /.

var prm2 is cmd. CreateParameter();

PRM2. ParameterName = "in_code";

PRM2. Direction = ParameterDirection.Input;

PRM2. OracleDbType = OracleDbType.Varchar2;

PRM2. Value = "A";

cmd. Parameters.Add (prm2);

/* */

var reader is cmd. ExecuteReader(); FAILS to System.Number.StringToNumber (String str, NumberStyles options, NumberBuffer & number, NumberFormatInfo info, Boolean parseDecimal)

/* *-/

OracleRefCursor orc = null;

cmd ExecuteNonQuery()); must fail here

ORC = cmd. Parameters ["rc"]. Value as OracleRefCursor;

If (orc is nothing)

throws InvalidOperationException new ("Invalid return the ref cursor type");

var = orc player. GetDataReader();

/* */

While (reader. Read

{

var values = new object [reader. FieldCount];

drive. GetOracleValues (values);

for (int i = 0; i < values.) Length; (++ I)

{

Console.WriteLine(values[i]);

}

}

drive. Dispose();

cmd. Dispose();

Conn. Dispose();

}

catch (Exception ex)

{

Console.Error.WriteLine (ex) Message);

Errors ++;

}

Finally

{

Return (true);

}

return errors;

}

public static int UseReturnValue_Command_ExecuteNonQuery_BindByName_Fails()

{

Error int = 0;

Try

{

var conn = new OracleConnection ("UID = USER; Password = PASS; ("Data Source = / / your-host: 1521 / yours-sid");

Conn. Open();

IRRELEVANT

OracleGlobalization og is conn. GetSessionInfo();

og. DateFormat = "HH24:MI:SS MON-DD-YYYY";

Conn. SetSessionInfo (og);

var cmd is conn. CreateCommand();

BindByName. cmd = true; // ####

cmd.CommandText = "START: rc: = SHAUN.recreate_issue_1 (in_code = >: in_code); END; « ;

cmd.CommandText = "START: rc: = SHAUN.recreate_issue_2; END; « ; No params, works

var prm1 is cmd. CreateParameter();

PRM1. ParameterName = "rc";

PRM1. Direction = ParameterDirection.ReturnValue;

PRM1. OracleDbType = OracleDbType.RefCursor;

cmd. Parameters.Add (prm1);

/ * SHAUN.recreate_issue_1 * /.

var prm2 is cmd. CreateParameter();

PRM2. ParameterName = "in_code";

PRM2. Direction = ParameterDirection.Input;

PRM2. OracleDbType = OracleDbType.Varchar2;

PRM2. Value = "A";

cmd. Parameters.Add (prm2);

/* */

var reader is cmd. ExecuteReader();

OracleRefCursor orc = null;

HERE does NOT cmd. BindByName = true; System.FormatException first-chance exception in at System.Number.StringToNumber (String str, NumberStyles options, NumberBuffer & number, NumberFormatInfo info, Boolean parseDecimal)

cmd ExecuteNonQuery());

ORC = cmd. Parameters ["rc"]. Value as OracleRefCursor;

If (orc is nothing)

throws InvalidOperationException new ("Invalid return the ref cursor type");

var = orc player. GetDataReader();

While (reader. Read

{

var values = new object [reader. FieldCount];

drive. GetOracleValues (values);

for (int i = 0; i < values.) Length; (++ I)

{

Console.WriteLine(values[i]);

}

}

drive. Dispose();

ORC. Dispose();

cmd. Dispose();

Conn. Dispose();

}

catch (Exception ex)

{

Console.Error.WriteLine (ex) Message);

Errors ++;

}

Finally

{

Return (true);

}

return errors;

}

}

}

---

create or replace package THAT SHAUN is

type ref_cur_type is ref cursor;

function recreate_issue_1)

in_code varchar2: = null

) return ref_cur_type;

end SHAUN;

/

create or replace package body what SHAUN

-TTS000233

function recreate_issue_1)

in_code varchar2: = null

) return ref_cur_type is ref_cur ref_cur_type;

Start

Open the ref_cur for

Select UO.object_name from user_objects UO;

Return ref_cur;

end recreate_issue_1;

end SHAUN;

/

---

Thanks a lot to qualify again for me Alex.  I'll try upgrading to the latest version of the provider.

The difference in behavior between the two hosts was found to be reduced to differences in configuration VS.

Checking 'Just my code' prevents the first chance thrown in the debugger exception. As in fact, the exception is handled in the provider, it is enough for me.

Tags: Database

Similar Questions

  • Why are they not the white space to the left when you use force part agricultural framework?

    I posted yesterday because I thought that the stain has been broken in the last creative cloud of LR. It still works, but seems to have a limitation that seems intuitive.

    I had an image that I used lenses correction/basic/full. It works well enough to give a full display of an image captured from an angle. There is a small spot near the edge of the frame that is left blank. I assumed spotting would allow me to fill this by cloning a neighbouring area, an operation that could be played in Photoshop, (although I have not used the PS in awhile).

    It doesn't work in LR, implying that the brightness of the White is not considered part of the rectangular frame. Why not? Don't I have that right, or am I missing something?

    If the design intent, it seems badly thought-out.

    If you have created a panorama or HDR image, and there is a space, then the image is more rectangular. It is not possible to create pixels in the empty space in Lightroom. These images were filling the white space is essential, that's what is for Photoshop in this instance. Is perhaps not as elegant as you would expect, but that's the way it works with the non-destructive editing.

  • Why Lightroom will not save the file when you use the image Capture?

    When you work with video in Lightroom 5, whenever I press "Image Capture", I get an error message that says: "cannot save the file." I tried this on several video files, and I get the same message. Video files are. MOV files. I can't understand why this is happening!

    I had this same error message. I solved it when I moved the video file on the hard disk internal to the computer, and then it worked perfectly. He always gave the error message when I used an external video file from my hard drive. There for a long time until I tried this. No one answered this problem in forums that I could find.

    I hope this helps.

  • Get the error when you use the Oracle 9.2 on RRS 4 installation

    Hi all

    I was getting error while installing oracle 9.2.0.4 in Red hat advanced server 4

    YES was generating a message
     could not able to relink ins_sqlplus.mk  and ins_rdbms.mk
    but I'd ignored, after installation of the oracle s/w, I relinked bleow files

    I also tried running the command below
    [oracle@oracle lib]$ make -f ins_sqlplus.mk install
    
    but when i try to make ins_rdbms.mk i was getting a error
    
    [oracle@oracle lib]$ make -f ins_rdbms.mk install
    .
    .
    .
    .
    .
    ..
    .
    u01/app/oracle/product/9.2.0.1/db_1/lib32/libgeneric9.a   `cat /u01/app/oracle/product/9.2.0.1/db_1/lib32/sysliblist` -Wl,-rpath,/u01/app/oracle/product/9.2.0.1/db_1/lib:/lib:/usr/lib -lm    `cat /u01/app/oracle/product/9.2.0.1/db_1/lib32/sysliblist` -ldl -lm    -lvsn9
    /usr/bin/ld: crt1.o: No such file: No such file or directory
    collect2: ld returned 1 exit status
    make[1]: *** [/u01/app/oracle/product/9.2.0.1/db_1/rdbms/lib/extproc32] Error 1
    make[1]: Leaving directory `/u01/app/oracle/product/9.2.0.1/db_1/rdbms/lib'
    Please suggest me if this will have an impact on the DB

    Published by: user00726 on July 8, 2009 23:06

    If the error only occurs when you start the dbca Wizard, the database itself should be ok. Before using it for the production you can stress test your db using swingbench or hammerora to be sure that iti works well.

    Concerning

    Oliver

  • Why do AS3 highlighting some fonts, but not others (which are quite common)?

    Hi all!

    I have a simple question that hopefully has a simple answer (which mocks me with his elusive). In the code below (from "University of Programming ActionScript 3.0 Game" of Gary Rosenzweig (2nd ed.)), I declare a style sheet simple using AS3 supported all the tags/attributes to emphasize a HTML link. My question is this: why AS3 don't highlight the chosen font (Arial), but still it will highlight some other fonts I have to substitute (such as "Times New Roman" and "Garamond")?

    // create a basic format
    var myFormat:TextFormat = new TextFormat();
    myFormat.font = "Arial";
    myFormat.size = 24;
    myFormat.bold = true;
    var myStyleSheet:StyleSheet = new StyleSheet();
    myStyleSheet.setStyle("A",{textDecoration: "underline", color: "#0000FF"});
    // create a text field with a Web URL link
    var myWebLink:TextField = new TextField();
    myWebLink.defaultTextFormat = myFormat;
    myWebLink.styleSheet = myStyleSheet;
    myWebLink.selectable = false;
    myWebLink.htmlText = "Visit <A HREF='http://flashgameu.com'>FlashGameU.com</A>!";
    myWebLink.x = 80;
    myWebLink.y = 90;
    myWebLink.width = 400;
    myWebLink.height = 30;
    addChild(myWebLink);
    var myLink:TextField = new TextField();
    myLink.defaultTextFormat = myFormat;
    myLink.styleSheet = myStyleSheet;
    myLink.selectable = false;
    myLink.htmlText = "Click <A HREF='event:testing'>here</A>";
    myLink.x = 80;
    myLink.y = 190;
    myLink.width = 400;
    myLink.height = 30;
    addChild(myLink);
    addEventListener(TextEvent.LINK, textLinkClick);
    function textLinkClick(event:TextEvent) {
     trace(event.text);
    }
    

    The underscore is here, that you're not just allowing sufficient height for the textfield object to show him.  TNR is a shorter police to the same font size, he manages to appear in 30 height.

  • Gap of white in the bottom of the phone available [was: why is not adjust the height of the browser when you use sensitive pictures]

    I'm building a sensitive site with lots of photos and I have a very frustrating problem.

    When I'm at the weight 550px I view photos on a single column and adapt their weight and size, so they don't get cut. Nice pictures across, but the bottom of the browser does not follow! So it leaves a terrible "white" after the footer space.

    I tried with and without feet, but when I display as 20 images or more (especially if they are horizontal) in a single column, it's as if the browser does not follow and leaves a blank space with nothing.

    And the solution of adding break points, he is not a good thing because I would need a break point each 100px or less! Because the 'white space' in the lower part develops very quickly!

    I don't know if I explain my problem properly, I have attached a few screenshots to illustrate the problem. It is 550px weight and there are 30 images above to resize the size and weight. Att 550px is no problem att the footer but when I start the resizing of the 'white space' begins more and more.

    If it's supposed to happen? Or y at - it something I am doing wrong? Does anyone know how to fix this? Thank you!

    Captura de pantalla 2016-03-14 a les 14.45.45.pngCaptura de pantalla 2016-03-14 a les 14.42.20.png

    I found the solution! It was just to add an att of low minimum height of the breakpoint, in the current page and the page master. As 300px worked well. It was difficult because I was dragging down the end of the page manually, so the minimum height was also changing.

  • Why the Smart Guides work on some objects, but not others?

    Hello world. I try to use benchmarks commented to help me align a small arc in a corner, so I can merge into a larger shape. Well, I got my bow on one of the anchor points and I drag the path to full fitness, but no hanging, no label 'path' or 'intersection' appears. I have all the options for Smart Guides is checked and I've got Snap to Point activated but still no luck. It's a precise alignment, a guessing game. Any idea? -Mike

    arc.png

    Hold down the Cmd key while dragging.

  • Why the HDR toning work with some pictures, but not for others?  I have CS6.

    I have Photoshop CS6 and when I go to HDR toning, it is only highlighted for work with some photos, but not others, why?  Thank you.

    HDR toning does not work with CMYK images. Change the RGB color mode, and then you will be able to use HDR toning. It also works with the color to grayscale mode.

  • Why cant the controlfile be synchronized, when you use the backup controlfile

    Hi all

    I understand a little... .to leave a DBA of my friends...

    you need a resetlog to synchronize the data file headers and the controlfiles

    (1) you need a resetlog when you perform incomplete recovery
    (2) you can complete recovery using a backup controlfile as long as you have all the necessary archived logs and online redo logs.
    (3) but not to do resetlog after 2), you must re-create the controlfile

    my questions are

    T1) are the next point above true?

    (* q2) why update slope the controlfile to oracle during recovery using backup controlfile? in this case, I do not need to recreate a controlfile, isn't?


    Rgds,
    Noob

    user12050668 wrote:
    Hi Alex and the guys,.

    Thanks for comfirming my questions.
    I wonder what...

    -resetlog was designed to synchronize the control and the data headers file isn't it?
    -When I get back, even if I am using backup controlfile, I'm actually synchronization data is not?

    Yes it's true. But also during resetlogs you get new redologs and PAPER SEQUENCE NUMBER will be 1 and the database will has new incarnation.

    so, the only reason why I need resetlog even if I finished syncing correctly to the point of failure, is simply because I am using a BACKUP controlfile?.

    Yes quite right.

  • Why you put "Open a new tab" on the right side of the browser, when you close a tab on the left and you type a new URL in the browser on the left?

    I changed my computer from XP to Windows 7 and migrated my FF browsers. But... now the tabs at the top of the page are all right (they were upper-front left - where I loved her)

    The most important is the "open a new tab" + - is on the right. But that is not sensible. Why you put "Open a new tab" on the extreme right of the browser, when you close a tab on the left and you type a new URL in the browser on the left?

    How can I put my "open a new tab" immediately to the right of 'Close tab' - as if it was before?

    Please advise?

    Try clicking on "Restore default settings" in the palette to customize to reset the toolbar customization.

    • Firefox '3-bar' menu button > customize
    • View > toolbars > customize

    You can attach a screenshot?

    • Use a type of compressed as PNG or JPG image to save the screenshot
    • Make sure you do not exceed the maximum size of 1 MB
  • Why always, I received management is not available when you use maps for the iPhone 6 and I live in the Qatar?

    Why I always get direction is not available when you use maps for the iPhone 6 more?

    Currently I live in the Qatar.

    Hi Alison, Sameh

    The reason why you see directions is not available, it's that for cards of Apple, turn-by-turn directions is not a feature that is available in the Qatar. You can search for places and satellite imagery
    Take a look at the link below for more details on what features are available in the Qatar.

    iOS 9 feature availability
    http://www.Apple.com/iOS/feature-availability/

    Nice day

  • Why isn't my old watch backup appear in the list when you set up the replacement or new shows?

    Why isn't my old watch backup appear in the list when you set up the replacement or new shows?

    I've been upgraded to a new watch, and during the installation of my phone would not offer a restore of backup.  The problem is that the factory OS on the new watch was 2.0.1 while backup of my old watch watch OS 2.1.

    I had to implement the new shows like new, then update the OS 2.1, désapparier it and pair it again.  It gave me the option to restore the backup of the original watch origin.

    [Must be like the iPhone backups, you cannot restore a backup of a newer operating system that the phone is running.]

    Hello

    Yes it is true backup must be the same ios

    See you soon

    Brian

  • My HP Director file suddenly stopped from appearing on the screen when you click on it. Why?.

    I have a hp psc 2410 photosmart all-in-one.  I am running Windows XP SP3 on Firefox.  In the last week, I could shoot is no longer my HP Director program.  I did not any changes to the computer or the printer at this time.  The printer itself works fine. HP Director file > Hpqdirec.exe< still="" exists="" in="" my="" program="" file="" directory. ="" i="" have="" tried="" clicking="" on="" that="" icon="" &="" then="" clicking="" open. ="" nothing="" happens.why? ="" and="" how="" do="" i="" get="" that="" file="" working="" again. ="">

    Hello Augie24,

    This question seems to surface on XP when updating for MS IE 7 or IE 8 MS. Even if you use Firefox, here are some steps you can take to solve the problem:

    http://support.HP.com/us-en/document/c00802504

  • When you use the Polygonal Lasso with 13 elements, I get the message 'no pixels are not selected to more than 50% ' why and how to remedy?

    When you use the Polygonal Lasso with 13 elements, I get the message ' WARNING: no pixel is selected to more than 50 percent. "  Why - and how to fix it?

    Make sure that the correct layer is selected.

    Decrease the amount of feathers.

  • When you use the brush in the development module and I have a lot less brushes to create an image, the program hangs up to what I sometimes have to use windows to complete the task.  I have ICC Intel i7 3.4 and 16 GB of RAM to operate Windows 7.  Why hang

    When you use the brush in the development module and I have a lot less brushes to create an image, the program hangs up to what I sometimes have to use windows to complete the task.  I have ICC Intel i7 3.4 and 16 GB of RAM to operate Windows 7.  Why hang up LR

    Doing a lot of brushing up on an image using Lightroom is known to have this problem. The first thing to try is to turn off the graphics acceleration (go to Preferences/Performance tab and then uncheck the box here). IF this does not help, then you can consider doing your brush in Photoshop Elements or Photoshop, instead of brushing in Lightroom.

Maybe you are looking for

  • Parallels vs. Bootcamp?

    I use Parallels to Quicken and QuickBook to ensure the continuity of my biz and personal finance since I got my Mac about 5-6 years ago. It's a pain - especially for my accountant, coming 2 X / month. I am considering getting a machine of small cheap

  • Satellite L - system of start-up failure and no DRIVE in the BIOS

    HI all, my laptop for some reason any does not seem to think he has a hard drive installed, he said nothing in the BIOS for hard drive. I made the mistake of not to make recovery disks. Someone has an idea of what I can do to get this working again?

  • p6247c graphics card upgrade?

    Hi I have a hp p6247c and I want to upgrade the graphics card in it, but I do not know what card will fit in my pc and I want to get a map similar to the 9800gt nividia please help

  • Error: The computer cannot communicate with the printer; printers HP officejet 4500 wireless all-in-one

    Original title: hp officejet 4500 wireless all-in-one printer / moved, unplugged and replugged and then in the new House when turned on laptop hp, now it will not find printer I need help with getting my hp laptop to communicate with my printer hp of

  • SelectThreadIdealProcessor

    I use the LW/CVI FDS 7.0.  I have a programme of work to acquire data at the same time a data acquisition card and two serial devices. I now need to add another sensor that acts as a TCP/IP server.  I have worked successfully with the new sensor that