Error : "This entity participates in a transaction, which contains its own fields versioning"

Posts   
 
    
evb
User
Posts: 27
Joined: 17-Nov-2004
# Posted on: 11-Jan-2005 18:27:19   

Do you have more information about this error? Can you give an example of a situation when this error can happen? I'm trying to understand this error in our code. It happens when we are using entity.SaveFields and entity.RollbackFields (using field versioning). The problem is that it happens not always.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 11-Jan-2005 19:25:51   

When you add an entity to a transaction (or in adapter, when an entity is saved inside a transaction, for example you first start a transaction then call SaveEntity()), its fields are backupped internally. This is done because when a rollback takes place, the original field values have to be set back as newly received identity values for example should not be present, as the save failed.

Because of this, calling SaveFields() during this action is not helping as rolling back the transaction will overwrite the saved fields anyway.

So to avoid this error: do not call SaveFields() on an entity that participates in a transaction.

Frans Bouma | Lead developer LLBLGen Pro