在Remoting中壓縮傳縮DataSet的解決方案
基於.NET Remoting的多層架構的一個問題:傳輸大量數據的DataSet時,出現
System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
我做過小小的統計,當我Select Top 10000條記錄或以下時,不會出錯,Select Top 20000就會出錯了。本人認為是傳輸有問題,想壓縮下再傳輸,根據網友zendy的"实现一个压缩Remoting传输数据的Sink:CompressionSink "(http://www.cnblogs.com/caomao/archive/2005/07/29/202942.html) 卻出現了另一個錯誤:
System.Exception: System.FormatException: Header checksum illegal
at NZlib.Compression.Inflater.DecodeHeader() in D:\Hoplun\Compression\NZipLib\Compression\Inflater.cs:line 223
at NZlib.Compression.Inflater.Decode() in D:\Hoplun\Compression\NZipLib\Compression\Inflater.cs:line 397
at NZlib.Compression.Inflater.Inflate(Byte[] buf, Int32 off, Int32 len) in D:\Hoplun\Compression\NZipLib\Compression\Inflater.cs:line 671
at NZlib.Streams.InflaterInputStream.Read(Byte[] b, Int32 off, Int32 len) in D:\Hoplun\Compression\NZipLib\Streams\InflaterInputStream.cs:line 271
問題從今天上午搞到現在,沒有一點進展,現主要有疑問:
1、cnblogs上的zendy提供的解決方案,是否不能壓縮DataSet?因為我使用Zendy提供的Demo,將其如我專案的一樣,將Remoting配置在IIS當中,也可以成功運行。所以有此懷疑。
2、如果要在Remoting中壓縮傳輸DataSet,應該如何做?注意項目很快就要上線使用,不可能再重寫一個擴展DataSet之類的啦!
3、我剛開始大於10000的數據就出錯的問題,是否真如我想的錯誤原因?
4、哪位兄弟姐妹有好的解決方案,能否告知一下。不勝感激!
分數不夠的話,另開貼奉上。