|
Relational ViewsReferencesYou simply must read all of: Programmers Guide - Chapter 23 When to use Relational ViewsRelational views are used mainly in pre Dynamo 5.0 applications, since that's when Repositories were introduced. But Relational Views are also used where:
What are the available caching modes for Relational Views?One of the primary benefits of Relational View over direct JDBC usage is the caching that they offer. Each view (and sub-view) has a cache for each select that may be executed on it:
Each cache may have multiple entries keyed on the object arrays of parameters used to execute the query. A sub-view query will attempt to get results from the super-view cache before going to the database. How can I take advantage of Cross Caching?An item may be cross cached for multiple queries only when it is cached for a constraints based sub-view and the unique keyword is specified for each constraint property. How do you Bypass the View's Cache?After requesting the view, ask it for an uncached view object using the code below: RelationalView view = getManager().getRelationalView("ViewName");
view = view.getUncachedRelationalView();
The view object will now bypass the cache and retrieve values directly from the database. Cache InvalidationThe RelationalViewManager implements CacheInvalidationListener which has methods to invalidate specific caches and cache entries. In the distributed (clustered) environment an InvalidationRelay component is configured on each DRP. The RelationalViewManager then registers with this component and sends invalidation messages to via the InvalidationRelay to other clustered DRPs InvalidationRelays. The InvalidationRelay on each DRP also then dispatches these messages to the RelationalViewManager on that DRP. These messages are specific to a given RelationalViewManager absoluteName(), so if multiple RelationalViewManagers are configured the messages are only broadcast to other RelationalViewManagers in the cluster with the same nucleus name. The Distributed Cache Invalidation chapter, # 23 of the Programmers Guide explains how to se this up This caching system is not intended to ensure up-to-date information. Merely to ensure that data is up to date within some acceptable set of tolerances. Use the view.getUncachedRelationalView() method to ensure that you have the most recent copy where appropriate. Transactions
|
|