Concurrency Using RowVersion Problem


Author
Message
Jeff Pagley
Jeff Pagley
StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)StrataFrame User (461 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Guys,

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

  Return False

Else

  loBO.Edit()

  loBO.UserID = GlobalVariables.CurrentUserID

  loBO.Save()

Return True

End If

End Using

Catch ex As MicroFour.StrataFrame.Data.DataLayerException

MsgBox("DataLayerException ex = " & ex.Message)

Return False

Catch ex As MicroFour.StrataFrame.Data.DataLayerSavingException

MsgBox("DataLayerSavingExeption ex = " & ex.Message)

Return False

Catch ex As MicroFour.StrataFrame.Data.RowNotUpdatedException

MsgBox("RowNotUpdateExeption ex = " & ex.Message)

Return False

Catch ex As Exception

Ems.HandleException(Me, ex)

Return False

End Try


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search