Program: 89722
Project: 89722
Buggy source:
/** 
 * @see JobDAO#rescheduleJob(long)
 */
public synchronized long rescheduleJob(long oldJobID){
  Connection dbconnection=DBConnect.getDBConnection();
  long newJobID=generateNextID();
  PreparedStatement statement=null;
  try {
    statement=dbconnection.prepareStatement("String_Node_Str");
    statement.setLong(1,oldJobID);
    ResultSet res=statement.executeQuery();
    if (!res.next()) {
      throw new UnknownID("String_Node_Str" + oldJobID + "String_Node_Str");
    }
    final JobStatus currentJobStatus=JobStatus.fromOrdinal(res.getInt(1));
    if (currentJobStatus != JobStatus.SUBMITTED && currentJobStatus != JobStatus.FAILED) {
      throw new IllegalState("String_Node_Str" + oldJobID + "String_Node_Str");
    }
    dbconnection.setAutoCommit(false);
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    statement.setLong(1,newJobID);
    statement.setLong(2,JobStatus.NEW.ordinal());
    long initialEdition=1;
    statement.setLong(3,initialEdition);
    statement.setLong(4,oldJobID);
    statement.executeUpdate();
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    statement.setLong(1,newJobID);
    statement.setLong(2,oldJobID);
    statement.executeUpdate();
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str");
    statement.setInt(1,JobStatus.RESUBMITTED.ordinal());
    statement.setLong(2,newJobID);
    statement.setLong(3,oldJobID);
    statement.executeUpdate();
    dbconnection.commit();
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(statement);
    DBUtils.rollbackIfNeeded(dbconnection,"String_Node_Str",oldJobID);
  }
  return newJobID;
}

Fixed version (ground truth):
/** 
 * @see JobDAO#rescheduleJob(long)
 */
@Override public synchronized long rescheduleJob(long oldJobID){
  Connection dbconnection=DBConnect.getDBConnection();
  long newJobID=generateNextID();
  PreparedStatement statement=null;
  try {
    statement=dbconnection.prepareStatement("String_Node_Str");
    statement.setLong(1,oldJobID);
    ResultSet res=statement.executeQuery();
    if (!res.next()) {
      throw new UnknownID("String_Node_Str" + oldJobID + "String_Node_Str");
    }
    final JobStatus currentJobStatus=JobStatus.fromOrdinal(res.getInt(1));
    if (currentJobStatus != JobStatus.SUBMITTED && currentJobStatus != JobStatus.FAILED) {
      throw new IllegalState("String_Node_Str" + oldJobID + "String_Node_Str");
    }
    dbconnection.setAutoCommit(false);
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    statement.setLong(1,newJobID);
    statement.setLong(2,JobStatus.NEW.ordinal());
    long initialEdition=1;
    statement.setLong(3,initialEdition);
    statement.setLong(4,oldJobID);
    statement.executeUpdate();
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    statement.setLong(1,newJobID);
    statement.setLong(2,oldJobID);
    statement.executeUpdate();
    statement=dbconnection.prepareStatement("String_Node_Str" + "String_Node_Str");
    statement.setInt(1,JobStatus.RESUBMITTED.ordinal());
    statement.setLong(2,newJobID);
    statement.setLong(3,oldJobID);
    statement.executeUpdate();
    dbconnection.commit();
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(statement);
    DBUtils.rollbackIfNeeded(dbconnection,"String_Node_Str",oldJobID);
  }
  return newJobID;
}