More in this section
Forums / Bugs & Issues / Error when Scheduling a task with cron syntax

Error when Scheduling a task with cron syntax

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    06 Jan 2017
    Link to this post

    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)

1 posts, 0 answered