I have activated the job in the Administration Tool
I have created the xsjob file:
{
"description": "My First Job",
"action": "xx.xx:test.xsjs::createEntry",
"schedules": [
{
"description": "Executes the job every 5 seconds.",
"xscron": "* * * * * * 0:59/10"
}
]
}
and have the following function in the xsjs:
function createEntry(){
var conn = $.db.getConnection();
var pstmt = conn.prepareStatement("upsert Schema.TableName (pk_id,col1) " + "values(7, 'apple') WITH PRIMARY KEY");
pstmt.executeUpdate();
pstmt.close();
conn.commit();
conn.close();
}
I can see the job created in _SYS_XS, and once activated in the XS administration tool, I can see it scheduled once (not every 10th second of every minute) and it never gets executed.
It might also be worth noting that when the job is scheduled, for instance on January 31 at 1:30 pm, the job is scheduled in the _SYS_XS job_log table at 6:30:10. Don't know if this is relevant.
Please let me know what it is that needs to be done to have the job execute successfully periodically.