"David G. Johnston" <david.g.johnston@gmail.com> writes: > As for your usage of "conn.setAutocommit(true)" - IIUC that is irrelevant > to this entire discussion. You've chosen to bundle up multiple statements > into a single Statement.execute(string) call which obeys the rules of the > simple query protocol - multiple statements:
I doubt it. We closed the not-in-transaction-block loophole decades ago for simple query protocol. What's at stake here is what happens when a series of extended-protocol commands are given without Sync between them, which we interpret as a request to run them all in the same transaction. I'm a bit surprised that the JDBC driver is choosing to issue them that way, because it implies (at least) that it's parsing the string enough to break it down into separate SQL commands. But we'd not be having this conversation if that weren't happening.
Yeah, I realized a bit after I wrote my comments that it is similar but not exactly this issue. And yes, the JDBC driver does indeed go to the trouble of parsing out statements.