OPEN - issue BATCH-364: StepScope responsibilities can be assumed by Step (not ApplicationContext)
http://jira.springframework.org/browse/BATCH-364 Extend columns in attrs table -to avoid crashes resulting in optimistic lock failure.
This commit is contained in:
@@ -45,6 +45,6 @@ public interface Chunker {
|
||||
*
|
||||
* @param stepExecution
|
||||
*/
|
||||
public void flush(StepExecution stepExecution);
|
||||
public void flush(Entity stepExecution);
|
||||
|
||||
}
|
||||
|
||||
@@ -75,6 +75,17 @@ public class Entity implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected void decrementVersion() {
|
||||
if (version == null || version.intValue()==0) {
|
||||
version = new Integer(0);
|
||||
} else {
|
||||
version = new Integer(version.intValue() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
public String toString() {
|
||||
return ClassUtils.getShortName(getClass()) + ": id=" + getId();
|
||||
@@ -121,4 +132,5 @@ public class Entity implements Serializable {
|
||||
}
|
||||
return 39 + 87 * id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -357,6 +357,7 @@ public class StepExecution extends Entity {
|
||||
*/
|
||||
public synchronized void rollback() {
|
||||
rollbackCount++;
|
||||
decrementVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user