As I have said before, I am a part time programmer and seem to be little rusty all of the time. With that said, after following the help instructions, I am unable to get SF concurrency using RowVersioning to work. User A and User B are editing the same record at the same time using the code below. User A saves the record. Then User B saves the record and the BO does not throw an exception. What am I doing wrong? Thanks for the help!
I have the following properties set on the ContactsBO:
CollisionNoficationType = ThrowException
RowVersionOrTimestampColumn = ContactRowVersion (datatype int - allow nulls)
UpdateConcurrencyType = OptimisticRowVersion
Code Below..............................
Using loBO As New ContactsBO
loBO.FillByPrimaryKey(contactID)
If loBO.IsEmpty Then
loBO.Edit()
loBO.UserID = GlobalVariables.CurrentUserID
loBO.Save()
MsgBox(
Ems.HandleException(
I am not using CRUD or DDT. As I show you in the code, I am just using the BO.Fill, BO.Edit and BO.Save methods to update a field. Therefore, how do I handle or trap for the concurrency issue using SF when User A and User B are editing and updating the field at the same time?
Thanks.
So, it's really up to you as to how you want to handle the error. If you capture the event, you can set the Resave property on the event args to True and the data layer will re-save the record after the event handler returns and you're original call to Save() will never know there was an error. If you catch the exception, then you'll need to call Save() again after you're done what you want to with the data.
I am using OptimisticRowVersion.
Thanks,
Jeff
Have a look at this post: http://forum.strataframe.net/FindPost6191.aspx
Follow it and I think you will find some good information about concurrency.
Hope it helps.