You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
executeUpdate returns updateCount without holding stateLock. Every write happens under the lock, but the read after execute has no happens-before edge, so a concurrent close() or execute can hand back a stale count.
Where
LibsqlStatement 146 to 149 and LibsqlPreparedStatement 97 to 104 read the field directly. getUpdateCount at 449 correctly locks.
Scope
Add snapshotUpdateCount() that reads under stateLock.
Use it in both executeUpdate methods.
Do not add checkClosed(). Post-close executeUpdate keeps working, and the prepared statement already threw during execute.
Acceptance
Both update paths read the count under the lock.
./mvnw -pl libsql-jdbc -am test green, including LibsqlStatementConcurrencyTest.
A note in the PR records that this is a correctness fix, not a refactor, and that the race is hard to reproduce without instrumentation.
Activity
test(jdbc): pin attached schema, date time, and savepoint edges (#215)
fix(jdbc): read updateCount under the statement lock (#235)