/** * Execute the current batch of statements. If any exception occurs * during execution, a {@link org.apache.phoenix.exception.BatchUpdateException} * is thrown which includes the index of the statement within the * batch when the exception occurred. */ @Override public int[] executeBatch() throws SQLException { int i = 0; try { int[] returnCodes = new int [batch.size()]; for (i = 0; i < returnCodes.length; i++) { PhoenixPreparedStatement statement = batch.get(i); returnCodes[i] = statement.execute(true) ? Statement.SUCCESS_NO_INFO : statement.getUpdateCount(); } // Flush all changes in batch if auto flush is true flushIfNecessary(); // If we make it all the way through, clear the batch clearBatch(); return returnCodes; } catch (Throwable t) { throw new BatchUpdateExecution(t,i); } }
/** * Execute the current batch of statements. If any exception occurs * during execution, a {@link org.apache.phoenix.exception.BatchUpdateException} * is thrown which includes the index of the statement within the * batch when the exception occurred. */ @Override public int[] executeBatch() throws SQLException { int i = 0; try { int[] returnCodes = new int [batch.size()]; for (i = 0; i < returnCodes.length; i++) { PhoenixPreparedStatement statement = batch.get(i); returnCodes[i] = statement.execute(true) ? Statement.SUCCESS_NO_INFO : statement.getUpdateCount(); } // Flush all changes in batch if auto flush is true flushIfNecessary(); // If we make it all the way through, clear the batch clearBatch(); return returnCodes; } catch (Throwable t) { throw new BatchUpdateExecution(t,i); } }
/** * Execute the current batch of statements. If any exception occurs * during execution, a {@link org.apache.phoenix.exception.BatchUpdateException} * is thrown which includes the index of the statement within the * batch when the exception occurred. */ @Override public int[] executeBatch() throws SQLException { int i = 0; try { int[] returnCodes = new int [batch.size()]; for (i = 0; i < returnCodes.length; i++) { PhoenixPreparedStatement statement = batch.get(i); returnCodes[i] = statement.execute(true) ? Statement.SUCCESS_NO_INFO : statement.getUpdateCount(); } // Flush all changes in batch if auto flush is true flushIfNecessary(); // If we make it all the way through, clear the batch clearBatch(); return returnCodes; } catch (Throwable t) { throw new BatchUpdateExecution(t,i); } }