public long[] executeLargeBatch() throws SQLException { checkOpen(); try { return executeBatchInternal(); } finally { // If we failed to send this batch, that's a problem for the user to handle, not us. // Make sure we always clear the statements we collected to submit in one RPC. clearBatch(); } }
public long[] executeLargeBatch() throws SQLException { checkOpen(); try { return executeBatchInternal(); } finally { // If we failed to send this batch, that's a problem for the user to handle, not us. // Make sure we always clear the statements we collected to submit in one RPC. clearBatch(); } }
@Test public void testUpdateCounts() throws SQLException { long[] longValues = new long[] {-1, -3, 1, 5, ((long) Integer.MAX_VALUE) + 1}; int[] intValues = new int[] {-1, -3, 1, 5, Integer.MAX_VALUE}; when(statement.executeBatch()).thenCallRealMethod(); when(statement.executeLargeBatch()).thenCallRealMethod(); when(statement.executeBatchInternal()).thenReturn(longValues); assertArrayEquals(intValues, statement.executeBatch()); assertArrayEquals(longValues, statement.executeLargeBatch()); }
@Test public void testUpdateCounts() throws SQLException { long[] longValues = new long[] {-1, -3, 1, 5, ((long) Integer.MAX_VALUE) + 1}; int[] intValues = new int[] {-1, -3, 1, 5, Integer.MAX_VALUE}; when(statement.executeBatch()).thenCallRealMethod(); when(statement.executeLargeBatch()).thenCallRealMethod(); when(statement.executeBatchInternal()).thenReturn(longValues); assertArrayEquals(intValues, statement.executeBatch()); assertArrayEquals(longValues, statement.executeLargeBatch()); }