This is a migrated thread and some comments may be shown as answers.

Using a summary view and the detail tables it draws on

2 Answers 29 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ross Presser
Top achievements
Rank 1
Ross Presser asked on 10 May 2011, 12:52 AM
I have a StockInventoryTransactions table, that lists individual inventory transactions. I also have (in the database) a CurrentLevels view that summarizes them by StockID. I definitely want the summarizing to happen on the sql server, not in LINQ; when there are thousands of transactions, you only want to pull down one summary row.

The trouble is, if I add a new transaction to StockInventoryTransactions, and commit it, the CurrentLevels view does not reflect the change. ORM doesn't realize that this view depends on a table that has been just modified, and that any cached data is no longer valid.

Is there some way I can flag this view as volatile?

Backend database is MS Sql Server 2008 R2.  OpenAccess version is 2009.3.111, with reverse mapping.  Yes, this is old.  No, I would rather not take the time and risk to upgrade right now.

2 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 13 May 2011, 09:18 AM
Hi Ross Presser,

 Have you enabled the 2nd Level Cache? You can specify that instances of the class mapped to the view are not cached by adding the following entry to the app.config
<namespace name="BusinessObjects">
    <class name="MappedToView">
        <extension key="cache-strategy" value="no" />
    </class>
</namespace>

You can find more information about the mapping entries, here and here. You can also manually evict the instances from the cache whenever you know the cached data is no longer valid by using the Database.Cache.EvictAll method.

Do get back in case you need further assistance.

Greetings,
Ady
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
Ross Presser
Top achievements
Rank 1
answered on 02 Jun 2011, 08:42 AM
No, I have not enabled 2nd level cache. This is about the primary cache. I will try using scope.Evict to get the data out of memory.
Tags
Development (API, general questions)
Asked by
Ross Presser
Top achievements
Rank 1
Answers by
Ady
Telerik team
Ross Presser
Top achievements
Rank 1
Share this question
or