# JDBC batching can still issue one round trip per row unless driver statement rewriting is enabled

DevFeed: [JDBC batching can still issue one round trip per row unless driver statement rewriting is enabled](<https://devfeed.tech/articles/one-round-trip-beats-a-thousand-and-your-batch-api-probably-is-not-batching-39599.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/47-batching-one-round-trip-beats-a-thousand/>)

Author: hello@ankit-rana.com

Published: 2026-09-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [client](<https://devfeed.tech/topics/client.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [batching](<https://devfeed.tech/tags/batching.md>), [bulk-load](<https://devfeed.tech/tags/bulk-load.md>), [client](<https://devfeed.tech/tags/client.md>), [cost](<https://devfeed.tech/tags/cost.md>), [database](<https://devfeed.tech/tags/database.md>), [database-performance](<https://devfeed.tech/tags/database-performance.md>), [durability](<https://devfeed.tech/tags/durability.md>), [jdbc](<https://devfeed.tech/tags/jdbc.md>), [latency](<https://devfeed.tech/tags/latency.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [server](<https://devfeed.tech/tags/server.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

For small database writes, network round trips and transaction overhead can dominate the actual insert work. The article explains that JDBC batching may accept rows into a client-side batch while still sending separate statements unless driver-side statement rewriting is enabled, and that autocommit adds a transaction and durability barrier per row.

## Source excerpt

For small writes the per-statement overhead dominates the actual work, so throughput is set by round trips rather than by the database. JDBC batching is the usual fix and it silently does nothing on the wire unless the driver is told to rewrite the statements, so addBatch can look correct while still issuing one round trip per row. Autocommit compounds it by turning every row into its own transaction and its own durability barrier, which is the difference between one fsync and a hundred thousand.