New Posts New Posts RSS Feed: Concurrency column in a Complex Object
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Concurrency column in a Complex Object

 Post Reply Post Reply
Author
danielp37 View Drop Down
Newbie
Newbie


Joined: 18-Mar-2008
Location: United States
Posts: 29
Post Options Post Options   Quote danielp37 Quote  Post ReplyReply Direct Link To This Post Topic: Concurrency column in a Complex Object
    Posted: 19-May-2011 at 1:02pm
I have a complex object called "AuditInfo" that basically has 4 properties on it: CreatedAt, CreatedBy, ModifiedAt, ModifiedBy.

I am trying to set the ModifiedAt as a AutoDateTime concurrency column.

When I set the Concurrency Stategy to AutoDateTime, I am able to save the object, but the update doesn't update the ModifiedAt to the current DateTime.

When I set the Concurrency Stategy to Client and set the property during the EntityServerSaveInterceptor.ExecuteSave method, the update statement sets the ModifiedAt field, but it also checks the ModifiedAt column against the new value of ModifiedAt instead of the original value.

Am I doing something wrong or are concurrency fields on complex objects not supported?

If I could even have the whole AuditInfo complex type treated as a concurrency property then I could use that but when I set the Concurrency Mode to Fixed on that Property of the Entity it doesn't appear to be checking it for concurrency.

Dan
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 19-May-2011 at 2:42pm
Dan,
 
We should be support the functionality as EF, in this. I'll research this, and get back to you tomorrow. 
Thanks,
-- Robert


Edited by robertg - 19-May-2011 at 4:39pm
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 19-May-2011 at 5:23pm
Dan,
 
This limitation seems to be with EF itself, as a project in plain EF shows the same behavior as one with DF. For now, I suggest that you check concurrency against simple scalar properties instead, as that definitely works.
 
-- Robert
Back to Top
danielp37 View Drop Down
Newbie
Newbie


Joined: 18-Mar-2008
Location: United States
Posts: 29
Post Options Post Options   Quote danielp37 Quote  Post ReplyReply Direct Link To This Post Posted: 20-May-2011 at 7:33am
I was afraid of that.  Oh, well, it would have been really convenient.  I have just gone with removing the ModifiedAt from the ComplexObject and putting it as a regular scalar property on the Entity itself and this appears to be working.
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 20-May-2011 at 11:03am
Yeah. Sorry Dan, I went through a number of permutations in both DF and EF trying to get it to work before I broke the bad news that it doesn't. I really hope EF documentation is improved significantly soon.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down