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 ofRowCallbackHandler
which clears the session after processing a configurable number of rows. Subclasses should implementprocessRowInternal(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
Constructors Constructor Description SessionClearingRowCallbackHandler(org.hibernate.Session session, int flushAndClearEvery, int expectedTotal)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static void
flushAndClear(org.hibernate.Session session)
void
processRow(ResultSet rs)
protected abstract void
processRowInternal(ResultSet rs)
-
-
-
Method Detail
-
processRow
public final void processRow(ResultSet rs) throws SQLException
- Specified by:
processRow
in interfaceorg.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
-
-