Still a bug with the table.Attach method :-(

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
itcore@vit.ch
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Still a bug with the table.Attach method :-(

Post by itcore@vit.ch » Thu 09 Apr 2009 12:48

Hello

I have a Skins table with a column named ts of type timestamp. Within the EntityDeveloper I set the IsVersion flag for the ts column to true. Now I try to update a single skin row like this:

Code: Select all

MyDataContext.Skins.Attach(skin, true);
MyDataContext.SubmitChanges();
return skin;
According to the DBMonitor the SubmitChanges command correctly executes the UPDATE statement. But after the UPDATE statement there's also the following SELECT statement to update my skin object with the newly timestamp value:

Code: Select all

SELECT ts FROM tbl_skins WHERE `SkinId` = :key1, ts = :key2
As you can see, there is a bug in the WHERE clause. You missed the AND keyword. Could you fix this in order that I am able to return my skin object with the refresed timestamp value?

Thanks and regards
[/code]
________
List of ferrari engines history
Last edited by itcore@vit.ch on Thu 17 Feb 2011 05:21, edited 1 time in total.

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

Post by AndreyR » Mon 13 Apr 2009 10:06

Please let me know if the issue is not resolved with the released 5.20.27 build.

itcore@vit.ch
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Post by itcore@vit.ch » Tue 14 Apr 2009 09:54

Now, the code which I posted above does not perform any UPDATE anymore :-(

DBMonitor just shows two statements:

Code: Select all

SELECT t1.`SiteId`, t1.`SkinId`, t1.`Name`, t1.`Title`, t1.`ScriptSource`, t1.ts
FROM tbl_sites t1
WHERE t1.`Name` = :p0
ORDER BY t1.`Name`

Code: Select all

SELECT t1.`SkinId`, t1.`Name`, t1.`HtmlSource`, t1.`CssSource`, t1.ts
FROM tbl_skins t1
WHERE :np0 = t1.`SkinId`
Any ideas?
________
LAMBORGHINI CALA
Last edited by itcore@vit.ch on Thu 17 Feb 2011 05:21, edited 1 time in total.

itcore@vit.ch
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Post by itcore@vit.ch » Tue 14 Apr 2009 13:59

Ok, sorry. I tested this with an entity which didn't change at all. Therefore dotConnect didn't generate an UPDATE statement. If I attach a changed entity everything seems to work now.
________
Marriage Advice Dicussion

Post Reply