This question is locked. New answers and comments are not allowed.
Hi,
before all I must say Telerik OpenAccess is amazing ORM! I love to work with it.
But... now I have problem with object deletion. I have three tables in MS SQL 2008 database in N:M relation. Files, Baskets and BasketFiles table. I'm sending screenshot from Visual Designer where is realtion clear.
When I want to delete row from BasketFiles table, row is deleted, but still persists in cache. Another attempt to delete this object causes error. When I shut down L2 cache, everything is all right.
Here is code causing problems (it is called in ItemCommand of RadGrid) I made code a little more verbose for clarity:
Can you, please, tell me, where could be problem? I tried also clear cache with dc.Cache.Release and dc.Cache.Release(BasketFiles) command, but with no luck.
Thank you,
Zdenek
before all I must say Telerik OpenAccess is amazing ORM! I love to work with it.
But... now I have problem with object deletion. I have three tables in MS SQL 2008 database in N:M relation. Files, Baskets and BasketFiles table. I'm sending screenshot from Visual Designer where is realtion clear.
When I want to delete row from BasketFiles table, row is deleted, but still persists in cache. Another attempt to delete this object causes error. When I shut down L2 cache, everything is all right.
Here is code causing problems (it is called in ItemCommand of RadGrid) I made code a little more verbose for clarity:
Select Case e.CommandName Case "Delete" Dim basketFileToDeleteId = CInt(e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("BasketFileId")) Dim basketFileToDelete = (From q In dc.BasketFiles Where q.BasketFileId = basketFileToDeleteId).FirstOrDefault dc.Delete(basketFileToDelete) dc.SaveChanges()Can you, please, tell me, where could be problem? I tried also clear cache with dc.Cache.Release and dc.Cache.Release(BasketFiles) command, but with no luck.
Thank you,
Zdenek