Concurrency, timestamp field and read only

Posts   
 
    
avdean_
User
Posts: 5
Joined: 18-Dec-2006
# Posted on: 03-Nov-2007 13:51:06   

I've gone through all the threads on concurrency and I get the approach. I'm having one issue when trying to implement it. Any assistance would be greatly appreciated.

The issue I have is in our architecture we have decoupled the LLBL created objects from the UI by translating them into UI objects at the service level. So passing the timestamp field from an LLBL object to a UI object is ok, but when you save data and you translate the UI object back to a LLBL object you cannot set the timestamp to its original value because the LLBL object is set to readonly due to the SQL data type being a timestamp.

I have tried to use the designer to reset the readonly property of the field but this cannot be done because the designer has disabled the ability due to the data type.

I did some stepping through code and noticed that entitybase2.SetNewFieldValue is throwing the exception so i guess modifing the templates is not an option?

I guess will have to look at datetime?

Any info would be greatly appreciated.

Posts: 254
Joined: 16-Nov-2006
# Posted on: 03-Nov-2007 23:16:39   

You can certainly use ForcedCurrentValueWrite on the EntityField object however it's use is usually discouraged.

Setting a field value. This action is audited if an entity field is set through an entity property or through SetNewFieldValue, but also if an FK field is synced with a PK field during a recursive save action. Setting an entity field's CurrentValue property or calling an entity field's ForcedCurrentValueWrite isn't recorded.

Certainly auditing wouldn't track this change however that may not be that important to you

avdean_
User
Posts: 5
Joined: 18-Dec-2006
# Posted on: 05-Nov-2007 16:16:46   

Thanks for the information I'm glad there was an approach and we didn't have to use a datetime. The force method appears to have solved the issue, but I will continue testing and open another thread if I run into any other issues.

Thanks again!