Program: 64682
Project: 64682
Buggy source:
/** 
 * Execute the statement.
 */
public Integer executeDirectNoSelect(Statement statement,DatabaseCall call,AbstractSession session) throws DatabaseException {
  int rowCount=0;
  try {
    if (call != null) {
      session.startOperationProfile(SessionProfiler.StatementExecute,call.getQuery(),SessionProfiler.ALL);
    }
 else {
      session.startOperationProfile(SessionProfiler.StatementExecute,null,SessionProfiler.ALL);
    }
    if ((call != null) && call.isDynamicCall(session)) {
      rowCount=statement.executeUpdate(call.getSQLString());
    }
 else {
      rowCount=((PreparedStatement)statement).executeUpdate();
    }
    if (call != null && call.getQuery().isUserDefined() && call.isStoredProcedureCall() && call.isNothingReturned() && rowCount != statement.getUpdateCount()) {
      throw new IllegalStateException(ExceptionLocalization.buildMessage("String_Node_Str"));
    }
    if ((!getPlatform().supportsAutoCommit()) && (!this.isInTransaction)) {
      getPlatform().autoCommit(this);
    }
  }
 catch (  SQLException exception) {
    if (!getPlatform().shouldIgnoreException(exception)) {
      DatabaseException commException=processExceptionForCommError(session,exception,call);
      if (commException != null)       throw commException;
      throw DatabaseException.sqlException(exception,this,session,false);
    }
  }
 finally {
    if (call != null) {
      session.endOperationProfile(SessionProfiler.StatementExecute,call.getQuery(),SessionProfiler.ALL);
    }
 else {
      session.endOperationProfile(SessionProfiler.StatementExecute,null,SessionProfiler.ALL);
    }
  }
  return Integer.valueOf(rowCount);
}

Fixed version (ground truth):
/** 
 * Execute the statement.
 */
public Integer executeDirectNoSelect(Statement statement,DatabaseCall call,AbstractSession session) throws DatabaseException {
  int rowCount=0;
  try {
    if (call != null) {
      session.startOperationProfile(SessionProfiler.StatementExecute,call.getQuery(),SessionProfiler.ALL);
    }
 else {
      session.startOperationProfile(SessionProfiler.StatementExecute,null,SessionProfiler.ALL);
    }
    if ((call != null) && call.isDynamicCall(session)) {
      rowCount=statement.executeUpdate(call.getSQLString());
    }
 else {
      rowCount=((PreparedStatement)statement).executeUpdate();
    }
    if (call != null && call.getQuery().isJPAUserDefined() && call.isStoredProcedureCall() && call.isNothingReturned() && rowCount != statement.getUpdateCount()) {
      throw new IllegalStateException(ExceptionLocalization.buildMessage("String_Node_Str"));
    }
    if ((!getPlatform().supportsAutoCommit()) && (!this.isInTransaction)) {
      getPlatform().autoCommit(this);
    }
  }
 catch (  SQLException exception) {
    if (!getPlatform().shouldIgnoreException(exception)) {
      DatabaseException commException=processExceptionForCommError(session,exception,call);
      if (commException != null)       throw commException;
      throw DatabaseException.sqlException(exception,this,session,false);
    }
  }
 finally {
    if (call != null) {
      session.endOperationProfile(SessionProfiler.StatementExecute,call.getQuery(),SessionProfiler.ALL);
    }
 else {
      session.endOperationProfile(SessionProfiler.StatementExecute,null,SessionProfiler.ALL);
    }
  }
  return Integer.valueOf(rowCount);
}