Page 1 of 1

STE Fixed Concurrency With Nullable Value Throwing Exception

Posted: Wed 17 Aug 2011 20:01
by yensid21
I have a self-tracking entity object (Phone) which has a nullable boolean property (PrimaryPhone) and which has the concurrency mode set to fixed. If I retrieve a record from the table tied to the entity object (SO$ENTITY.PHONES) and there is a value other than null in the field tied to the boolean property, I can update the row. However, if the field has a null value and I try to update the row, an OptimisticConcurrencyException is thrown. If, however, I set the concurrency mode to none, then the row can be updated. This is true when different object contexts are used when the data is retrieved then later updated. This is due to the fact that the data is being sent through a WCF service and so I don't maintain the object context between calls.

This is the SQL generated:

UPDATE "SO$ENTITY".PHONES
SET ENTITY_ID = :p0,
COUNTRY_CODE = NULL,
PHONE_NUMBER = :p1,
EXTENSION = NULL,
PRIMARY_PHONE = :p2,
BEST_TIME_TO_CALL = NULL,
COMMENTS = :p3,
PHONE_TYPE = :p4,
STATUS = :p5
WHERE ID = :p6
AND ENTITY_ID = :p7
AND (COUNTRY_CODE IS NULL)
AND PHONE_NUMBER = :p8
AND (EXTENSION IS NULL)
AND PRIMARY_PHONE = :p9
AND (BEST_TIME_TO_CALL IS NULL)
AND COMMENTS = :p10
AND PHONE_TYPE = :p11
AND STATUS = :p12

As you can see, it is trying to compare the nullable boolean field PRIMARY_PHONE to a value :p9 (which was NULL) when it should be using the IS NULL comparison if the value was NULL previously. However, if there was a value before, then the above statement would be correct.

I was wondering if there is a way to fix this problem without turning off concurrency checking.

Thanks.

Posted: Fri 19 Aug 2011 13:47
by Shalex
We are investigating the issue.

Posted: Thu 01 Sep 2011 10:43
by Shalex
Are you using the 6.30.202 version of dotConnect for Oracle? We cannot reproduce the issue at the moment. Please send us a small test project with the corresponding DDL/DML script to reproduce the issue in our environment.

Resolved

Posted: Mon 12 Sep 2011 13:04
by yensid21
I did not have the latest version. When I updated to version 6.30.202 it did fix the problem. Thanks.