Class AbstractHibernateBatchProcessor<T extends org.hibernate.SharedSessionContract>
java.lang.Object
com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor<T>
com.atlassian.crowd.util.persistence.hibernate.batch.hibernate5.AbstractHibernateBatchProcessor<T>
- All Implemented Interfaces:
BatchProcessor<T>
- Direct Known Subclasses:
Hibernate5BatchProcessor
,Hibernate5StatelessSessionBatchProcessor
public abstract class AbstractHibernateBatchProcessor<T extends org.hibernate.SharedSessionContract>
extends AbstractBatchProcessor<T>
-
Field Summary
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor
batchSize, log
-
Constructor Summary
ConstructorDescriptionAbstractHibernateBatchProcessor
(org.hibernate.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called after successfully processing each batch.protected void
Called when processing the collection has completed successfully.protected void
Called after successully processing an item individually.protected void
Called before processing each batch.protected void
Called before the collection is processed into a batch.protected void
Called before processing an individual item.protected abstract void
protected abstract void
protected void
Method is protected to allow subclasses to override the transaction management if they need to (e.g.protected abstract void
protected abstract T
protected void
Called after processing each batch where an exception was encountered.protected void
Called after processing an individual item where an exception was encountered.protected void
Method is protected to allow subclasses to override the transaction management if they need to (e.g.protected void
Method is protected to allow subclasses to override the transaction management if they need to (e.g.Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor
auditOperations, execute, execute, getSession, setBatchSize
-
Field Details
-
sessionFactory
protected final org.hibernate.SessionFactory sessionFactory
-
-
Constructor Details
-
AbstractHibernateBatchProcessor
public AbstractHibernateBatchProcessor(org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
afterProcessBatch
protected void afterProcessBatch()Description copied from class:AbstractBatchProcessor
Called after successfully processing each batch.- Specified by:
afterProcessBatch
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
afterProcessCollection
protected void afterProcessCollection()Description copied from class:AbstractBatchProcessor
Called when processing the collection has completed successfully.- Specified by:
afterProcessCollection
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
afterProcessIndividual
protected void afterProcessIndividual()Description copied from class:AbstractBatchProcessor
Called after successully processing an item individually.- Specified by:
afterProcessIndividual
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
beforeProcessBatch
protected void beforeProcessBatch()Description copied from class:AbstractBatchProcessor
Called before processing each batch. Can be used to start session or transaction that will cover this particular batch.- Specified by:
beforeProcessBatch
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
beforeProcessCollection
protected void beforeProcessCollection()Description copied from class:AbstractBatchProcessor
Called before the collection is processed into a batch. Can be used to start session or transaction that will cover the execution of the entire collection which could involve multiple batches.- Specified by:
beforeProcessCollection
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
beforeProcessIndividual
protected void beforeProcessIndividual()Description copied from class:AbstractBatchProcessor
Called before processing an individual item. This method will be called if the batch failed and the processor falls back to processing each item seperately.- Specified by:
beforeProcessIndividual
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
rollbackProcessBatch
protected void rollbackProcessBatch()Description copied from class:AbstractBatchProcessor
Called after processing each batch where an exception was encountered.- Specified by:
rollbackProcessBatch
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
rollbackProcessIndividual
protected void rollbackProcessIndividual()Description copied from class:AbstractBatchProcessor
Called after processing an individual item where an exception was encountered.- Specified by:
rollbackProcessIndividual
in classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
commitTransaction
protected void commitTransaction()Method is protected to allow subclasses to override the transaction management if they need to (e.g. use a transaction manager instead of manipulating the Hibernate session directly) -
rollbackTransaction
protected void rollbackTransaction()Method is protected to allow subclasses to override the transaction management if they need to (e.g. use a transaction manager instead of manipulating the Hibernate session directly) -
clearSession
protected abstract void clearSession() -
closeSession
protected abstract void closeSession() -
flushSession
protected abstract void flushSession() -
openSession
-
startTransaction
protected void startTransaction()Method is protected to allow subclasses to override the transaction management if they need to (e.g. use a transaction manager instead of manipulating the Hibernate session directly)
-