Skip to content

Conversation

@gopalldb
Copy link
Collaborator

@gopalldb gopalldb commented Nov 5, 2025

Summary

Implement foundational infrastructure for Multi-Statement Transaction (MST) support in the Go driver, adding core structures and error constants needed for transaction implementation.

Changes

  • Add autoCommit bool field to conn struct for client-side state caching
  • Create tx struct with conn *conn field implementing driver.Tx interface
  • Add 5 transaction error constants:
    • ErrTransactionBegin - "failed to begin transaction"
    • ErrTransactionCommit - "failed to commit transaction"
    • ErrTransactionRollback - "failed to rollback transaction"
    • ErrTransactionNested - "transaction already in progress"
    • ErrUnsupportedIsolation - "unsupported transaction isolation level"
  • Initialize autoCommit = true in connector (default state)

Testing

  • ✅ Code compiles successfully (go build ./...)
  • ✅ Static analysis passes (go vet ./...)
  • ✅ Pre-commit hooks passed
  • Note: No functional tests in this ticket (foundational structures only)
  • Full testing will be implemented in PECOBLR-1160 and PECOBLR-1161

JIRA

Closes PECOBLR-1156
Part of Story: PECOBLR-1155
Part of Epic: PECOBLR-1144

Design Document

See DESIGN_MULTI_STATEMENT_TRANSACTIONS.md for complete technical design.
This implementation follows Section 3.1 (tx struct), Section 4.1 (autoCommit field), Section 4.2 (initialization), and Section 5.1 (error constants).

Implementation Notes

  • Follows JDBC implementation pattern (PR #1060) with client-side autocommit caching
  • No user-facing changes in this ticket (structures only)
  • Ready for PECOBLR-1157 (BeginTx implementation)

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

Add core infrastructure for Multi-Statement Transaction (MST) support:
- Add autoCommit bool field to conn struct for client-side state caching
- Create tx struct implementing driver.Tx interface
- Add transaction error constants (Begin, Commit, Rollback, Nested, UnsupportedIsolation)
- Initialize autoCommit to true in connector (default state)

This implements the foundational structures defined in the MST design document,
following the JDBC implementation pattern with client-side autocommit caching.

Part of Epic: PECOBLR-1144 (MST Support in GoLang driver)
Design: DESIGN_MULTI_STATEMENT_TRANSACTIONS.md

Signed-off-by: Gopal Lal <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants