[Mono-bugs] [Bug 430413] New: System.Data.OracleClient:
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sat Sep 27 12:51:45 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=430413
Summary: System.Data.OracleClient:
Product: Mono: Class Libraries
Version: 1.9
Platform: x86
OS/Version: RHEL 4
Status: NEW
Severity: Major
Priority: P5 - None
Component: Sys.Data
AssignedTo: bnc-blr-team-mono at forge.provo.novell.com
ReportedBy: ernezto at gmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: Development
Description of Problem:
I'm trying to retrieve a BLOB field from a table in an Oracle database, convert
it or cast it to byte[] and save it to the hard disk, the content of that field
is a a PDF document, but I'm getting an exception. This code works OK on MS
NET 1.1, I tried several ways to get the byte[] from the OracleDataReader but
always get the same exception.
Steps to reproduce the problem:
This is one of the options I use to retrieve the byte[]... if the
OracleDataReader has rows, it will have just only one... (I mean in my case)
byte[] img;
if (rd.HasRows)
{
rd.Read();
img = (byte[])rd["IMAGEN"];
caminoImagen = directorio + idImagen.ToString() + ".pdf";
fs = new FileStream(caminoImagen, FileMode.Create, FileAccess.Write);
fs.Write(img, 0, img.Length);
fs.Close();
}
Actual Results:
I got an exception (check details on Additional Information), the exception is
a System.NullReferenceException: Object reference not set to an instance of an
object, BUT I debugged the method and the OracleDataReader do have value there,
an array of bytes, I don't know why the cast to byte[] don't work in Mono.
Expected Results:
Get the BLOB field value converted to byte[]...
How often does this happen?
Always.
Additional Information:
System.NullReferenceException: Object reference not set to an instance of an
object
at System.Data.OracleClient.Oci.OciLobLocator.GetLength (Boolean binary)
[0x00000]
at System.Data.OracleClient.OracleLob.get_Length () [0x00000]
at System.Data.OracleClient.OracleLob.get_Value () [0x00000]
at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleLob:get_Value ()
at System.Data.OracleClient.OracleDataReader.GetValue (Int32 i) [0x00000]
at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleDataReader:GetValue (
int)
at System.Data.OracleClient.OracleDataReader.get_Item (System.String name)
[0x00000]
at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleDataReader:get_Item (
string)
at SARENWS.Negocio.Documento.ObtenerPDF (System.String cadenaConexion, Int32
tipoOficina,
System.String id) [0x00000]
--
Configure bugmail: https://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