Open Closed

UnitOfWork on Background job #3194


User avatar
0
barrett2474 created

Greetings,

I have a background job that when it executes, I wish to do a number of database calls. It's important that they are wrapped in a single transaction (UnitOfWork).

Question Will using the Attribute "UnitOfWork" on the said AsyncBackgroundJob be the best way?

  [UnitOfWork(isTransactional: true)]
  public override async Task ExecuteAsync(SaveTransactionFileUploadDto args)

Thanks you for your time,

Regards John

  • ABP Framework version: v5.2.2
  • UI type: Blazor WASM
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    yes, and you can also begin a uow manually.

    https://docs.abp.io/en/abp/latest/Unit-Of-Work#begin-a-new-unit-of-work

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.