Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.jdbc
Class BatchingBatcher  view BatchingBatcher download BatchingBatcher.java

java.lang.Object
  extended byorg.hibernate.jdbc.AbstractBatcher
      extended byorg.hibernate.jdbc.BatchingBatcher
All Implemented Interfaces:
Batcher

public class BatchingBatcher
extends AbstractBatcher

An implementation of the Batcher interface that actually uses batching


Field Summary
private  int batchSize
           
private  int[] expectedRowCounts
           
 
Fields inherited from class org.hibernate.jdbc.AbstractBatcher
isTransactionTimeoutSet, log, SQL_LOG
 
Constructor Summary
BatchingBatcher(ConnectionManager connectionManager, org.hibernate.Interceptor interceptor)
           
 
Method Summary
 void addToBatch(int expectedRowCount)
          Add an insert / delete / update to the current batch (might be called multiple times for single prepareBatchStatement())
private  void checkRowCount(int rowCount, int expectedRowCount, int i)
           
private  void checkRowCounts(int[] rowCounts)
           
protected  void doExecuteBatch(java.sql.PreparedStatement ps)
           
 
Methods inherited from class org.hibernate.jdbc.AbstractBatcher
abortBatch, cancelLastQuery, closeConnection, closeQueryStatement, closeStatement, closeStatements, executeBatch, getFactory, getResultSet, getResultSet, getStatement, hasOpenResources, openConnection, openResourceStatsAsString, prepareBatchCallableStatement, prepareBatchStatement, prepareCallableQueryStatement, prepareCallableStatement, prepareQueryStatement, prepareSelectStatement, prepareStatement, prepareStatement, prepareStatement, setTransactionTimeout, unsetTransactionTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batchSize

private int batchSize

expectedRowCounts

private int[] expectedRowCounts
Constructor Detail

BatchingBatcher

public BatchingBatcher(ConnectionManager connectionManager,
                       org.hibernate.Interceptor interceptor)
Method Detail

addToBatch

public void addToBatch(int expectedRowCount)
                throws java.sql.SQLException,
                       org.hibernate.HibernateException
Description copied from interface: Batcher
Add an insert / delete / update to the current batch (might be called multiple times for single prepareBatchStatement())


doExecuteBatch

protected void doExecuteBatch(java.sql.PreparedStatement ps)
                       throws java.sql.SQLException,
                              org.hibernate.HibernateException
Specified by:
doExecuteBatch in class AbstractBatcher

checkRowCounts

private void checkRowCounts(int[] rowCounts)

checkRowCount

private void checkRowCount(int rowCount,
                           int expectedRowCount,
                           int i)