_savePointName missing in DataAccessAdapterCore

Posts   
 
    
Posts: 4
Joined: 22-Nov-2021
# Posted on: 22-Nov-2021 19:58:10   

Hi, I have just taken over a codebase where we are updating the versions from 4.2 to 5.7. We have custom code that kept track of the _savePointName field in DataAccessAdapterCore for any rollback transactions that needed to take place. When doing the migration to 5.7, I noticed that it is now gone. Has this field moved or been replaced?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Nov-2021 07:43:00   

Hi Ramon,

In v4.2, this variable _savePointNames was used to check whether or not a savePoint was already added, if it already exists, the code would throw an exception. (DataAcessAdapterCode.cs:3109) :

if(_savePointNames.ContainsKey(savePointName))
{
    throw new ArgumentException("There is already a savepoint defined with the name '" + savePointName + "'", "savePointName");
}

Then in v5.2 there was a change (Ref...):

DataAccessAdapter.SaveTransaction(name) and Transaction.SaveTransaction(name) no longer throw an exception when name was already used within the same transaction, as all supported databases which do support savepoints support multiple savepoints with the same name in a single transaction so the check / limitation is unnecessary.

So I think the variable is not there anymore because the existing of the check in the previous step is not needed anymore. So you will have to add it yourself to a inherited version, or control this check outside DataAccessAdapterCore.

David Elizondo | LLBLGen Support Team
Posts: 4
Joined: 22-Nov-2021
# Posted on: 24-Nov-2021 17:23:38   

Got it, good to know, we will work around this. Thanks!

daelmo wrote:

Hi Ramon,

In v4.2, this variable _savePointNames was used to check whether or not a savePoint was already added, if it already exists, the code would throw an exception. (DataAcessAdapterCode.cs:3109) :

if(_savePointNames.ContainsKey(savePointName))
{
    throw new ArgumentException("There is already a savepoint defined with the name '" + savePointName + "'", "savePointName");
}

Then in v5.2 there was a change (Ref...):

DataAccessAdapter.SaveTransaction(name) and Transaction.SaveTransaction(name) no longer throw an exception when name was already used within the same transaction, as all supported databases which do support savepoints support multiple savepoints with the same name in a single transaction so the check / limitation is unnecessary.

So I think the variable is not there anymore because the existing of the check in the previous step is not needed anymore. So you will have to add it yourself to a inherited version, or control this check outside DataAccessAdapterCore.