VI.Base.ViException: Error applying changes to database. ---> VI.DB.ChangedByAnotherUserException

Hi,
In 9.1 I have created a custom attribute on the AdsAccount table. The attribute is a int field. In Object Browser when I modify the value, I obtain the error:
2023-03-15 08:20:40.9553 ERROR (VI.FormBase.ExceptionMgr ) : Error applying changes to database. VI.Base.ViException: Error applying changes to database. ---> VI.DB.ChangedByAnotherUserException: user was changed by another user.

I have enabled the trace logging and the log shows this. It seems that two updates are executed instead of one:

2023-03-15 08:20:40.8928 DEBUG (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : (232 ms) - update ADSAccount set CCC_XXX = 1, xdateupdated = GetUTCDate(), xuserupdated = N'viadmin' where (ADSAccount.UID_ADSAccount = '846ed6c8-f819-447a-adea-27de9dd21440') and (ADSAccount.CCC_XXX = 0)
2023-03-15 08:20:40.8928 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : ClaimConnectionAsync: Releasing lock on connection 1
2023-03-15 08:20:40.8928 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : ClaimConnectionAsync - read write, _transaction == 47935884
2023-03-15 08:20:40.8928 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : ClaimConnectionAsync: Lock aquired on connection 1
2023-03-15 08:20:40.8928 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : ClaimConnectionAsync: Use the transaction
2023-03-15 08:20:40.9084 DEBUG (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : (8 ms) - update ADSAccount set CCC_XXX = 1, xdateupdated = GetUTCDate(), xuserupdated = N'viadmin' where (ADSAccount.UID_ADSAccount = '846ed6c8-f819-447a-adea-27de9dd21440') and ((ADSAccount.CCC_XXX = 0) or (ADSAccount.CCC_XXX = 1))
2023-03-15 08:20:40.9084 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : ClaimConnectionAsync: Releasing lock on connection 1
2023-03-15 08:20:40.9084 DEBUG (ObjectLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Throwing 'user was changed by another user.' for object with key '<Key><T>ADSAccount</T><P>846ed6c8-f819-447a-adea-27de9dd21440</P></Key>'
2023-03-15 08:20:40.9241 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Decrement transaction count to 1
2023-03-15 08:20:40.9241 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Decremented pin count to 1
2023-03-15 08:20:40.9241 DEBUG (ObjectLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Session: Rollback Transaction
2023-03-15 08:20:40.9397 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Decrement transaction count to 0
2023-03-15 08:20:40.9397 DEBUG (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Resetting DB context data.
2023-03-15 08:20:40.9397 DEBUG (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : (6 ms) - ROLLBACK TRANSACTION
2023-03-15 08:20:40.9397 DEBUG (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : (7045 ms) - Physical Transaction
2023-03-15 08:20:40.9397 TRACE (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : Decremented pin count to 0
2023-03-15 08:20:40.9397 DEBUG (SqlLog a0f7f5b4-43ff-4cd4-8a4a-b64d4cdaffff ) : (7045 ms) - Pinned physical connection
2023-03-15 08:20:40.9397 TRACE (SqlLog ) : -- Connection 1 switched from Working to Available
2023-03-15 08:20:40.9553 ERROR (VI.FormBase.ExceptionMgr ) : Error applying changes to database. VI.Base.ViException: Error applying changes to database. ---> VI.DB.ChangedByAnotherUserException: eprinsa.org/EPRINSA/Usuarios/Zoilo Zzzz Pruebasss was changed by another user.
at VI.DB.Entities.DbOperations.ClusteringDbOperationsQueue.<_RunSingleAsync>d__43.MoveNext()

Any advice?

Thanks

Parents Reply
  • Yes, the value  of the new column is 0 en all rows. Despite this I have execute:
    update adsaccount set ccc_XXXX=0 where uid= 'yyyyyy' and later I have modified the value from object brower and it has been executed successfully.
    T
    herefore, even if the value is 0 in all the rows, I will first execute an update to set the value to 0 again.
    Thanks a lot.
     
Children
No Data