Class BatchedPstmtHolder

java.lang.Object
io.ebeaninternal.server.persist.BatchedPstmtHolder

public final class BatchedPstmtHolder extends Object
Used to hold BatchedPstmt objects for batch based execution.

The BatchControl 'front ends' the batching by queuing the persist requests and ordering them according to depth and type. This object should only batch statements of a single 'depth' at any given time.

  • Method Details

    • batchedPstmt

      public BatchedPstmt batchedPstmt(String stmtKey)
      Return the BatchedPstmt that holds the batched statement.
    • addStmt

      public void addStmt(BatchedPstmt bs, BatchPostExecute postExecute)
      Add a new PreparedStatement wrapped in the BatchStatement object.
    • isEmpty

      public boolean isEmpty()
      Return true if the batch has no statements to execute.
    • execute

      public int[] execute(String key, boolean getGeneratedKeys) throws SQLException
      Execute one of the batched statements returning the row counts.
      Throws:
      SQLException
    • flush

      public void flush(boolean getGeneratedKeys, boolean reset) throws BatchedSqlException
      Execute all batched PreparedStatements.
      Throws:
      BatchedSqlException
    • clear

      public void clear()