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.hibernate6.AbstractHibernateBatchProcessor<T>
- All Implemented Interfaces:
BatchProcessor<T>
- Direct Known Subclasses:
Hibernate6BatchProcessor,Hibernate6StatelessSessionBatchProcessor
public abstract class AbstractHibernateBatchProcessor<T extends org.hibernate.SharedSessionContract>
extends AbstractBatchProcessor<T>
-
Field Summary
FieldsFields inherited from class com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor
batchSize, log -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHibernateBatchProcessor(org.hibernate.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled after successfully processing each batch.protected voidCalled when processing the collection has completed successfully.protected voidCalled after successully processing an item individually.protected voidCalled before processing each batch.protected voidCalled before the collection is processed into a batch.protected voidCalled before processing an individual item.protected abstract voidprotected abstract voidprotected voidMethod 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)protected abstract voidprotected abstract Tprotected voidCalled after processing each batch where an exception was encountered.protected voidCalled after processing an individual item where an exception was encountered.protected voidMethod 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)protected voidMethod 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)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:AbstractBatchProcessorCalled after successfully processing each batch.- Specified by:
afterProcessBatchin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
afterProcessCollection
protected void afterProcessCollection()Description copied from class:AbstractBatchProcessorCalled when processing the collection has completed successfully.- Specified by:
afterProcessCollectionin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
afterProcessIndividual
protected void afterProcessIndividual()Description copied from class:AbstractBatchProcessorCalled after successully processing an item individually.- Specified by:
afterProcessIndividualin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
beforeProcessBatch
protected void beforeProcessBatch()Description copied from class:AbstractBatchProcessorCalled before processing each batch. Can be used to start session or transaction that will cover this particular batch.- Specified by:
beforeProcessBatchin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
beforeProcessCollection
protected void beforeProcessCollection()Description copied from class:AbstractBatchProcessorCalled 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:
beforeProcessCollectionin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
beforeProcessIndividual
protected void beforeProcessIndividual()Description copied from class:AbstractBatchProcessorCalled 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:
beforeProcessIndividualin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
rollbackProcessBatch
protected void rollbackProcessBatch()Description copied from class:AbstractBatchProcessorCalled after processing each batch where an exception was encountered.- Specified by:
rollbackProcessBatchin classAbstractBatchProcessor<T extends org.hibernate.SharedSessionContract>
-
rollbackProcessIndividual
protected void rollbackProcessIndividual()Description copied from class:AbstractBatchProcessorCalled after processing an individual item where an exception was encountered.- Specified by:
rollbackProcessIndividualin 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)
-