ORMConcurrencyException

Posts   
 
    
heerser avatar
heerser
User
Posts: 36
Joined: 15-May-2005
# Posted on: 10-Sep-2005 00:06:16   

Hi all, I have a couple of questions regarding ConcurrencyExceptions: What if the IPredicateExpression put in the save method is based on more than one field : PredicateExpression.Add(PredicateFactory.CompareValue(OrderFieldIndex.AdminId, ComparisonOperator.Equal, order.Fields[(int)OrderFieldIndex.AdminId].DbValue)); PredicateExpression.Add(PredicateFactory.CompareValue(OrderFieldIndex.StatusId, ComparisonOperator.Equal, order.Fields[(int)OrderFieldIndex.StatusId].DbValue));

Order.Save( PredicateExpression );

Is there a way to determine which field(s) caused the exception?

Is there anyway to get the current DB values of the field(s) that caused the ConcurrencyException??

thanx in advance!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Sep-2005 12:30:58   

heerser wrote:

Hi all, I have a couple of questions regarding ConcurrencyExceptions: What if the IPredicateExpression put in the save method is based on more than one field : PredicateExpression.Add(PredicateFactory.CompareValue(OrderFieldIndex.AdminId, ComparisonOperator.Equal, order.Fields[(int)OrderFieldIndex.AdminId].DbValue)); PredicateExpression.Add(PredicateFactory.CompareValue(OrderFieldIndex.StatusId, ComparisonOperator.Equal, order.Fields[(int)OrderFieldIndex.StatusId].DbValue));

Order.Save( PredicateExpression );

Is there a way to determine which field(s) caused the exception?

No. The whole purpose is that you specify a filter which should be TRUE before the action (update, delete) can take place. If you specify a filter on 2 or more fields, and one of the fields makes the filter become FALSE, it then causes teh action not to take place, but which field made the filter become false is unknown, as the filter is appended to the actual query.

Is there anyway to get the current DB values of the field(s) that caused the ConcurrencyException??

Only with an additional fetch.

Frans Bouma | Lead developer LLBLGen Pro