Skip to content

Comments

Add [NonTransactional] attribute to opt out of auto-applied transactions#2187

Merged
jeremydmiller merged 1 commit intomainfrom
non-transactional
Feb 15, 2026
Merged

Add [NonTransactional] attribute to opt out of auto-applied transactions#2187
jeremydmiller merged 1 commit intomainfrom
non-transactional

Conversation

@jeremydmiller
Copy link
Member

Summary

  • Adds a new [NonTransactional] attribute that allows handlers and HTTP endpoints to explicitly opt out of transactional middleware when using AutoApplyTransactions()
  • The attribute can be placed on individual handler methods or on the handler class itself
  • Works for both message handlers and Wolverine HTTP endpoints

Closes #2180

Test plan

  • MartenTests: [NonTransactional] on handler method prevents transactional middleware
  • MartenTests: [NonTransactional] on handler class prevents transactional middleware
  • MartenTests: Normal handlers still get transactional middleware with AutoApplyTransactions()
  • Wolverine.Http.Tests: [NonTransactional] on HTTP endpoint prevents transactional middleware
  • Wolverine.Http.Tests: Full test suite passes (474 passed, 10 skipped, 0 failed)

🤖 Generated with Claude Code

…ons (#2180)

Allows handlers and HTTP endpoints to explicitly opt out of transactional
middleware when using AutoApplyTransactions(), by decorating the method or
class with [NonTransactional].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Explicit Opt Out of Auto-Transactions for Specific Handlers

1 participant