Purpose of Entity / View caches

From research, articles, testing, and what info I've been able to glean off forum and metalink, it appears that entity/view caches are not used to satisfy querying, but to minimize storage of redundant data in memory. In other words, the purpose of the cache is simply to minimize memory used, but does not help query performance in any way.
Is this accurate? If this is the case, it would seem that minimizing caching in many cases might be better for performance than using a cache.
I've asked about the naure of entity / view caching in a TAR -- over two weeks in, still no answer....
B

Brad,
A fundamental design point of ADF Business Components is that we let the database be our global, cross-user shared cache. We make no attempt to try and be the global, shared cache in the middle tier very much by design. The application module defines the boundaries of the current users unit of work, and provides facilities for allowing that unit of work to span multiple HTTP requests with failover protection, etc.
The alternative approach is to try and provide a global, shared cache in the middle-tier, and require the user to consciously clone objects that need to be modified, and then deal with the issues of keeping the global, shared cache up to date when users make changes. This incurs overhead to maintain the consistency of that global cache when users are pounding lots of changes into it. We consciously opted against this approach after studying the way that Oracle Applications applications worked with the database in a typical scenario. The AM's transaction, which holds the caches, is a cache of in-progress work by that user, which can optionally have some of its data kept around for the next client that will use that AM from the pool.
The AM instances are pooled and used in a stateless way, but using an algorithm called "stateless with affinity" which attempts to keep an AM intance "sticky" to the client that used it last if load allows us to do that. This occurs when the user is performing a unit of work that spans pages, so that the AM is being released to the AM pool in the "Managed State" mode instead of the "Stateless" mode.
During the span of that unit of work, a user might use the same LOV's and visit the same screens over and over in the act of completing the job. The caches allow that user to avoid requerying any of that data during the span of that transaction, and generally the caches will contain only the data that is relevant to that user's task at hand.
In 10.1.2, you can use the RowQualifier to filter rows in memory for simple kinds of SQL-type predicates. In 10.1.3, we've added a lot more control for querying over the caches, filtering over the caches, and doing both -- under developer control -- over either or both the cache and the database.
Today, the primary way that the cache comes into play is avoiding database queries when things like association traversal is performed (typically as a part of business logic inside entity objects that need to access related entities to consult properties or methods on them), finding an entity by primary key which is performed for various reasons I've outlined in this blog article...
http://radio.weblogs.com/0118231/stories/2005/07/28/differenceBetweenViewObjectSelectAndEntityDoselectMethod.html
..., as well as avoiding requerying when you re-render view object data that's already been queried during the unit of work.
The entity cache holds the entity instances that the user has queried into the application module instance's transaction. The entity cache is populated by virtue of a view object's SQL statement, or by a direct or indirect call to EntityDefImpl.findByPrimaryKey().
That said, we do support the notion of a shared, read-mostly application module as well. To use a shared application module, you need to set the jbo.ampool.isuseexclusive configuration property to the value false.
Since all users are sharing the same application module, in particular they are sharing the view object instance, and even more in particular, its default rowset's default iterator.
At the present time, for this feature to work robustly, the client code must insure that each user iterating the rows in a view objects inside a shared AM instance creates his own RowSetIterator and does not rely upon using the default RowSetIterator. Failure to do this could result in users messing each other notion of "current row" up.
If you read my article on OTN about VO Performance Tuning...
http://www.oracle.com/technology/products/jdev/tips/muench/voperftips/index.html
you'll see that by avoiding caching when not needed, in some situations you can improve performance.
We hope to make the multi-user, shared-readonly data reading even simpler to take advantage of in the future for shared, read-only data, but it's possible to achieve today with a little work.

