Deserialize problem with OracleException

  • Thread starter Thread starter John A
  • Start date Start date
J

John A

When we remote calls to a component that throws a
System.Data.OracleClient.OracleException, we see a SerializationException
when the original OracleException is being deserialized on the client.

This is the error text:
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.Runtime.Serialization.SerializationException: Member message was not
found.
at System.Runtime.Serialization.SerializationInfo.GetElement(String name,
Type& foundType)
at System.Runtime.Serialization.SerializationInfo.GetValue(String name,
Type type)
at System.Data.OracleClient.OracleException..ctor(SerializationInfo si,
StreamingContext sc)

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.

Does anyone know of a fix or workaround (other than having to extract the
exception string before it gets serialized)?

John Aranha
 
I found that there is a bug similar to this... What version of VS.Net are you running? (1.0 or 1.1 framework ) suposed to have been fixed by 1.1 but it would be nice to know if it has or
not...

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
 
Scot,

I am using the 1.1 version of the framework - although we have noticed it in
the 1.0 version as well.

John Aranha

Scot Rose said:
I found that there is a bug similar to this... What version of VS.Net are
you running? (1.0 or 1.1 framework ) suposed to have been fixed by 1.1 but
it would be nice to know if it has or
not...

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com
or the Microsoft Knowledge Base at http://support.microsoft.com
 
I have sent you a small repro case using the RemotingHello sample in the
SDK. Let me know when you are able to reproduce the problem.

The workaround I suggested earlier would be very difficult to implement in
all the remoted components we use.

John

Scot Rose said:
Do you have a small sample project that reproduces the problem? If so send
it to me and I will see if we can reproduce it here. If its that bug however
I haven't found any
workarounds. You mentioned one in your first Post. Have you tried that option?

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com
or the Microsoft Knowledge Base at http://support.microsoft.com
 
Back
Top