Friday, February 04, 2005

After some banging of my head on a wall, I found what I believe to be a bug in Oracle's .NET data provider (or ODP).  Or, at the very least, it is some non-intuitive behavior.  We have a byte-based enum that is stored in the db for a reporting tool.  As we all know, bytes are unsigned, but somehow a bunch of my values were negative in the database.  Closer inspection indicated that my values had been treated as if byte was signed.  After a thorough review of my code, I fired up Reflector to dig through the ODP code.  After a little while, It became clear ODP was treating my byte as if it were signed.  Although the actual problem is in unmanaged world, here's a troubling method that's called during the binding process:

internal unsafe void SetPrmValCtx(byte b, int index)
{
*(((sbyte*) (this.m_pOpoPrmValCtx.pBltVal + index))) = b;
}

It was easy enough to work around, since our API is several layers removed from ODP itself.  But annoying nonetheless, especially since using an sbyte (signed byte) as a parameter value will throw an exception.  Just thought Google might be able to help someone else out in the future using this information.  in the meantime, I'll make sure Oracle knows about this little annoyance.

posted on Friday, February 04, 2005 1:47:10 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
Related posts:
LinqToStdf now on CodePlex
Image Slicer for Deep Zoom in Silverlight 2
Silverlight limitations and Constrained Callvirt in IL
What are the generic Delegates in the framework for?
What is System.__Canon and why is it on my stack?
Adding support for .ashx-based views in ASP.net MVC
Tracked by:
"looking for a diet pill that works" (looking for a diet pill that works) [Trackback]
"sheet folder" (sheet folder) [Trackback]
"Victorian Clothing" (Victorian Clothing) [Trackback]
"auto air conditioning repair" (auto air conditioning repair) [Trackback]
"Hair Color Advice" (Hair Color Advice) [Trackback]
"Discount Table Linens" (Discount Table Linens) [Trackback]
"nella stanza morsicate" (nella stanza morsicate) [Trackback]
"promotional scarves" (promotional scarves) [Trackback]
"Husky Puppy Picture" (Husky Puppy Picture) [Trackback]
"topamax for migraine %2B hypothyroid" (topamax for migraine %2B hypothyroid) [Trackback]
"defense acquisition" (defense acquisition) [Trackback]
"BABY SHOWER INVITATIONS" (BABY SHOWER INVITATIONS) [Trackback]
"Counterstrike Hacks" (Counterstrike Hacks) [Trackback]
"Free SMS Service UK" (Free SMS Service UK) [Trackback]
"orange county jail" (orange county jail) [Trackback]
"arizona child support guidelines" (arizona child support guidelines) [Trackback]
"caugh masturbating stories" (caugh masturbating stories) [Trackback]
"drag boat racing pictures" (drag boat racing pictures) [Trackback]
"child abuse stories" (child abuse stories) [Trackback]
"Free Criminal Records Check" (Free Criminal Records Check) [Trackback]
"used pontoon boat trailers in wisconsin" (used pontoon boat trailers in wiscons... [Trackback]
"hong kong restaurants" (hong kong restaurants) [Trackback]
"Adderall in Mexico" (Adderall in Mexico) [Trackback]
"CAncun wallpaper" (CAncun wallpaper) [Trackback]
"velvet hookah carrie" (velvet hookah carrie) [Trackback]
"Free Trojan Antivirus" (Free Trojan Antivirus) [Trackback]
"Funny Voice Mail Greetings" (Funny Voice Mail Greetings) [Trackback]
"wholesaler of sterling silver jewelry" (wholesaler of sterling silver jewelry) [Trackback]
"Free pop up blocker" (Free pop up blocker) [Trackback]
"water injection for cummins" (water injection for cummins) [Trackback]
"image storage" (image storage) [Trackback]
"chest x-ray basic" (chest x-ray basic) [Trackback]
"stri vectin Sd" (stri vectin Sd) [Trackback]
"advance cash cash loan payday payday" (advance cash cash loan payday payday) [Trackback]
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):