cancel
Showing results for 
Search instead for 
Did you mean: 

xsjob not executing in SCP Cloud

Hi Experts,

I have checked all the prerequisites of ROLES for XSJOB executions. These are already taken care of.

Though it's not working. Need help.

The codes are given below.

Package List ->

table.hdbdd ->

namespace sampleXSJS;
@Schema: 'TEST_XSJSJOB' 
context table {
   Entity TESTXSJSJOB {
       key ID: Integer;
       DESC: String(100);
   }; 
};


myJobExecutionFile.xsjs ->

function execute() {
    // try {
	var querySelect = "SELECT MAX( \"ID\" ) FROM \"TEST_XSJSJOB\".\"sampleXSJS::table.TESTXSJSJOB\"";


	var connection1 = $.db.getConnection();
	var statement1 = connection1.prepareStatement(querySelect);
	statement1.execute();
	var oResultSet1 = statement1.getResultSet();
	var run_no = 0;
	while (oResultSet1.next()) {
		run_no = oResultSet1.getInteger(1);
	}
	oResultSet1.close();
	statement1.close();
	connection1.close();
	run_no = run_no + 1;

	var query_insert = "INSERT INTO \"TEST_XSJSJOB\".\"sampleXSJS::table.TESTXSJSJOB\" VALUES(" + run_no + ",'" + "TEST " + run_no + "')";
	connection1 = $.db.getConnection();
	statement1 = connection1.prepareStatement(query_insert);
	statement1.execute();
	connection1.commit();
	connection1.close();
}
execute();


testXSJOB.xsjob ->

{
	"description": "TEST Job configuration",
	"action": "sampleXSJS:myJobExecutionFile.xsjs::execute",
	"schedules": [
		{
	   "description": "Will run every 5 seconds between 1-30 seconds of every minute", 
	   "xscron": "* * * * * * 1:30/5"
		}
	]
}


XS ADMIN Config ->


Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

Is the scheduler itself enabled (check on .../sap/hana/xs/admin/jobs -> Scheduler Enabled on the top right corner)?

0 Kudos

Thanks florian.pfeffer. I have enabled the Scheduler and its working now.

Answers (1)

Answers (1)

0 Kudos

My scheduler shows success but not executing procedure. If I execute procedure manfully it's working fine.What could be the issue.