Page 1 of 1

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

Posted: 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

Posted: Mon 13 Apr 2009 10:06
by AndreyR
Please let me know if the issue is not resolved with the released 5.20.27 build.

Posted: 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

Posted: 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