ConcurrencyException not being thrown using Entity Framework

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
WRickS
Posts: 3
Joined: Mon 11 Apr 2011 16:06
Location: Louisiana

ConcurrencyException not being thrown using Entity Framework

Post by WRickS » Mon 11 Apr 2011 19:38

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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 12 Apr 2011 14:22

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.

WRickS
Posts: 3
Joined: Mon 11 Apr 2011 16:06
Location: Louisiana

Post by WRickS » Tue 12 Apr 2011 15:29

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;

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 13 Apr 2011 16:46

Thank you for the report, I have reproduced the issue. I will let you know about the results of our investigation.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 11 May 2011 08:58

We have fixed the issue. The fixed build will be available in a week or so.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 04 Aug 2011 06:57

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 12 Aug 2011 13:42

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 .

Post Reply