Class SessionClearingRowCallbackHandler

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

public abstract class SessionClearingRowCallbackHandler extends 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 Details

    • SessionClearingRowCallbackHandler

      public SessionClearingRowCallbackHandler(org.hibernate.Session session, int flushAndClearEvery, int expectedTotal)
  • Method Details

    • processRow

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

      protected static void flushAndClear(org.hibernate.Session session)
    • processRowInternal

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