Announcement Announcement Module
Collapse
No announcement yet.
Execution context and Job Repository Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment

    Working...
    X