[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

.NET remoting problem with big dataset

Ralovski

10/21/2004 9:36:00 AM

Hi all,
I try to make a 3 tier application
i have a Bussiness Logic Serializable() class Art which have method public dsArt GetData();
i have an Interface IClient with method dsArt GetArtData();
I have a class public class ServerAdmin : MarshalByRefObject, IClient with method
public dsArt GetArtData()
{
BLL.Art obj = new Art(); - this is Bussiness Logic class
return obj.GetData();
}
in server application i do:

BinaryServerFormatterSinkProvider providerServer = new BinaryServerFormatterSinkProvider();
providerServer.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
BinaryClientFormatterSinkProvider providerClient = new BinaryClientFormatterSinkProvider();
IDictionary props = new Hashtable();
props["port"] = 9000;
props["name"] = "ServerChannel";
TcpChannel chan = new TcpChannel(props, providerClient, providerServer);
ChannelServices.RegisterChannel( chan );
RemotingConfiguration.ApplicationName = "ServerObject";
RemotingConfiguration.RegisterWellKnownServiceType(
Type.GetType( "Server.ServerAdmin, Server.ServerAdmin" ),"Server.ServerAdmin.Binary", WellKnownObjectMode.Singleton );

In client I do :

BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
IDictionary props = new Hashtable();
props["port"] = 0;
props["name"] = logid;
props["typeFilterLevel"] = TypeFilterLevel.Full;
TcpChannel chan = new TcpChannel(
props,clientProvider,serverProvider);

private IClient adminServer = null;
adminServer = (IClient ) Activator.GetObject(
typeof( Interfaces.IClient.IClient ),
GetHost() + GetPort() + "/" + GetURL());

and everythins work good
unless :-)
returned dataset contains 1.000.000 rows
the dataset contains only one table filled with Select *

i recieve an error message:

"System.ArgumentOutOfRangeException: capacity must be greater than zero.\r\n
Parameter name: capacity\r\n\n
Server stack trace: \n
at System.Text.StringBuilder..ctor(Int32 capacity)\r\n
at System.Data.DataSet.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)\r\n
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)\r\n at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)\r\n at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)\r\n at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream seriali
zationStream, Object graph, Header[] headers, Boolean fCheck)\r\n at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.SerializeResponse(IServerResponseChannelSinkStack sinkStack, IMessage msg, ITransportHeaders& headers, Stream& stream)\r\n at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)\n\nException rethrown at [0]: \n at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n "

Does anyone have a solution to problem ?
thanks in advance !
sorry for possibly language errors :-)
english is not my mother tongue


___
Newsgroups brought to you courtesy of www.dotnetjohn.com