com.atlassian.crowd.util.persistence.hibernate.batch.hibernate3
Class Hibernate3BatchProcessor

java.lang.Object
  extended by com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor
      extended by com.atlassian.crowd.util.persistence.hibernate.batch.hibernate3.Hibernate3BatchProcessor
All Implemented Interfaces:
BatchProcessor

public class Hibernate3BatchProcessor
extends AbstractBatchProcessor

The hibernate 3 implementation of the batch processor runs each collection in a new session, and each batch in a seperate transaction.


Constructor Summary
Hibernate3BatchProcessor(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
protected  void afterProcessBatch()
          Called after successfully processing each batch.
protected  void afterProcessCollection()
          Called when processing the collection has completed successfully.
protected  void afterProcessIndividual()
          Called after successully processing an item individually.
protected  void beforeProcessBatch()
          Called before processing each batch.
protected  void beforeProcessCollection()
          Called before the collection is processed into a batch.
protected  void beforeProcessIndividual()
          Called before processing an individual item.
protected  void commitTransaction()
          Method is protected to allow subclasses to override the transaction management if they need to (e.g.
static org.hibernate.Session getSession()
           
protected  void rollbackProcessBatch()
          Called after processing each batch where an exception was encountered.
protected  void rollbackProcessIndividual()
          Called after processing an individual item where an exception was encountered.
protected  void rollbackTransaction()
          Method is protected to allow subclasses to override the transaction management if they need to (e.g.
protected static void setSession(org.hibernate.Session session)
          Sets the session in the internal currentSessionHolder.
protected  void startTransaction()
          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
execute, setBatchSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hibernate3BatchProcessor

public Hibernate3BatchProcessor(org.hibernate.SessionFactory sessionFactory)
Method Detail

getSession

public static org.hibernate.Session getSession()

setSession

protected static void setSession(org.hibernate.Session session)
Sets the session in the internal currentSessionHolder. This method is provided for subclasses.

Parameters:
session - the session

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 class AbstractBatchProcessor

afterProcessCollection

protected void afterProcessCollection()
Description copied from class: AbstractBatchProcessor
Called when processing the collection has completed successfully.

Specified by:
afterProcessCollection in class AbstractBatchProcessor

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 class AbstractBatchProcessor

afterProcessBatch

protected void afterProcessBatch()
Description copied from class: AbstractBatchProcessor
Called after successfully processing each batch.

Specified by:
afterProcessBatch in class AbstractBatchProcessor

rollbackProcessBatch

protected void rollbackProcessBatch()
Description copied from class: AbstractBatchProcessor
Called after processing each batch where an exception was encountered.

Specified by:
rollbackProcessBatch in class AbstractBatchProcessor

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 class AbstractBatchProcessor

afterProcessIndividual

protected void afterProcessIndividual()
Description copied from class: AbstractBatchProcessor
Called after successully processing an item individually.

Specified by:
afterProcessIndividual in class AbstractBatchProcessor

rollbackProcessIndividual

protected void rollbackProcessIndividual()
Description copied from class: AbstractBatchProcessor
Called after processing an individual item where an exception was encountered.

Specified by:
rollbackProcessIndividual in class AbstractBatchProcessor

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)


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)



Copyright © 2013 Atlassian. All Rights Reserved.