com.atlassian.confluence.upgrade.upgradetask
Class SessionClearingRowCallbackHandler

java.lang.Object
  extended by com.atlassian.confluence.upgrade.upgradetask.SessionClearingRowCallbackHandler
All Implemented Interfaces:
org.springframework.jdbc.core.RowCallbackHandler

public abstract class SessionClearingRowCallbackHandler
extends java.lang.Object
implements org.springframework.jdbc.core.RowCallbackHandler

Implementation of RowCallbackHandler which clears the session after processing a configurable number of rows. Subclasses should implement processRowInternal(ResultSet) to do their specific processing. If you need a custom flushing and clearing strategy (not after a certain number of rows), you can write your own RowCallbackHandler and use flushAndClear(Session) to do the flushing.


Constructor Summary
SessionClearingRowCallbackHandler(net.sf.hibernate.Session session, int flushAndClearEvery, int expectedTotal)
           
 
Method Summary
protected static void flushAndClear(net.sf.hibernate.Session session)
           
 void processRow(java.sql.ResultSet rs)
           
protected abstract  void processRowInternal(java.sql.ResultSet rs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionClearingRowCallbackHandler

public SessionClearingRowCallbackHandler(net.sf.hibernate.Session session,
                                         int flushAndClearEvery,
                                         int expectedTotal)
Method Detail

processRow

public final void processRow(java.sql.ResultSet rs)
                      throws java.sql.SQLException
Specified by:
processRow in interface org.springframework.jdbc.core.RowCallbackHandler
Throws:
java.sql.SQLException

flushAndClear

protected static void flushAndClear(net.sf.hibernate.Session session)

processRowInternal

protected abstract void processRowInternal(java.sql.ResultSet rs)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2003-2014 Atlassian. All Rights Reserved.