Concurrency Control and inheritance problem

Posts   
 
    
Alfredo avatar
Alfredo
User
Posts: 46
Joined: 12-Dec-2004
# Posted on: 02-Aug-2008 06:18:05   

Hi:

I have successfully implemented the LLBLGEN concurrency control mechanism in the past...until now. I am using version 2.5 Final.

I have a TargetPerEntity inheritance scheme like this:

Person<-Customer Person<-Supplier Person<-Employee

where obviously I have a physical table for each object in the hierarchy. Every entity class generated was modified (in My*Entity.InitClass() function) in order to add the ConcurrencyPredicate using a timestamp column (SQLServer2005) as the "row version id" (rowid for short). I am using the adapter with two classes template.

The problem arises when I update an instance of Customer, because the SQL update statement uses the concurrency predicate for the customer entity (Customer.Rowid) but it doesn´t include the predicate for the Person base class (Person.Rowid). Specifically, when I update an inherited field (e.g. Address) which belongs to the Person table, because it never uses the Person's rowid, only the Customer's rowid and therefore, will never detect a concurrency violation.

I suspect that the problem is related somehow to the combination of two class scheme with inheritance, so any comments/help will be appreciated.

Thanks

Alfredo

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Aug-2008 20:26:33   

Hi Alfredo,

Could you please post the code snippet of the concurrency control implementation? Does the timestamp field belong to Person or Customer entity? or each table contains such column?

David Elizondo | LLBLGen Support Team