IN PROGRESS - issue BATCH-7: Remove transaction synchronization and state management from input/output sources (formerly buffering)
http://jira.springframework.org/browse/BATCH-7 Check for isMarkSupported().
This commit is contained in:
@@ -99,7 +99,7 @@ public class SimpleStreamManager implements StreamManager {
|
||||
Properties properties = provider.getStreamContext().getProperties();
|
||||
if (properties != null) {
|
||||
String prefix = ""; // ClassUtils.getShortClassName(provider.getClass())
|
||||
// + ".";
|
||||
// + ".";
|
||||
for (Iterator propiter = properties.keySet().iterator(); propiter.hasNext();) {
|
||||
String key = (String) propiter.next();
|
||||
String value = properties.getProperty(key);
|
||||
@@ -155,14 +155,18 @@ public class SimpleStreamManager implements StreamManager {
|
||||
if (status == TransactionSynchronization.STATUS_COMMITTED) {
|
||||
iterate(key, new Callback() {
|
||||
public void execute(ItemStream stream) {
|
||||
stream.mark(stream.getStreamContext());
|
||||
if (stream.isMarkSupported()) {
|
||||
stream.mark(stream.getStreamContext());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (status == TransactionSynchronization.STATUS_ROLLED_BACK) {
|
||||
iterate(key, new Callback() {
|
||||
public void execute(ItemStream stream) {
|
||||
stream.reset(stream.getStreamContext());
|
||||
if (stream.isMarkSupported()) {
|
||||
stream.reset(stream.getStreamContext());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -208,5 +212,4 @@ public class SimpleStreamManager implements StreamManager {
|
||||
void execute(ItemStream stream);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user