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:
dsyer
2008-02-15 14:40:33 +00:00
parent 0fc3ec4cfc
commit 7096c8c024
19 changed files with 65 additions and 46 deletions

View File

@@ -45,6 +45,6 @@ public interface Chunker {
*
* @param stepExecution
*/
public void flush(StepExecution stepExecution);
public void flush(Entity stepExecution);
}

View File

@@ -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();
}
}

View File

@@ -357,6 +357,7 @@ public class StepExecution extends Entity {
*/
public synchronized void rollback() {
rollbackCount++;
decrementVersion();
}
/**