Similar Messages

  • How can we change the state of records in view cache and entity cache

    Hi everybody,
    I am trying to achieve selective rollback, or selective commit. By this I mean that I am looking for a way to change the state of rows in view cache, so that the selective changed rows can be rolled back during comit.
    if anyone has tried anything in this please help me.

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Filter rows in Entity Object Cache

    Hi
    Jeveloper version:Studio Edition Version 11.1.2.1.0
    I have a table employees with columns employee_id, first_name, last_name, last_opr.
    i have created entity object employees_eo. my entity cache should contain only rows which are not deleted(i.e last_opr not equal to 'D');
    how do i achieve it.

    I need to have only the rows which are not deleted(.e last_opr<>'D') in the entity object cache. (Not in the view object cache)
    The reason why i need is: i have an alternate key in the entity object employees_eo with the combination of employee_id, department_id. it raises an error('already exists') when the same combination is found.
    Lets say employee_id 100 with department_id 10 is deleted. Delete in the sense i am not deleting the record physically. Just flagging last_opr as 'D'.
    When i am trying to add new record with employee_id 100 and department_id 10. it says 'already exists'.
    so what i thought is , my entity object cache can contain only rows which are not deleted, so that alternate key will not check the deleted rows..

  • Possible?Multi-Entity View Object with one Entity Object that is Read-only.

    I know this sounds crazy, but I would like to create a multi-entity view object, where one entity object is based on a table in my application (we'll call it "Users", which basically stores the primary key for the person from the institutional people database), and the other table is a entity object based on a view of the institutional people database table (read only access), which we can call "People".
    I know that since no updates will be done to the People table, it really should be a read-only View Object, but I would lose the ability to sort on attributes like Last Name, Hire date, etc, since those would be transient attributes in my ViewObject for the Users. By having People as an entity object, I can then create a multi entity view object and have the ability to join Users to People and be able to sort on the above mentioned fields (like Last Name).
    The problem is that when I use the JDev (I'm currently using 10.1.2.1) AppModule BC4J tester, when I click on the multi-entity view object that I added to the AppModule it gives me an error:
    oracle.jbo.RowCreateException) JBO-25017: Error while creating a new entity row for People.
    ----- LEVEL 1: DETAIL 0 -----
    (java.lang.InstantiationException) null
    I have tried to change all the attributes to updateable in my entity object, but no create method, and I have tried to make them all read-only, but no effect, I get the same error (probably because the People view is read-only in my schema).
    Is there a way to change the entity object so that it will not try to create a new row when it runs the Tester? So that the multi entity view object behaves more like a view link, but gives me the added bonus of being able to sort on the Last Name column from the People table?
    Thanks for any help on this subject...at worst, I will have to use the view link method to get the job accomplished, but it would be "cooler" if this would work!
    Jeremy.

    Steve, thanks for your quick response to my question.
    To answer your questions, I was trying to create the Multi-entity View Object to give me more flexibility when working with my User table, and my People view. The flexibility I desired was that I would be able to sort my Users based on attributes in the People view. This is not possible when the there is only one Entity in my VO, and the People view data are all transient attributes, because they are not in the SQL statement.
    Ultimately, after working with one of my colleagues, we decided to use the approach that you mentioned by creating a read-only VO with the SQL query we want to display to the user (contains both User and People data fields), and then use a different ViewObject when performing other actions on the User Table (such as inserts/updates/deletes). By using the setWhereClauseParam() method in the handleLifeCycle() for the JSP page, we should be able to navigate between the different View Objects, so that the user does not see any difference.
    Thanks! Oh, and by the way, I have read your article you included before, and I have used it many times before to tune my View Objects! Thanks!

  • Purpose of selection view in report categories

    Hi Friends,
    Can anyone tell me the Purpose of selection view in report categories.
    Why we need to specify the selection view in report categories and what its impact in reports.
    Why do we need to create a custom selection views?
    Thanks in Advance.
    Regards,
    Prabhu

    This is according to the Business requirement
    Bye
    Reward

  • View Cache, Timeout=Never

    We have quite a few search forms, each with a bunch of combo boxes. The combo boxes are fed by lookup tables whose rows change VERY seldomly (is that a word?). We'd like to use <jbo:InputSelect...> to populate these, but would like it to load the values from the database only once - by the first person who hits it. On subsequent hits, it should just populate from the View Cache. For the few times that we change lookup values, we could manually call voObject.clearCache() so the values would load again.
    I know how to write this manually by varying the instructions in Online Help's "Populating a View Object with Static Data". But I'm lazy. Instead, I want to set some setting, or write a very small amount of override code in the ViewObjectImpl class that will accomplish the same thing. Ideas y'all?

    We have quite a few search forms, each with a bunch of combo boxes. The combo boxes are fed by lookup tables
    whose rows change VERY seldomly (is that a word?). We'd like to use <jbo:InputSelect...> to populate these, but
    would like it to load the values from the database only once - by the first person who hits it. On subsequent hits, it
    should just populate from the View Cache. For the few times that we change lookup values, we could manually call
    voObject.clearCache() so the values would load again..
    Please see the javadoc for oracle.jbo.http.SharedSessionCookieImpl and oracle.jbo.http.SharedSessionCookieFactory.
    These classes may be used to access a shared ApplicationModule which caches the shared, read mostly data. The
    javadoc contains instructions for using them. Use is transparent with the exception of having
    to declare the jbo.ampool.sessioncookiefactoryclass Configuration parameter for the shared ApplicationModule.
    If iterator state is required during a request It may be necessary to synchronize the threads (though the jbo:InputSelect
    tag does not look like it does require iterator state). If necessary, you can synchronize on the SessionCookie lock
    itself which you can acquire a reference to via SessionCookieImpl.getSyncLock(). In 9.0.3 you will be able to use
    the locking mode when acquiring an ApplicationModule to provide asynchronous thread access to a shared
    ApplicationModule (oracle.jbo.common.ampool.SessionCookie.useApplicationModule(true /* lock */)).
    Hope this helps.
    JR

  • Purpose of Creating View

    Hi Experts,
    Good Noon.
    Am new to OBIEE,and in the learning stage..a quick question !!!!Can you tell what is the purpose of creating VIEW in OBIEE? And what all VIEWS we can create in OBIEE?
    Hoping for a prompt response.
    Regards,
    Rishi.

    Hi ,
    creating views let you to test new columns(calculated or not ) new tables (you can merge several tables in one view) before applying the changes on the database .
    sure it stills not performer like a physical table but somtimes like in my case when you don't have full access on the database it stills the only solution that you have .
    Sincerly

  • Purpose of smart view

    Hi Experts,
    I am new to Smart view world so please let me know like I want a basic purpose of smart view of product's and customer's enterprises [If you have worked on these profile]  like i have to know what kind of data i am getting for aircraft interior product's and solutions for the business objects /distributors of aerospace fasteners and consumables .If I got any data what kind of formulas i might be use and what kind of analysis i am doing with and how i can able to analyse and what kind of analysis i can do using that.
    Thanks in advance if you can provide any documents and suggestion's

    Oracle Hyperion Smart View for Office provides a common Microsoft Office interface for Oracle Essbase, Oracle Hyperion Financial Management, Oracle Hyperion Planning, Oracle Hyperion Enterprise Performance Management Workspace, Oracle Hyperion Reporting and Analysis, Oracle Hyperion Financial Close Management, and Oracle Hyperion Enterprise® data sources. Using Smart View, you can view, import, manipulate, distribute, and share data from these data sources in Microsoft Excel, Word, Outlook, and PowerPoint.
    Please refer: Oracle Hyperion Smart View for Office Documentation Release 11.1.2.5
    HTH -
    Jasmine.

  • Entity Beans Cache

    Hi,
    We are running our application on WL platform 7.0. We have a number of EntityBeans(about
    30-40) which are container managed and also use CMR.
    The max-beans-in-cache is at its default of 1000. We reach this limit of 1000
    for about 10-15 of these beans in a day or two after a restart of the server.
    (This is production server, we restart this occasionally for maintenance). The
    memory usage for the server keeps increasing and once the entity cache limit is
    reached we see that passivation keeps occurring and the heap usage is always at
    about 80%-95% of the maximum (Total heap size is 1.5GB). We assume this could
    be due to the EntityBeans that are cached by WebLogic. We also see performance
    problems occassionally that might be probably due to the GC or passivation.
    We want to lower our memory usage and also get rid of the occassional slow response
    time. For doing this, is there any way to flush out those Beans from EntityCache
    which are no more used ? WebLogic doesn't seem to flush the cache but only passivate
    them as and when new beans are required. Is there any setting to change this behaviour
    Cheers
    Raja V.

    Thanks Thorick,
    We are using Database concurrency and non-read only beans, hence i believe this
    patch must help us.
    secondly, are you aware of any way to find out the memory usage of the default
    WLS Entity Bean Cache ?
    Cheers
    Raja
    "thorick" <[email protected]> wrote:
    >
    Hi,
    If you are using 'Database' concurrency, then support for an idle-timeout-seconds
    on this cache will be coming in release 7.0sp5. This feature is intended
    to ease
    heap usage when Entity Beans using Database/Optimistic/ReadOnly (but
    NOT Exclusive
    or read-only !). One sets the max-beans-in-cache to be large enough
    to handle
    periodic
    or occasional peak loads and idle-timeout-seconds is set to free the
    cache of
    unused beans
    during periods of low demand.
    If you cannot wait for sp5 and are willing to run a patch, there are
    patches available
    for
    7.0sp2 and 7.0sp3. You'll have to contact your support representative
    about
    these.
    Refer to 'CR110440' courtesy of yours truly !
    Hope this helps
    -thorick

  • Cannot read pre-view cache

    At startup I get failure message "cannot read from pre-view cache (förhandsvisningscache in Swedish)" every time. According to the message, the failure is supposed to be rectified at next start-up, but this has not happened. I simply cannot start Lightroom.

    Thank You so much! Will try that.
    Erik
    Skickat från min iPhone
    4 nov 2014 kl. 22:48 skrev DdeGannes <[email protected]>:
    Cannot read pre-view cache
    created by DdeGannes in Photoshop Lightroom - View the full discussion
    That message is indicating that four previews have been corrupted. If you delete the previews file Lightroom will rebuild them the next time the files are selected. If you wish you can do them overnight if you have a large catalog. The previews file has the same name as the Catalog file with an extension "Previews.lrdata" see the attached snapshot.
    https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-6899669-691558/900-719/Previe wsCacheLightroom.jpg
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6899669#6899669
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Lightroom by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Programmatic Invalidation of Entity Bean Cache

    Hi,
    I wonder if there is a way to trigger the invalidation of the WASs Entity Bean cache from a Java program.
    Does anybody know anything regarding this issue?
    Regards,
    Heiko

    Hi Heiko,
    the SAP EJB container does not support such kind of caching. We support a kind of "read only" entity beans, but you can mark a bean as "read only" only if it will never be updated. Any attempt for update will produce an exception. As a comparison, the JBoss "read only" options can be set for beans that are rarely updated.
    This explains why there is no invalidation command in SAP Web AS as well.
    We plan the implementation of a similar entity beans cache for the next releases.
    I hope this is not a showstopper for your porting project. This kind of caching is usually used with performance reasons, so the fall-back variant would be to define the entity beans as "regular" instead of "read only".
    HTH
    Regards,
    Svetoslav

  • Are views cached

    I have a view say view1
    the first time i run it,it returns in 110 sec
    the second time i run it,it returns in 10 sec
    Are the views cached in oracle.IF so how to disable it
    Kindly help

    > Are the views cached in oracle.
    No. You are implying that a view is some kind of "result set" that is kept in memory.
    A view is a SQL statement. That SQL statement is parsed and cached in the Shared Pool. This is called a hard parse. If that SQL statement is already in the Shared Pool, Oracle simply re-uses that copy. This is called a soft parses. A 100,000 hard parses can take many minutes. A 100,000 soft parses can take a few seconds.
    Hard parsing is thus a lot more expensive than soft parsing. But for a single query, looking at that query's elapsed execution time only, a hard parse versus a soft parse will not result in a huge difference.
    I/O is the most expensive operation on a database. There are two types.
    PIOs or Physical I/Os - getting data from disk.
    LIOs or Logical I/Os - getting data from the Oracle buffer cache.
    A PIO can be a lot slower (and usually is) than a LIO. Typically you will run a query for the 1st time. Data is on disk. Lots of very expensive and slow PIOs.
    The 2nd time, with the data in the cache, LIOs are used. A lot cheaper than those expensive PIOs.
    Note that an Oracle PIO is not always an actual physical I/O - it simply means that Oracle did not find the data in its cache and called the o/s kernel to perform an I/O. The o/s itself has buffer caches. It may service that PIO call from Oracle by going to actual disk - or it may find that data in its file system buffer cache.
    > IF so how to disable it
    Why? There are NO valid reasons for doing it, unless you are doing very basic benchmarking.. and even then, that approach to benchmarking needs to be questioned as the approach looks at one specific state only - which does NOT exist as the sole state on ANY Oracle database instance.
    Message was edited by:
    Billy Verreynne

  • Dynamic re-creation of Entity/View Objects

    Does anybody know if the following is possible with JDeveloper/ADF, and if so, any suggestions on where to start?
    My boss wants to be able to re-define a series of database views dynamically at any time, adding/removing columns. This will be handled by PL/SQL etc so it is not part of the JDeveloper question.
    But he then wants the J2EE Swing GUI application to be able to "see" the changes to the view immediately e.g. to display new fields on the client form, without having to re-compile any code.
    The Swing GUI appears to be a given, unfortunately as it would be easier to re-create at least the GUI dynamically using JSP etc.
    Right now, I'm trying to figure out how to pass the database changes through the J2EE tiers e.g. how do I dynamically re-define the Entity Object based on the modified view, without re-compiling it? How do I reflect these changes in the corresponding View Object(s)?
    Personally I think this requirement will be the death of the project, as it will absorb 95% of our limited intellectual/Java resources for 5% of the functionality: Welcome to Dilbertland!
    But given this requirement, does anybody out there have any ideas?
    Thanks,
    Chris

    Hi Chris ,
    well you can always create dynamic attribute in the view object using viewObject.addDynamicAttribute(DynamicAttributeName);
    and you can store any serialazable object in this attribute like any other attribute. It should be serializable coz BC4J needs to send it to Database in case you are using spillover feture
    to cache records.
    you can also create Dynamic view object based on an entity or a SQL query.
    AppModule.createViewObjectFromQueryStmt();
    But of course dynamic view based on SQl Query
    will not be updatable. I doubt , You can dynamically create attribute on Entity or dynamic Entities.
    I have already posted one question for this ..and waiting for reply ..:-(
    Updatable , Dynamic VIEW OBJECT ??
    hope it'll help
    Prasoon

  • Entity Object Caching!

    Hi I am trying to understand what kind of caching an entity object does. Suppose a user issues a query which returns X no of rows utilizing a view Object. If another user issues the same query, will it retrieve from the entity object or go to the database to find it?
    What do developers have to do in order to minimize visits to the database?
    null

    Hi
    My understanding is that the query will still be send to the database, the rows returned will be compared with those in the cache, and if they exist and have not been changed the cached objects will be used.
    To enable Oracle to prevent queries being submitted to the database the BC4J framework would have to support functionality similar to that provided by Oracle parallel server (and its support for distributed caches) determing whether data had been modified via distributed locks.
    I apologise if this is a bum steer, perhaps Development can comment...
    null

  • Is it possible to update attributes in all tables in a multi entity view

    Hi I have a view based on 4 entities, all of which are a 3 of which are 1 to many relationship with the 4th. The 3 additional entities have 2 or 3 attributes, Id, name, and one entity has a foreign key relating to a different table which I do not care about. The IDs are all updatable in the entity, and none of them are generated from a sequence but are inserted manually, except for the 4th (Master?) which is generated from a sequence.
    I create the view and all the entities are updatable, but in the view when I go to attributes from the other tables, it says updatable never and is grayed out so I cannot change it, even though in the entities tab, it is updatable always.
    So I was wondering if this was possible to do???

    I do not understand really, if it is 2 different tables, it is 2 different primary keys. Why would this even happen? What does it matter if EmployeeID and DepartmentID is both 1??? It just seems that there has to be a simpler way to do this but ok.
    So I go to the AppModule, Java tab and go generate Java class. The original code was
    public ViewObjectImpl getObjektiCRUDView1()
    return (ViewObjectImpl)findViewObject("ObjektiCRUDView1");
    I then copy your code to the best of my limited knowledge and get this
    public ViewObjectImpl getObjektiCRUDView1()
    this.getObjektiCRUDView1().executeEmptyRowSet();
    {Row yourRow = this.getObjektiCRUDView1().createRow();
    this.getObjektiCRUDView1().insertRow(yourRow );
            return (ViewObjectImpl)findViewObject("ObjektiCRUDView1");
    On the first row the getObjektiCRUDView1() is underlined and it says missing method body or declare as abstract.
    I know I did something wrong here but I have no idea what as I am not very good with Java
    Also it is not a jsf page, I create a single jspx page and divided it using the panel splitter so on one side we have an adf table for updating the Objekti database table, and on the other side I have an adf form for updating the Positions table (and later on other tables, I hope to have many forms there)
    Edited by: Dino2dy on Jun 10, 2010 12:02 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for