-
- String com2 = "INSERT INTO ProteinData " + "(jobtime, JobID, ExecTime, Protein)" + " VALUES (" + job.getStartingDate() + ",'" + id
- + "'," + job.getExecutionTime() + ",'" + protein + "');";
- session.execute(com2);
-
- String allpredictions = "";
- List<FastaSequence> pr = job.getPredictions();
- for (FastaSequence pred : pr) {
- String predictionname = pred.getId();
- String prediction = pred.getSequence().replaceAll("\n", "");
- allpredictions += "'" + predictionname + "':'" + prediction + "',";
- }
- String final_prediction = "";
- if (!allpredictions.equals("")) {
- final_prediction = allpredictions.substring(0, allpredictions.length() - 1);
- }
-
- String check2 = "SELECT * FROM ProteinRow WHERE JobID = '" + job.getJobID() + "';";
- ResultSet results2 = session.execute(check2);
- if (results2.isExhausted()) {
- String com3 = "INSERT INTO ProteinRow " + "(Protein, JobID, Predictions)" + " VALUES ('" + protein + "','" + id + "',{"
- + final_prediction + "});";
- session.execute(com3);
+ if (execstatus.equals("OK")) {
+ String com2 = "INSERT INTO ProteinData " + "(jobtime, JobID, ExecTime, Protein)" + " VALUES (" + job.getStartingDate() + ",'" + id
+ + "'," + job.getExecutionTime() + ",'" + protein + "');";
+ session.execute(com2);
+
+ String allpredictions = "";
+ List<FastaSequence> pr = job.getPredictions();
+ for (FastaSequence pred : pr) {
+ String predictionname = pred.getId();
+ String prediction = pred.getSequence().replaceAll("\n", "");
+ allpredictions += "'" + predictionname + "':'" + prediction + "',";
+ }
+ String final_prediction = "";
+ if (!allpredictions.equals("")) {
+ final_prediction = allpredictions.substring(0, allpredictions.length() - 1);
+ }
+
+ String check2 = "SELECT * FROM ProteinRow WHERE JobID = '" + job.getJobID() + "';";
+ ResultSet results2 = session.execute(check2);
+ if (results2.isExhausted()) {
+ String com3 = "INSERT INTO ProteinRow " + "(Protein, JobID, Predictions)" + " VALUES ('" + protein + "','" + id + "',{"
+ + final_prediction + "});";
+ session.execute(com3);
+ }
+ njobsOk = 1;
+ } else {
+ String com5 = "INSERT INTO FailLog " + "(jobtime, JobID, ExecTime, ip, FinalStatus)" + " VALUES ("
+ + job.getStartingDate() + ",'" + id
+ + "'," + job.getExecutionTime() + ",'" + ip + "', '" + finalstatus + "');";
+ session.execute(com5);
+ System.out.println(com5);
+ if (finalstatus.equals("TIMEDOUT"))
+ njobsTimeOut = 1;
+ else if (finalstatus.equals("JPREDERROR"))
+ njobsError = 1;
+ else if (finalstatus.equals("STOPPED"))
+ njobsStop = 1;