Deserialize problem with OracleException

  • Thread starter Thread starter Dean Bostic
  • Start date Start date
D

Dean Bostic

On August 19, 2003, a reader discovered that he couldn't
deserialize an OracleException. He began a thread with
Scot Rose of Microsoft where he described the nature of
the problem. The reader wrote,

"We have narrowed it down to the constructor
OracleException
(System.Runtime.Serialization.SerializationInfo
si,System.Runtime.Serialization.StreamingContext sc),
which looks for
members "message" and "source", but the GetObjectData
(...) method in the
base (System.Exception) uses the strings "Member"
and "Source". Since the
element lookup in SerializationInfo is case sensistive,
GetElement() and
FindElement() fail and the OracleException deserialize
throws an exception."

Scot Rose asked for a small project and the reader
provided one. There is no record of a response from MS.

So here's another project, a console app, that
demonstrates the problem. I am running framework 1.0
with a "hotfix" version of System.Data.OracleClient.dll,
version 1.0.1088.0 that fixes some of the MANY bugs in
this provider.

Can someone from MS follow-up on this bug and provide a
work-around?

Imports System.IO
Imports System.Data.OracleClient
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
Module Module1

Sub Main()
Dim conn As New OracleConnection("Data
Source=ussxt6;User Id=foresight_mcp;Password=xxx")
Dim cmd As New OracleCommand("select * from
blah_blah", conn) ' will throw "Table or View does not
exist"
Dim reader As OracleDataReader
Try
conn.Open()
reader = cmd.ExecuteReader()
Catch e As OracleException
Dim formatter As New BinaryFormatter()
Dim stream As Stream = File.Open
("c:\temp\foo.bin", IO.FileMode.Create,
IO.FileAccess.ReadWrite)
formatter.Serialize(stream, e)
stream.Close()
stream = File.Open("c:\temp\foo.bin",
FileMode.Open, FileAccess.Read)
Try
Dim obj As Object = formatter.Deserialize
(stream)
Catch xx As Exception
MsgBox(xx.ToString())
End Try

Dim phoenix As OracleException = CType
(formatter.Deserialize(stream), OracleException)
MsgBox(phoenix.ToString())
Finally
If Not reader Is Nothing Then reader.Close()
If Not conn Is Nothing Then conn.Close()
End Try
End Sub

End Module
 
Dean,
I have verified your repro and will be looking into this, I believe that you
are correct about the reason, "Member" instead of "message"
Thank you,
 
There are two problems here, we are looking for "message" which should be
"Message", and "source" which should be "Source".
The second problem is that "Source" is typed as an int and should be a
string.
 
I am sorry, for various reasons we cannot discuss in the newsgroups future
dates of bug fixes and information about future releases.
That said I believe this is a serious issue and it is being treated as such,
I will post here when I hear anything.
Thank you,
 
Thank you, Angel, for sticking with this. The inability
to deserialize an Oracle exception will affect most
everyone who is trying to use Oracle in a remoting
configuration.
 
The QFE fix for this bug is ready, you can obtain the fix by contacting PSS
directly, this is a free support call. Let me know if there are any
problems.
Thank you,
 
Can you please provide a QFE number for this fix so that I
can find it on the PSS site? Thanks for your timely
response.
-----Original Message-----
The QFE fix for this bug is ready, you can obtain the fix by contacting PSS
directly, this is a free support call. Let me know if there are any
problems.
Thank you,
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Dean Bostic said:
Thank you, Angel, for sticking with this. The inability
to deserialize an Oracle exception will affect most
everyone who is trying to use Oracle in a remoting
configuration.


.
 
john,
I believe the KB number for this is going to be (not posted yet)
KB 829195 BUG: .Net Oracle Provider fails deserilization

Hope this helps,
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.


john m said:
Can you please provide a QFE number for this fix so that I
can find it on the PSS site? Thanks for your timely
response.
-----Original Message-----
The QFE fix for this bug is ready, you can obtain the fix by contacting PSS
directly, this is a free support call. Let me know if there are any
problems.
Thank you,
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Dean Bostic said:
Thank you, Angel, for sticking with this. The inability
to deserialize an Oracle exception will affect most
everyone who is trying to use Oracle in a remoting
configuration.


.
 
Back
Top