Skip to content

Step Factory#377

Draft
devhawk wants to merge 18 commits intomainfrom
devhawk/tx-step
Draft

Step Factory#377
devhawk wants to merge 18 commits intomainfrom
devhawk/tx-step

Conversation

@devhawk
Copy link
Copy Markdown
Collaborator

@devhawk devhawk commented May 5, 2026

This PR introduces Step Factories, a special kind of step for database access. Step factory steps execute as a single transaction, committing both step changes and DBOS chceckpoint atomically

Note, in TS this is called a datasource but in Java the term DataSource is already in use

This inial step factory PR provides an abstract PostgresStepFactory plus concrete step factories for JDBC, JDBI and JOOQ. A future PR will add declarative support for Spring Boot at a minimum (a @TransactionalStep annotation to complement @Transactional)

Note, It is NOT our intention to implement a Step Factory for every ORM and query builder in the Java ecosystem. We did three common ones to prove out the model. While we include the core JDBC step factory and related infrastructure in the base transact pacakge, this could have been implemented completely independently of DBOS. Community members who wish to support step factories for other libraries and/or transactional data stores are welcome to build them, ship them independenty and/or open PRs

fixes #185

@devhawk devhawk requested review from kraftp, maxdml and qianl15 May 5, 2026 00:30
Copy link
Copy Markdown
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice the name StepFactory is very broad and there's a more specific PostgresStepFactory. Do you envision using this interface for something other than transactional steps?

@devhawk
Copy link
Copy Markdown
Collaborator Author

devhawk commented May 5, 2026

I notice the name StepFactory is very broad and there's a more specific PostgresStepFactory. Do you envision using this interface for something other than transactional steps?

Not really. I originally was using "TransactionalStepFactory" but then thought that was just too long.

Copy link
Copy Markdown
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! My only quibble is the name, it's not obvious what a StepFactory is. One basic alternative might be TransactionFactory, or even TransactionRunner since it's not really a factory as far as I can tell, it doesn't produce classes but rather runs transactional steps.

@devhawk devhawk marked this pull request as draft May 6, 2026 00:17
@devhawk
Copy link
Copy Markdown
Collaborator Author

devhawk commented May 6, 2026

FYI, I converted this back to draft while I work on the class structure

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.

Transactional Step Provider support

2 participants