2012-06-20 19 views
2

我正在開發使用Quartz .NET的簡單調度器。我想Quartz堅持數據庫中的所有作業和觸發器,所以我設置AdoJobStore和「正常」作業它工作正常。使用Quartz .NET和AdoJobStore調度泛型IJob <>

現在,我從數據庫通用作業反序列化的問題。我有類:

class DefaultJob<TEventType, TArgsType> : IJob{ 
public void Execute(IJobExecutionContext context) 
{ 
     //do sth 
} 
} 

隨着RamJobStore和DefaultJob <,> everyting是確定的 - 安排和運行工作。

隨着AdoJobStore和DefaultJob <,>我可以安排,石英保存到數據庫(我可以通過Management Studio中看到它),但是,當它試圖從數據庫恢復,我越來越:

A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll 
A first chance exception of type 'Quartz.JobPersistenceException' occurred in Quartz.dll 
A first chance exception of type 'Quartz.JobPersistenceException' occurred in Quartz.dll 

我放棄了JobFactory,方法NewJob根本沒有被調用。在它之前發生了一些錯誤。

有人可以幫忙嗎?

回答

2

我在這裏從轉發馬爾科Lahma官方石英郵件列表上回答:

Quartz.NET不支持泛型類型的工作,我覺得這 不應該,因爲它可以表示爲好很容易通過基類 具有通用定義,並且您的每個作業只是繼承此類,因此定義了泛型類型。