Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subsequent transaction errors should display properly #65

Closed
refset opened this issue Feb 13, 2025 · 2 comments
Closed

subsequent transaction errors should display properly #65

refset opened this issue Feb 13, 2025 · 2 comments

Comments

@refset
Copy link
Contributor

refset commented Feb 13, 2025

Currently a subsequent error may look like a "Statement succeeded" or a repetition of the earlier results entry

Confusing example found in the wild

What's actually happening:

Image

@refset
Copy link
Contributor Author

refset commented Feb 14, 2025

Finally getting somewhere...

PostgreSQL's Behavior with Failed Transactions

If a statement within a transaction (BEGIN ... COMMIT) fails in a way that PostgreSQL marks the transaction as failed, subsequent statements in the same transaction will not execute. Instead, they will return a default response until the transaction is explicitly rolled back.

This means if a transaction is in a failed state, JDBC might not actually be executing further statements, and instead, it might be returning an unintended previous result.

Admittedly this could all be ChatGPT hallucinations:

JDBC Connection Corruption

A no prepared statement error suggests that JDBC is in a broken state, likely due to how transactions are handled.
If the connection is implicitly closed or reset, then xtdb/jdbc-execute! might be executing on an invalid connection.
Result? Later tx batches might be inadvertently reusing old results because their execution is failing silently.

@refset refset pinned this issue Feb 14, 2025
@refset refset unpinned this issue Feb 14, 2025
@refset
Copy link
Contributor Author

refset commented Feb 14, 2025

I'm fairly sure this is actually a more fundamental pgwire/JDBC issue, and not Play misbehaving - i.e. the scope of xtdb/xtdb#4169 needs to be widened

@refset refset closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant