Skip to content

Commit ffe6f19

Browse files
authored
fix(jdbc): drop duplicate checkClosed in prepared execute (#150)
Fixes #81 Contract: Hrana 3 is the source of truth for transport, values, metadata, batching, transactions, and error reporting; `java.sql` is the source of truth for the JDBC surface; xerial/sqlite-jdbc is a behavioral reference and conformance foundation, never a copy target. ## What changed `LibsqlPreparedStatement.executeCurrent()` called `checkClosed(); beginExecution(); checkClosed();`. The second check runs after the state transition and before `connection.executeStatement`, which already checks the connection itself. Removed it, leaving the single `checkClosed()` before the state transition. One file changed, one line deleted, no behavior change. ## Divergence from the plan's Files block `LibsqlStatement.java` is in the plan's Files block but needed no edit: its second `checkClosed()` was already removed in `4b30b46` (#85), which matched xerial's tolerance of `execute` after `statement.close()`. That behavior is pinned by `LibsqlStatementLifecycleTest.executeAndGetConnectionStillWorkAfterClose` (#148), so adding a `checkClosed()` to the statement execute path would be a behavior change and was not done. `executeSql` reads `beginExecution();` with the connection check inside `LibsqlConnection.executeStatement`. ## Evidence Red at trunk (`origin/main` `de31dc6`): `executeCurrent` at lines 231-235 reads `checkClosed(); beginExecution(); checkClosed();`. Green at head (`2621b71`): one check. Log: `/tmp/xerial-parity-i81/lane-3-specific.log`. Lanes at head (logs under `/tmp/xerial-parity-i81/`): 1. Regression lane: not applicable. The plan's unit box says no new tests, so there is no new failing case; the diff check stands in for it (lane 3). 2. Lifecycle and prepared suites, trunk vs head: identical, 21 `LibsqlStatementLifecycleTest` + 6 `LibsqlPreparedStatementTest` = 27/27 pass on both sides (`trunk-unit.log`, `head-unit.log`). 3. No double check remains in either file (`lane-3-specific.log`). 4. `-pl libsql-jdbc test`: BUILD SUCCESS, 293/293 (`lane-4-module-suite.log`); trunk is also 293/293 (`trunk-module-suite.log`). 5. `-pl libsql-conformance -am verify`: BUILD SUCCESS, 123 tests, 0 failures, 1 skipped, no divergence line (`lane-5-conformance.log`). 6. `-Pxerial-control verify`: BUILD SUCCESS, 100 tests, 0 failures, 1 skipped; differences are the pre-existing reference notes, none introduced here (`lane-6-control.log`). 7. `spotless:check`: BUILD SUCCESS (`lane-7-spotless.log`). 8. `./mvnw test`: BUILD SUCCESS, 293/293 in `libsql-jdbc` (`lane-8-reactor.log`). 9. Statement surface: BUILD SUCCESS, 30/30 (`lane-9-specific.log`). 10. `-pl libsql-jdbc -am package -DskipTests`: BUILD SUCCESS, driver jar built (`lane-10-package.log`). Perf: three interleaved `./mvnw -pl libsql-jdbc test -q` runs per side, trunk first. Trunk median 2.161 s, head median 2.167 s (+0.3%, within the 10% rule). Raw values in `perf-raw.txt`. Base `de31dc6`, head `2621b71e5c77c5a9976519942e2b8d5b2044ff29`. No merge; stopping at merge-ready.
1 parent de31dc6 commit ffe6f19

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎libsql-jdbc/src/main/java/com/github/magnusp/libsql/jdbc/LibsqlPreparedStatement.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ public boolean execute() throws SQLException {
231231
private StmtResult executeCurrent() throws SQLException {
232232
checkClosed();
233233
beginExecution();
234-
checkClosed();
235234
return connection.executeStatement(buildCurrentStmt());
236235
}
237236

0 commit comments

Comments
 (0)