This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
We are a team of five developing a ASP.NET web application. We are trying out the LightSpeed ORM tool in our project. We came across a scenario in the project where the lightspeed's way of handling optimistic concurrency does not cater our needs. The scenario is explained in detail below According to the design that we have envisioned for the project, we create a layer of domain objects which are mapped from the entities generated by the ORM tool. Ex: the Employee entity generated by the LightSpeed ORM will have fields like ModifiedOn,LastUpdated (fields that are present in our database tables for point-in-time access to data). But the Employee domain object does not contain all these fields and contain only those that are valid from the business sceanrio like EmployeeID, Name, adderss etc... We added a new field called the LockVersion to all the database fields and enabled the Optimistic Concurrency to true for all the entities to acheive concurrency in the system. But the problem is that when we map the entites which the tool provides with the domain objects that we have created in the system, we lose the LockVersion field. When we try to make any updates to the system , we try to re-map the domain objects to the entites and to do that we need to fetch the entities from the database. When we do this, we get the latest version number (which was not the same when we intially fetched the record, assuming some one has updated the record in between) and lose concurrency. The possible solutions that we can think of are 1) Add the Lockversion field to the domain objects and keep track of them (But this may not be the right soultion for us, since we want to keep our domain objects as generic as possible) 2) If the LockVersion field is a non-readonly field, we can somehow manipulate this field within our code and keep track of the changes Please let us know if there are any other ways to do this
|
|