Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecutionContextDao API Clarification [BATCH-1858] #1731

Open
spring-issuemaster opened this issue May 14, 2012 · 1 comment
Open

ExecutionContextDao API Clarification [BATCH-1858] #1731

spring-issuemaster opened this issue May 14, 2012 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 14, 2012

Robert Fischer opened BATCH-1858 and commented

What should the behavior be here?

assertTrue(jobExecution.getExecutionContext() != null);
mapExecutionContextDao.updateExecutionContext(jobExecution);
jobExecution.setExecutionContext(null);
mapExecutionContextDao.updateExecutionContext(jobExecution);
assert???(mapExecutionContextDao.getExecutionContext(jobExecution) == null);

As of now, it will return non-null.

I'm aware that jobExecutions should never have a null execution context, and hence the trivial priority on this. We should probably be intentional about what we want to do here. I'd be inclined to either throw an exception if we are told to update the execution context with a null execution context on the assumption that something has gone horribly awry, or to allow it to be updated to null on the assumption that the user should know what they're doing.


Affects: 2.2.0

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jul 4, 2012

Dave Syer commented

Agree that it should never be null. We can throw an exception in the setter, but it does seem trivial, and there are plenty of other places where null checks are not done to reduce the volume of code where the probability of it happening is low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.