|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.item.database.AbstractTransactionalResourceItemWriter
public abstract class AbstractTransactionalResourceItemWriter
Stores items in transactional resource and flushes aggressively in case of failure. This is useful for batch update writers which need to identify the failed item after failed flush.
BatchSqlUpdateItemWriter
,
HibernateAwareItemWriter
Constructor Summary | |
---|---|
AbstractTransactionalResourceItemWriter()
|
Method Summary | |
---|---|
void |
clear()
Delegate to subclass and unbind transactional resources, effectively clearing the item buffer. |
protected abstract void |
doClear()
Callback method of clear() . |
protected abstract void |
doFlush()
Callback method of flush() . |
protected abstract void |
doWrite(Object output)
Callback method of write(Object) . |
void |
flush()
Flushing delegated to subclass surrounded by binding and unbinding of transactional resources. |
protected Set |
getProcessed()
Accessor for the list of processed items in this transaction. |
protected abstract String |
getResourceKey()
|
void |
write(Object output)
Delegate to subclass to actually do the writing, but flushes aggressively if the item was previously part of a failed chunk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTransactionalResourceItemWriter()
Method Detail |
---|
public void flush() throws FlushFailedException
flush
in interface ItemWriter
FlushFailedException
- in case of an error. If this exception is
thrown the writer may be in an inconsistent state and manual intervention
might be required to reconcile the data with persistent output.ItemWriter.flush()
public void write(Object output) throws Exception
write
in interface ItemWriter
Exception
ItemWriter.write(Object)
public void clear() throws ClearFailedException
clear
in interface ItemWriter
ClearFailedException
- in case of an error. If this exception is
thrown the writer may be in an inconsistent state and manual intervention
might be required to reconcile the data with persistent output.protected abstract void doFlush() throws FlushFailedException
flush()
.
FlushFailedException
protected abstract void doClear() throws ClearFailedException
clear()
.
ClearFailedException
protected abstract void doWrite(Object output) throws Exception
write(Object)
.
Exception
protected abstract String getResourceKey()
RepeatContext
.protected Set getProcessed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |