Class 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 Detail

      • SessionClearingRowCallbackHandler

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

      • 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)