Error when Scheduling a task with cron syntax

Posted by Community Admin on 04-Aug-2018 17:05

Error when Scheduling a task with cron syntax

All Replies

Posted by Community Admin on 06-Jan-2017 00:00

When scheduling a task, I get a SqlDateTime overflow error. Has anyone else encountered this (and resolved). Scheduling a task syntax/process I'm using:

/// <summary>
/// Schedule the next instant for the task
/// </summary>
public static void ScheduleTask()

var newTask = new MyCustomScheduledTask

ScheduleSpec = "* * * * * *", // The task will execute Each minute
ScheduleSpecType = "crontab",
Key = "MyUniqueGuidKey"
;

var schedulingManager = SchedulingManager.GetManager();
schedulingManager.AddTask(newTask);
schedulingManager.SaveChanges(); // EXCEPTION THROWN HERE

Exception details:

Insert of '1813439742-23624f52-e7e1-6533-860d-ff00001065ab' failed: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute(Nullable`1 commandTimeout) at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute(Nullable`1 commandTimeout) at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes, BatchControlInfo batchControl) INSERT INTO [sf_scheduled_tasks] ([application_name], [description], [enabled], [execute_time], [id], [instance_name], [is_recurring], [is_running], [ky], [language], [last_executed_time], [last_modified], [progress], [schedule_data], [status], [status_message], [subscr_lst_id], [task_data], [task_name], [title], [type_of_schedule], [voa_version]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (set event logging to all to see parameter values) System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute(Nullable`1 commandTimeout) at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute(Nullable`1 commandTimeout) at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes, BatchControlInfo batchControl)

This thread is closed