Starts in:
2 DAYS
5 HRS
10 MIN
5 SEC
Starts in:
2 D
5 H
10 M
5 S
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

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

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06