Job progress tracking for transactions

Posts   
 
    
Puser
User
Posts: 228
Joined: 20-Sep-2012
# Posted on: 21-Jan-2021 16:06:01   

Hi,

Llblgen pro 5.7.1RTM Adapter

I have jobs which track the progress of it's actions. These are mostly long running processes which post their (progress) state to the job. The job itself can be monitored and has info about start and end time, state, overall progress and of sub jobs.

Now I also need progress of the async commit of transactions. These can contain many inserts, updates and deletes in one transaction, and can last some minutes. I mainly use Entities which are tracked in a UnitOfWork2 or DataScope. And only sometimes plain Sql, but tracking these are only nice to have.

What options do I have to track the progression of the saves in the commit?

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 22-Jan-2021 09:59:11   

I think the same way as when using an adapter and not a unit of work: the adapter does the work. The unit of work allows you to obtain the queue lengths, and the # of elements to process, so you can calculate the total # of elements to persist/work on.

Then the adapter instance allows you to intercept when things have happened, e.g. in the OnSaveEntityComplete method for instance. This method is called after the entity has been persisted, also in an async scenario, so you don't run into the situation where the method returned but the work is still pending because it's async.

Frans Bouma | Lead developer LLBLGen Pro
Puser
User
Posts: 228
Joined: 20-Sep-2012
# Posted on: 22-Jan-2021 16:19:00   

Thank you!

virginia
User
Posts: 27
Joined: 29-Nov-2016
# Posted on: 16-Apr-2024 14:44:25   

Is this possible to do with tracking stored procedure calls?

virginia
User
Posts: 27
Joined: 29-Nov-2016
# Posted on: 16-Apr-2024 14:44:49   

Otis wrote:

I think the same way as when using an adapter and not a unit of work: the adapter does the work. The unit of work allows you to obtain the queue lengths, and the # of elements to process, so you can calculate the total # of elements to persist/work on.

Then the adapter instance allows you to intercept when things have happened, e.g. in the OnSaveEntityComplete method for instance. This method is called after the entity has been persisted, also in an async scenario, so you don't run into the situation where the method returned but the work is still pending because it's async.

Is this possible to do with tracking stored procedure calls?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 17-Apr-2024 09:31:22   

virginia wrote:

Otis wrote:

I think the same way as when using an adapter and not a unit of work: the adapter does the work. The unit of work allows you to obtain the queue lengths, and the # of elements to process, so you can calculate the total # of elements to persist/work on.

Then the adapter instance allows you to intercept when things have happened, e.g. in the OnSaveEntityComplete method for instance. This method is called after the entity has been persisted, also in an async scenario, so you don't run into the situation where the method returned but the work is still pending because it's async.

Is this possible to do with tracking stored procedure calls?

1) don't post in old threads so start a new thread next time
2) what are you trying to do/accomplish?

Frans Bouma | Lead developer LLBLGen Pro
virginia
User
Posts: 27
Joined: 29-Nov-2016
# Posted on: 19-Apr-2024 06:59:55   

Otis wrote:

virginia wrote:

Otis wrote:

I think the same way as when using an adapter and not a unit of work: the adapter does the work. The unit of work allows you to obtain the queue lengths, and the # of elements to process, so you can calculate the total # of elements to persist/work on.

Then the adapter instance allows you to intercept when things have happened, e.g. in the OnSaveEntityComplete method for instance. This method is called after the entity has been persisted, also in an async scenario, so you don't run into the situation where the method returned but the work is still pending because it's async.

Is this possible to do with tracking stored procedure calls?

1) don't post in old threads so start a new thread next time
2) what are you trying to do/accomplish?

sorry about that. I have to show a progress bar for a unit of work commit containing hundreds of stored procedure calls. I was hoping there is some notification or event I could use to track the progress, like there is for entities

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 19-Apr-2024 09:28:05   

there might be, if you use Adapter. You can override the methods CallActionStoredProcedure and CallRetrievalStoredProcedure (or the async variants) and the proc call will end up in there, so you can use the override to e.g. send an event/message to your system to move the progress bar. That's about it tho, the Uow doesn't offer this ability as it executes the callbacks in a loop

Frans Bouma | Lead developer LLBLGen Pro