OptimisticConcurrencyException and DateTime properties

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 4
Joined: Wed 27 Jan 2010 16:12

OptimisticConcurrencyException and DateTime properties

Post by Deefken » Mon 27 Sep 2010 20:17


we have some odd behavior when using optimistic concurrency in combination with datetime properties. Saving the context for the second time throws an OptimisticConcurrencyException.

(1) We have an object context with an entity type 'MASTER' and entity set 'MASTERSet'
(2) This MASTER entity has several properties, one of these properties is of a DateTime type. The property is mapped to an Oracle column of DATE type.
(3) All properties of the MASTER entity have been configured with a 'Fixed' concurrency mode.
(4) When we first set the the DateTime property and save the context everything goes wel. When we change some other property of the entity, the save fails with an OptimisticConcurrencyException. When we do not set the DateTime property the first time, the 2nd save doesn't fail.

Can anyone help us out with this strange problem?

This is the (VB.NET) code that demonstrates the problem:

Code: Select all

Using ctx As New SomeContext()
    Dim master As MASTER = (From m In ctx.MASTERSet Select m).First
    master.SOMETEXTFIELD= "Test"
    master.SOMEDATEFIELD= DateTime.Now
    master.SOMETEXTFIELD= "TestUpdate"
    ctx.SaveChanges() ' This save fails
  Catch ex As Exception
  End Try
End Using

Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 28 Sep 2010 14:01

I have made a couple of tests using both Devart entity model and Microsoft ADO.NET Entity data model, everything succeeded on dotConnect for Oracle 6.0 Beta.
Could you please send us (support * devart * com, subject "Oracle EF Concurrency") a small test project illustrating the problem?

Post Reply