Results 1 to 2 of 2

Thread: Execution context and Job Repository

  1. #1

    Default Execution context and Job Repository

    Hi,

    I have a question about the Execution context that you can put stuff into if you want subsequent steps in your job to access it, like so...


    Code:
    ExecutionContext jobExecutionContext = getStepExecution()getExecutionContext(); // get context obj from SB
    
    jobExecutionContext.put("agentsVO", agentVOs); // put my obj in context
    Is it true that SB will persist my Value object (agentsVO in this example) to the job repository in the database? And if so will it be a performance hit if the Value object is too large?

    Thanks in advance for any help.

  2. #2

    Default

    ExecutionContext persists your agentVOs into a ConcurrentHashMap. Doesn't look like it goes into the datasource.

    public void put(String key, Object value) {
    if (value != null) {
    Assert.isInstanceOf(Serializable.class, value, "Value: [ " + value + "must be serializable.");
    Object result = map.put(key, value);
    dirty = result==null || result!=null && !result.equals(value);
    }
    else {
    Object result = map.remove(key);
    dirty = result!=null;
    }
    }

    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •