Page 1 of 1

ConcurrencyException not being thrown using Entity Framework

Posted: Mon 11 Apr 2011 19:38
by WRickS
I am using Entity Framework 4.0 and have unit tests to assure that concurreny exceptions are thrown. I was using a different provider for SQLite and the concurrency tests worked. Now they don't. I have played with all the settings for the connection.

The test goes like this. Open a ObjectContext (connection), its wrapped by a repository, Read some data. Next create a new ObjectContext and read and update the data. Next update the data from the first context and save it. It is at this point the concurrency exception should be thrown, but it does not happen. I have verified that the timestamps are different for the two instances of data before the second update is occurred and I have verified that the timestamp field is a computed field and concurrency is fixed.

If anyone has this working or even better can provide a code example where they have it working I would be highly appreciative.

Posted: Tue 12 Apr 2011 14:22
by AndreyR
Thank you for the report. I have reproduced the issue, the reason seems to be associated with a problem in DateTime parameters' implementation.
I will let you know about the results of our investigation.

Posted: Tue 12 Apr 2011 15:29
by WRickS
I need to clarify something for you. My timestamp is actually a long not a datetime. I just want to tell you this because your bug may not be related to just datetime.

Here is the update trigger I am using to create the “timestamp”.

CREATE TRIGGER TableNameTimestamp
AFTER UPDATE/INSERT
ON TableName
BEGIN
Update Table
Set TimeStampColumn = cast(replace(strftime('%f%M%H', 'now'),'.','') as integer)
Where Id = NEW.Id;

Select RAISE(IGNORE);
END;

Posted: Wed 13 Apr 2011 16:46
by AndreyR
Thank you for the report, I have reproduced the issue. I will let you know about the results of our investigation.

Posted: Wed 11 May 2011 08:58
by AndreyR
We have fixed the issue. The fixed build will be available in a week or so.

Posted: Thu 04 Aug 2011 06:57
by Shalex
The bug with comparing DATETIME columns and parameters is fixed. We will post here when the corresponding build of dotConnect for SQLite is available for download.

Posted: Fri 12 Aug 2011 13:42
by Shalex
New build of dotConnect for SQLite 3.30.202 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .

For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=21730 .