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 Summary
ConstructorsConstructorDescriptionSessionClearingRowCallbackHandler
(org.hibernate.Session session, int flushAndClearEvery, int expectedTotal) -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
flushAndClear
(org.hibernate.Session session) final void
processRow
(ResultSet rs) protected abstract void
-
Constructor Details
-
SessionClearingRowCallbackHandler
public SessionClearingRowCallbackHandler(org.hibernate.Session session, int flushAndClearEvery, int expectedTotal)
-
-
Method Details
-
processRow
- Specified by:
processRow
in interfaceorg.springframework.jdbc.core.RowCallbackHandler
- Throws:
SQLException
-
flushAndClear
protected static void flushAndClear(org.hibernate.Session session) -
processRowInternal
- Throws:
SQLException
-