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
  • I assume the value of the new int column of your existing rows in the ADSAccount table is NULL instead of 0 (default value). This would lead to the error seen.

    If so, you are likely affected by VPR#36176 where the default values are not set by Schema Extension.

    To get rid of the error, you need to set the value for the custom property CCC_XXX to 0 (default value) for all existing rows in your ADSAccount table via SQL.

Reply
  • I assume the value of the new int column of your existing rows in the ADSAccount table is NULL instead of 0 (default value). This would lead to the error seen.

    If so, you are likely affected by VPR#36176 where the default values are not set by Schema Extension.

    To get rid of the error, you need to set the value for the custom property CCC_XXX to 0 (default value) for all existing rows in your ADSAccount table via SQL.

Children