How to disable automatic RecoveryStrategy for specific query

Posts   
 
    
Rosacek
User
Posts: 151
Joined: 18-Mar-2012
# Posted on: 06-May-2019 18:16:24   

I use Adapter v4.2 and 5.5

Hi, I override method CreateRecoveryStrategyToUse in DataAdapter to use recovery strategy automatically.

But now I have query where I do not want to use recovery strategy and I cannot find an easy way how to temporary disable "global" strategy for particular query.

The only way I found is to instantiate RecoveryStrategy having maxRetries=0 and set it to adapter.ActiveRecoveryStrategy but this is overkill.

Walaa avatar
Walaa
Support Team
Posts: 14743
Joined: 21-Aug-2005
# Posted on: 06-May-2019 23:54:03   

Why don't you derive from Data Adapter, where you override the method. Use the derived class when you need the Recovery Strategy, and use the base class where you don't need it.

Rosacek
User
Posts: 151
Joined: 18-Mar-2012
# Posted on: 07-May-2019 08:29:28   

I derive from dataadapter.

Looks there is no simple way how to disable recovery strategy. Ok I will live with it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 38573
Joined: 17-Aug-2003
# Posted on: 07-May-2019 09:13:34   

It's indeed not a turn-key solution, we'll see what we can do about that in the future.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 38573
Joined: 17-Aug-2003
# Posted on: 06-Mar-2020 11:41:04   

Implemented in v5.7

Frans Bouma | Lead developer LLBLGen Pro