Bug 127 - Calling a Remote method with a ref DataTable as argument causes a "InvalidOperationException: Operation is not valid due to the current state of the object" on the function return if a FilleSchema was called within this method.
Summary: Calling a Remote method with a ref DataTable as argument causes a "InvalidOpe...
Status: NEEDINFO
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-01 01:12 UTC by Kay Ackermann
Modified: 2012-03-12 22:46 UTC (History)
2 users (show)

See Also:
Tags: Remoting, RPC, FillSchema
Is this bug a regression?: ---
Last known good build:


Attachments

Description Kay Ackermann 2011-08-01 01:12:08 UTC
A client tries to retrieve a DataTable or DataSet from a server through a MarshalByRefObject.

The method called on the server i.e. GetData(ref DataTable dataTable)
uses the DataTable and an existing SQL connection to fill the table with the schema and data before it returns.

On the client when the function call returns the following exception is thrown IF the server runs on mono. On .net (Windows 7) everything is fine. If the FillSchema call (on the server side) is removed the exception will not occur.

Mono version: 2.10.2-r1
running on gentoo with kernel 3.0.


InvalidOperationException: Operation is not valid due to the current state of the object

Server stack trace: 
  at System.Data.DataSet.WriteColumnAsElement (System.Xml.XmlWriter writer, XmlWriteMode mode, System.Data.DataColumn col, System.Data.DataRow row, DataRowVersion version) [0x00000] in <filename unknown>:0 
  at System.Data.DataSet.WriteTable (System.Xml.XmlWriter writer, System.Data.DataRow[] rows, XmlWriteMode mode, DataRowVersion version, Boolean skipIfNested) [0x00000] in <filename unknown>:0 
  at System.Data.DataSet.WriteTable (System.Xml.XmlWriter writer, System.Data.DataTable table, XmlWriteMode mode, DataRowVersion version) [0x00000] in <filename unknown>:0 
  at System.Data.DataSet.WriteIndividualTableContent (System.Xml.XmlWriter writer, System.Data.DataTable table, XmlWriteMode mode) [0x00000] in <filename unknown>:0 
  at System.Data.DataTable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.MessageFormatter.WriteMethodResponse (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers, System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage (IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000] in <filename unknown>:0
Comment 1 Miguel de Icaza [MSFT] 2012-03-12 22:46:35 UTC
Please provide a self-contained test case for bugs of this nature.

Note You need to log in before you can comment on or make changes to this bug.