Idempotent Prepared Statements

Description

Currently there does not seem to be a way to create an idempotent prepared statement; instead the client must call .setIdempotent() on every BoundStatement. If the statement is prepared in a fairly different place than it is bound (which seems pretty reasonable to do most of the time) this can be somewhat inconvenient. Possible solutions:

  • Extend PreparedStatement with setIdempotent()

  • Copy idempotent state from prepared statements generated from SimpleStatements

  • Automatically analyze the statement and handle everything under the hood. For simple statements this might be a bit too heavyweight, but for a prepared statement it seems like it would be worth it.

I'm pretty excited about automatic speculative retry, but my suspicion is a lot of people are not using it. Having statements automatically analyzed for idempotence would probably increase the number of users dramatically.

Environment

None

Pull Requests

None

Status

Assignee

Kevin Gallardo

Reporter

Anthony Cozzie

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Sprint

Priority

Major
Configure