1

SingleCall として構成されているリモートでホストされているオブジェクトがあります。RemotingConfiguration.Configure(remotingConfigPath, false) として構成されている古いスタイルの .Net リモーティング オブジェクトです。そのオブジェクトは問題なく DataSet の DateTime フィールドを受け取り、それを [AutoComplete] としてマークされている ServicedComponent の (COM+) メソッドに渡します。呼び出しの時点まで、フィールドは問題ありません。[AutoComplete] メソッドが DateTime を受け取るとすぐに、1 時間シフトされます。.Net フレームワークによって確実に移行されます。間にユーザーコードはありません。シフトは、夏時間の変更日である特定の日付で発生すると思います。

AppDomain を通過するときに発生する日付のシリアル化を伴うものでなければなりません。Like Serviced コンポーネントは独自のタイム ゾーンを使用し、受信した日付をそのゾーンに変換します。しかし奇妙なことに、.Net リモート処理用に構成せずに ServicedComponent を直接呼び出すと、日付の変更は発生しません。ServicedComponent は処理中です。クライアントとサーバーは同じマシンにあり、TimeZone GMT+2 と地域設定がトルコ/トルコに設定され、クライアント側の CurrentUICulture と CurrentCulture の両方で .net カルチャが tr-TR に設定されています。問題の解決にご協力ください よろしくお願いします

  public class ProfileSystem : MarshalByRefObject
 {
     public void SaveProfile(Guid sessionId, HotelAToZ.SystemTypes.Profile2.ProfileData data) 
    {
         //This is in remoting object DateTime is received  normally here
         //Header is a property which just returns the first row of DataSet. Actually only one row in dataset
        //throw new ApplicationException(data.Header.BirthDay.ToString());
        new Reservation.ReservationSC().SaveProfile(sessionId, data);
    }
}

 [Transaction(TransactionOption.Required)]
 public class ReservationSC : ServicedComponent
 {
 //This is in ServicedComponent
  [AutoComplete]
    public void SaveProfile(Guid sessionId, HotelAToZ.SystemTypes.Profile2.ProfileData data) 
    {
         //data.Header.BirthDay is shifted here
         //throw new ApplicationException(data.Header.BirthDay.ToString());
        new HotelAToZ.DataAccess.Profile2.ProfileAccess().SaveProfile(sessionId, data);
    }
 }
4

1 に答える 1

0

この問題は、同様の問題で説明されているバグが原因でした: http://social.msdn.microsoft.com/Forums/en-US/19706927-ab22-44ee-ad89-9d005f7ea29f/binary-serialization-of-datasets-bug -with-datetimecolumns?forum=adodotnetdataproviders

そのため、DataColumn の DateTimeMode プロパティを DataSetDateTime.Unspecified に設定すると解決しました。

于 2014-08-26T23:14:29.480 に答える