Source:
public ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest) { checkParameters(); boolean supportsGeneratedKeys = session.isSupportsGeneratedKeys(); boolean readGeneratedKeys = supportsGeneratedKeys && !Boolean.FALSE.equals(generatedKeysRequest); int objectId = readGeneratedKeys ? session.getNextId() : 0; synchronized (session) { int updateCount = 0; ResultRemote generatedKeys = null; boolean autoCommit = false; for (int i = 0, count = 0; i < transferList.size(); i++) { prepareIfRequired(); Transfer transfer = transferList.get(i); try { session.traceOperation("COMMAND_EXECUTE_UPDATE", id); transfer.writeInt(SessionRemote.COMMAND_EXECUTE_UPDATE).writeInt(id); sendParameters(transfer); if (supportsGeneratedKeys) { int mode = GeneratedKeysMode.valueOf(generatedKeysRequest); transfer.writeInt(mode); switch (mode) { case GeneratedKeysMode.NONE: readGeneratedKeys = false; break; case GeneratedKeysMode.COLUMN_NUMBERS: { int[] keys = (int[]) generatedKeysRequest; transfer.writeInt(keys.length); for (int key : keys) { transfer.writeInt(key); } break; } case GeneratedKeysMode.COLUMN_NAMES: { String[] keys = (String[]) generatedKeysRequest; transfer.writeInt(keys.length); for (String key : keys) { transfer.writeString(key); } break; } } } session.done(transfer); updateCount = transfer.readInt(); autoCommit = transfer.readBoolean(); if (readGeneratedKeys) { int columnCount = transfer.readInt(); if (generatedKeys != null) { generatedKeys.close(); generatedKeys = null; } generatedKeys = new ResultRemote(session, transfer, objectId, columnCount, Integer.MAX_VALUE); } } catch (IOException e) { session.removeServer(e, i--, ++count); } } session.setAutoCommitFromServer(autoCommit); session.autoCommitIfCluster(); session.readSessionState(); if (generatedKeys != null) { return new ResultWithGeneratedKeys.WithKeys(updateCount, generatedKeys); } return ResultWithGeneratedKeys.of(updateCount); } }

Target:
public ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest) { checkParameters(); boolean supportsGeneratedKeys = session.isSupportsGeneratedKeys(); boolean readGeneratedKeys = supportsGeneratedKeys && !Boolean.FALSE.equals(generatedKeysRequest); int objectId = readGeneratedKeys ? session.getNextId() : 0; synchronized (session) { int updateCount = 0; ResultRemote generatedKeys = null; boolean autoCommit = false; for (int i = 0, count = 0; i < transferList.size(); i++) { prepareIfRequired(); Transfer transfer = transferList.get(i); try { session.traceOperation("COMMAND_EXECUTE_UPDATE", id); transfer.writeInt(SessionRemote.COMMAND_EXECUTE_UPDATE).writeInt(id); sendParameters(transfer); if (supportsGeneratedKeys) { int mode = GeneratedKeysMode.valueOf(generatedKeysRequest); transfer.writeInt(mode); switch (mode) { case GeneratedKeysMode.COLUMN_NUMBERS: { int[] keys = (int[]) generatedKeysRequest; transfer.writeInt(keys.length); for (int key : keys) { transfer.writeInt(key); } break; } case GeneratedKeysMode.COLUMN_NAMES: { String[] keys = (String[]) generatedKeysRequest; transfer.writeInt(keys.length); for (String key : keys) { transfer.writeString(key); } break; } } } session.done(transfer); updateCount = transfer.readInt(); autoCommit = transfer.readBoolean(); if (readGeneratedKeys) { int columnCount = transfer.readInt(); if (generatedKeys != null) { generatedKeys.close(); generatedKeys = null; } generatedKeys = new ResultRemote(session, transfer, objectId, columnCount, Integer.MAX_VALUE); } } catch (IOException e) { session.removeServer(e, i--, ++count); } } session.setAutoCommitFromServer(autoCommit); session.autoCommitIfCluster(); session.readSessionState(); if (generatedKeys != null) { return new ResultWithGeneratedKeys.WithKeys(updateCount, generatedKeys); } return ResultWithGeneratedKeys.of(updateCount); } }