Skip to content

feat(runtime): support caller-owned JDBC connections - #21

Merged
omer-cengel merged 1 commit into
masterfrom
feature/caller-owned-jdbc-transactions
Sep 21, 2026
Merged

omer-cengel merged 1 commit into
masterfrom
feature/caller-owned-jdbc-transactions

Conversation

@omer-cengel

Copy link
Copy Markdown
Member

Summary

Allow generated query classes to execute on a caller-owned JDBC connection so applications can coordinate multiple generated operations within their own commit or rollback boundary.

Changes

  • Add a JdbcQueryExecutor(Connection) construction path while preserving the existing DataSource path and generated APIs.
  • Share parameter binding, row mapping, affected-row handling, resource closure, and exception translation between both modes.
  • Leave caller-owned connection lifecycle and transaction configuration under application control.
  • Add runtime resource-ownership coverage and PostgreSQL commit/rollback integration tests.
  • Document ownership, transaction control, exception behavior, and synchronous execution.

Scope and non-goals

  • Generated classes continue to depend only on QueryExecutor.
  • DataSource operations continue acquiring and closing one connection per operation.
  • Caller-owned connections are never closed, committed, rolled back, or reconfigured by sqlcj.
  • This does not add transaction callbacks, savepoints, retries, pooling, framework adapters, asynchronous APIs, caching, tracing, metrics, or timeouts.

@omer-cengel
omer-cengel merged commit 154af54 into master Sep 21, 2026
6 checks passed
@omer-cengel
omer-cengel deleted the feature/caller-owned-jdbc-transactions branch September 21, 2026 20:54
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.

1 participant