feat(spring-mysql-redis): add endpoint to trigger COM_STMT_RESET#136
Merged
Conversation
Adds GET /api/todos/stmt-reset/{id}/{n} which re-executes a server-side
prepared statement n times on the same connection. Combined with the new
JDBC URL flags (useServerPrepStmts, cachePrepStmts, useCursorFetch),
MySQL Connector/J 8.x emits COM_STMT_RESET between re-executions, which
exercises the synthetic-OK fallback path added in keploy/keploy#4217 so
record/replay can be validated.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gouravkrosx
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/todos/stmt-reset/{id}/{n}tospring-mysql-redisthat re-executes a server-side prepared statementntimes on the same connection.useServerPrepStmts=true&cachePrepStmts=true&useCursorFetch=trueso MySQL Connector/J 8.x emitsCOM_STMT_RESETbetween re-executions.Why
keploy/keploy#4217 fixes the case where an unmocked
COM_STMT_RESETwould cause keploy to close the TCP connection, surfacing asCJCommunicationsException/Socket is closed. None of the existing sample endpoints reliably triggerCOM_STMT_RESET, so we need a dedicated path that forces server-side cursor reuse.How to test
Test plan
mvn packagesucceeds (note: pre-existing Lombok/@Dataconfig inpom.xmlmay need annotation-processor wiring on Java 21 — unrelated to this PR).keploy recordagainst the endpoint captures the new traffic.keploy testreplay logs show theCOM_STMT_RESETdebug line (stmt id) from fix(mysql/replay): synthesize OK for unmocked COM_STMT_RESET keploy#4217.CJCommunicationsException/SQLSTATE 08S01/Socket is closedin the app logs.🤖 Generated with Claude Code