batch.add(s);
}
transaction.commit();
result.addAll(batch);
} catch (Exception ex) {
transaction.rollback();
if(untilCapacityIsReached && ex instanceof ChannelException &&
("The channel has reached it's capacity. "
+ "This might be the result of a sink on the channel having too "
+ "low of batch size, a downstream system running slower than "
+ "normal, or that the channel capacity is just too low. "