2007年6月1日 星期五

Event "EntryDelayCreated" on interface type "TimeSheetNotification.Services.Contracts.IEntryDelayService" for instance id "8f3ff2ac-ef5a-4e0c-a6e9-7f1b6ce33df1" cannot be delivered.

在開發WF ,且使用 SqlPersistenceService 時,一直出現這個錯誤
Event "EntryDelayCreated" on interface type "TimeSheetNotification.Services.Contracts.IEntryDelayService" for instance id "8f3ff2ac-ef5a-4e0c-a6e9-7f1b6ce33df1" cannot be delivered.

而其InnerException 的 message 卻為
Workflow with id "90541a57-f759-4baa-84c5-8e613f59f46d" not found in state persistence store.

怎麼看也看不懂!

使用profiler追蹤了 sql statements 後,發現有一段如下

declare @p10 int
set @p10=0
declare @p11 uniqueidentifier
set @p11=NULL
exec InsertInstanceState @uidInstanceID='8F3FF2AC-EF5A-4E0C-A6E9-7F1B6CE33DF1',@state=0x,@status=3,@unlocked=1,@blocked=0,@info=N'Type
''TimeSheetNotification.Entities.ProjResource'' in Assembly ''TimeSheetNotification.Entities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'' is not marked as
serializable. Type ''TimeSheetNotification.Entities.ProjResource'' in Assembly ''TimeSheetNotification.Entities, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'' is not marked as serializable.',@ownedUntil=''9999-12-31 23:59:59:997'',@ownerID=default,@nextTimer=''9999-12-31 23:59:59:997'',@result=@p10
output,@currentOwnerID=@p11 output
select @p10, @p11

原來,我在workflow 中,有使用了ProjResource的business entity,但卻未給定 Serializable 的屬性,以致於當workflowruntime 在序列化我的workflow 時失敗了,因此,無法再找回來。

話又說回來,為何當初序列化失敗時,不是直接出現錯誤,而是將錯誤訊息寫到資料庫呢?

沒有留言:

Share with Facebook