on 02-10-2014 7:52 AM
Hi,
I'm working on job scheduling with HANA SPS-7 version. I watched the videos uploaded on the SAP HANA Academy and also followed the steps mentioned in the HANA Developer guide. I'm trying to schedule jobs dynamically by calling xsjs which has code for adding job schedules. For better understanding the code snippet of the called xsjs looks like:
var schedule = new $.jobs.Job({
uri : "scheduleJob.xsjob", sqlcc : "schedule.xssqlcc"
});
var jobId = schedule.schedules.add({
"description" : "add job from code",
"xscron" : "* * * * * * 59",
"parameter" : {
"jobId" : "100"
}
});
When I call this xsjs, job gets added in the "_SYS_XS"."JOB_SCHEDULES" table. However, The job doesn't get scheduled and entry is not coming to the "_SYS_XS"."JOB_LOG" table.
Interestingly, when I go to the XS Admin tool and just click on save button The same job which I created dynamically gets scheduled and i can see job logs.
Could anyone please guide what I should do for achieving a fully dynamic scheduling of jobs through xsjs call (without the need of going to the XS Admin tool) ?
Regards,
Thanisha.
Thanisha,
Did you make any progress on this?
I am trying the same thing. I think that the Job needs to be activated through the Admin GUI once and then you can change the schedule.....
Kind regards,
Fred
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thanisha,
I've faced with the similar issue and my findings:
Jobs are not scheduled in case of updating the status in the _SYS_XS.JOBS table directly (no new records added to "_SYS_XS"."JOB_LOG" table).
So, seems the only way to trigger job execution is to activate it via admin console explicitly.
In additional, I found one more strange behaviour...in some conditions job are not triggered even if it activated via admin console and there is a corresponding record inside "_SYS_XS"."JOB_LOG" table.
So, just nothing happens and there is no any new records created in "_SYS_XS"."JOB_LOG" table after PLANNED_TIME is passed...
The HANA version we are working on is fullversion: 1.00.72.00 Build 0388670-1510
Regards,
Alexander
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the source code I use in my demo. It works fine in my system.
function performSchedule(){
var body = '';
var myjob = new $.jobs.Job({uri:"/playground/sp7/jobs/demoXSJS.xsjob",
sqlcc:"/playground/sp7/services/jobs.xssqlcc"});
// add
var id = myjob.schedules.add({
description: "Added at runtime, run every 1 second",
xscron: "* * * * * * 0:59/01"
});
body = 'Job ' + id + ' has been scheduled';
$.response.contentType = "text/html";
$.response.setBody(body);
$.response.status = $.net.http.OK;
}
Are you xsjob and xssqlcc really in the repository root?
Perhaps there is something wrong with the parameter import? Do you see anything in the xsengine or index server trace? You might have to enter a support ticket for this as I don't see anything obviously wrong with your code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Thanks for your reply. I tried and checked the things you
mentioned about.
However, nothing seems to work for me and I’m in the same
scenario as before. And just for information if that could help, I am working
with the SPS 7 version: 1.00.70.00.386119.
I should probably open a ticket. As I’m unaware of the exact
component, etc. against which I should open a ticket, it would be great if you
could please guide me with the component name and the concerned person (if
possible).
Regards,
Thanisha.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.