BMP - how to cache?

Hi!
before we started in J2EE I used Castor as my o/r mapping tool. It caches the object nicely so the load on the database was low.
Now we started using J2EE, first using CMP for our entity beans (J2EE server in the SEAS 8 PE) with the built in JDO implementation. Here my first question: Does this implementation (or any JDO implementation) also cache the obejcts?
For a new project we have to use BMP for the entity beans because we have to versioning all updated in the database (an setXXX() on an entity bean creates a new row (=version) for the object in the database). We directly coded the sql statements in the bean (in ejbStore, ejbLoad, ...).
Any idea how we can cache objectes in our BMP approach? Should we also use JDO here?
Thank you for any comments about this in advance....

W.g. we store information about orders in the databse which are not often changed, this information can be cached by the persistent layer. But when I access the db directly with sql statements (db is Oracle here), be have two db access everytime we access an order: One for the pk search and one for getting the data (when using value objects).

Similar Messages

  • Plz help.  How disable caching SQLJ statement  on WebLogic server 10.3?

    Plz help.
    How disable caching statement by SQLJ on WebLogic server?
    what the actual problem:
    1. create or replace view vtest as select object_name from dba_objects where rownum<200
    2. test.sqlj
      #sql dx testIterator = {
         select object_name from vtest
       int cnt=0;
       while( testIterator.next() ){
         cnt++;
       System.out.println("Count: "+cnt);
    3. Restart WebLogic and deploy project
    4. Run test on server, in log file
    "*Count: 199*"
    5. create or replace view vtest as select object_name from dba_objects where rownum<10
    6. Run test on server, in log file
    "*Count: 199*"
    7. Restart WebLogic
    8. Run test on server, in log file
    "*Count: 9*"

    Hi bud,
    Have you tried using WLST for what you are trying to achieve?
    Please take a look at the following links:
    http://docs.oracle.com/cd/E11035_01/wls100/config_scripting/domains.html
    http://docs.oracle.com/cd/E13222_01/wls/docs91/config_scripting/domains.html
    http://docs.oracle.com/cd/E13179_01/common/docs21/interm/config.html
    Hope this helps.
    Thanks,
    Cris

  • HOW TO cache user clicks on links with attributes such as "_blank" ?

    HOW TO cache user clicks on links with attributes such as "_blank" in Adobe AIR with JS or MXML or AS3 for creating new costume browser window (AIR) ?

    >This feature is indeed new to 8.5.
    Can you explain a bit more on what is possible in version 8.5? How easy it is to attach events to different sections of the 3D model? How easy it is to handle such events? I assume the events will fire even if the user rotates the 3D model via the camera control, right? Any limitations on the 3D model or what types of events are supported? If you have LV documentation describing this feature then that would be *very* helpful!
    Thanks for your reply
    MZ2

  • How to Cache a Web Template in RRI scenario

    Hi,
    We have used RRI functionality to one of our requirements where in user can look at Territory wise info first and can drill down to any specific territory for Dealer wise info. We have used Control Query to cache Dealer info based on all the territories. However, when user drills down from Territory to Dealer, system is not using the cache alreay created by the control query and resulting into slow response time.
    Any thoughts on how to cache the Dealer info in this scenario? Any valuable input is appreciated.

    Hi Arun,
    web template have a variable, that is Profit Center
    Now user wants to give on web, only Region = Europe, not Profit Center. (Region is an attribute of PC)
    Then he wants to have for each Profitcenters in Europa (let say 50 PCs) a seperate printout.
    Now he should call the report 50 times for each profit center should click on Print Button...
    Cheers

  • How to cache the objects MANUALLY?

    hello
    some o-r mapping tools can cache the objects that have been queried,then next time these objects are required,it don't need to access the database again,it can also monitor the database updating.
    i wonder how i can implement such "cache" function MANUALLY? because i DON'T want to use ANY o-r mapping tools. i only use the jdbc to query database,then generate the object.
    who can give me some clue?? or articles? or sample codes??
    thank you!!!!!

    no you don't understand me,what i want to know is the
    mechanism of the cache,and how to implement it myself
    without using the o-r mapping tools.
    the dao pattern can encapsulate the database
    access,but it can NOT cache the object .First you need to define how the caching occurs.
    - Can the data in the database change without going through your code?
    - Are there multiple copies of your app running at the same time. If yes then what happens if one is updated?
    - How many of these can there be and what impact will this have on memory?
    - etc.
    You also need to identify the 'identity' of an object.
    A simple strategy....
    - Some layer requests an object using the 'identity'.
    - The database layer code looks in a hash for the 'identity'. If it finds it it returns it.
    - If it doesn't find it it uses a DAO to load it, then puts it in the hash, then returns it.

  • How the cache.invoke() works?

    Hi, I am trying to play with the coherence 3.4.2 to find out how the cache.invoke() works. I modified the SimpleCacheExplorer.java coming as the example code as following:
    1) I defined a distributed cache as following:
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>
    <!--
    Caches with any name will be created as default replicated.
    -->
    <cache-mapping>
    <cache-name>*</cache-name>
    <scheme-name>default-dist</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <!--
    Default Replicated caching scheme.
    -->
    <distributed-scheme>
    <scheme-name>default-dist</scheme-name>
    <service-name>DistributedCache</service-name>
    <backing-map-scheme>
    <class-scheme>
    <scheme-ref>default-backing-map</scheme-ref>
    </class-scheme>
    </backing-map-scheme>
    </distributed-scheme>
    <!--
    Default backing map scheme definition used by all
    The caches that do not require any eviction policies
    -->
    <class-scheme>
    <scheme-name>default-backing-map</scheme-name>
    <class-name>com.tangosol.util.SafeHashMap</class-name>
    </class-scheme>
    </caching-schemes>
    </cache-config>
    2) I modified the SimpleCacheExplorer.java as following:
    class MyProcessor extends com.tangosol.util.processor.AbstractProcessor
    private static final long serialVersionURD = 8004040647128795431L;
    private String cacheName = null;
    public MyProcessor(String cacheName)
    this.cacheName = cacheName;
    public Object process(Entry entry)
    NamedCache cache = CacheFactory.getCache(cacheName);
    cache.clear();
    return null;
    public class SimpleCacheExplorer {
    * Entry point.
    * @param asArg command line arguments
    public static void main(String[] asArg)
    throws Exception
              NamedCache cache = CacheFactory.getCache("Test");
              cache.put("1", "one");
         cache.invoke("1", new MyProcessor("Test"));
         System.out.println("cache size = " + cache.size());
    3) Then I got the following exception:
    com.tangosol.util.AssertionException: poll() is a blocking call and cannot be called on the Service thread
    Is there a way I can do the cache clear in the invocation way?
    Thanks

    The EntryProcessors operate against a particular Entry and usually executes on the node where the entry is stored. What you can do is to remove the particular entry this entryprocessor is aimed at by calling entry.remove()
    Here is a modified entry processor that removes an entry.
    class MyProcessor extends com.tangosol.util.processor.AbstractProcessor
      private static final long serialVersionURD = 8004040647128795431L;
      public MyProcessor() {}
      public Object process(Entry entry)
        if (entry.isPresent())
           entry.remove(false);
      return null;
    }Getting a hold of the CacheFactory while executing an EntryProcessor is a re-entrant call in to the DistributedCacheService which is rendering the exception.
    More on re-entrancy restrictions and recommendations in this whitepaper: [Coherence Planning: From Proof of Concept to Production|http://www.oracle.com/technology/products/coherence/pdf/Oracle_Coherence_Planning_WP.pdf]

  • How to cach enter button pressing in java 2D API

    hi guys,
    how to cach enter button pressing in java 2D API
    thanks
    siva

    thats input handling -> Belongs to AWT.
    Tip-> register an KeyListener and search for KeyEvent.VK_ENTER
    lg Clemens

  • How to cache a content item like a Static HTML Page from UCM to Coherence/C

    Hi All,
    How to cache a content item like a Static HTML Page from UCM to Coherence/Coherence Web?
    Thanks

    Hi,
    Could you explain your use case in more detail?
    It does not look like proper use of coherence to cache static content - it more suited for dynamic content like user session etc.
    Adam

  • The coherence cluster supports created how much cache?

    Hi,
    I have runing Oracle Coherence GE 3.6.1 in cluster.
    The coherence cluster supports created how much cache? cache type is Distributed Cache.
    Cache over-population will affect the performance of the cluster?
    Thank you!

    Do a test, the code is as follows:
    cache code
         public final long removeLike(String regex) {
              long l1 = System.currentTimeMillis();
    long result = 0;
    Set<String> setKeys = nc.keySet(new LikeFilter(new KeyExtractor(), regex + "%", (char)0, false));
    long l2 = System.currentTimeMillis();
    System.out.println("removeLike , execute time :" + (l2 - l1));
    return result;
    public final boolean removeStartWith(String prefix) {
    long l1 = System.currentTimeMillis();
    int i = 0;
    try {
    Set<String> keys = nc.keySet();
    Iterator<String> iter = keys.iterator();
    String v = "";
    while (iter.hasNext()) {
    v = iter.next();
    if (v.startsWith(prefix)) {
    ++i;
    long l2 = System.currentTimeMillis();
    System.out.println("removeStartWith , execute time :" + (l2 - l1));
    return true;
    } catch (Exception e) {
    LOG.error(e.getMessage(), e);
    return false;
    The above 2 methods are computational search KEY time, not to delete operation
    test code
         @BeforeClass
    public static void init() {
    try {
    cache = CacheFactory.getCache("testCache");
    } catch (CacheException e) {
    e.printStackTrace();
    cache.clear();
    for (int i = 0; i < 100000; i++) {
    cache.add("test-" + i,i);
    for (int i = 0; i < 100000; i++) {
    cache.add("hello-" + i,i);
    @Test
    public void testReadByDefaultKey1() {
    cache.removeLike("test");
    @Test
    public void testReadByDefaultKey2() {
    cache.removeStartWith("test");
    The test results show that the:
    removeLike , execute time : 637
    removeStartWith , execute time :125
    Circulating KEY faster than using likeFilter quickly.

  • How to cache jsf page

    how to cache jsf page with submitted data .

    Where do you want to cache it? And with which purposes?

  • Adding storage to 9980 how much cache needed??

    Hello, i'm not sure where to find this answer so i'm asking here we are currently at about 15TB of storage and are planning on adding another 10TB how much cache should be added to the system? I believe the system has 8GB is there a general rule or algorithm to use to determine this?

    The amount of cache is really dependent upon your applications. For example, on a web server, you want to keep the web pages in memory because most of the pages get accessed frequently. You don't want to keep re-reading the same page from disk. For applications that stream video and the video is rarely reused, more cache is not that helpful. However, for 25 TB, 8 GB is on the low side. You should be in the 32 GB range. Also, you might have to increase shared memory for the 2 MB min to 2.5 or 3 MB max depending upon how many luns you create.

  • How the caching mechanism in firefox 3.6 compares to IE 6/7 and IE 8/9

    ''duplicate of https://support.mozilla.com/en-US/questions/902406''
    Sometimes when running web apps it will not work properly on Firefox compared to IE. I tried to look all over the internet for how Firefox handles its cookies and cache (technical) but its non existent. All that comes up is how to delete cache, but as a web app developer knowing how it does these things would be extremely helpful. What are the difference between Firefox 3.6 and IE versions 6/7 and 8/9 that may make it not work?
    Thanks

    First of all, if you haven't applied the two RH patches, I recommend you do as one is critical.
    The cursor to change the width of the TOC is working fine for me in FF. Have you rebooted since spotting the problem?
    I doubt it is project related but also try more than one project.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How to cache out the parse plan up front?

    Hi,
    Basically I have 2 questions:
    (1) When you run a query the first time ,it usually takes longer time because Oracle will parse it to get execution plan first. But afterwards, because of caching , it runs faster. How do I set up so that this step can be skipped when user runs first time?
    In other words, any standard method to get the query execution plan planed out first and cache it in the Oracle.
    (2) Is this cache per session? Can I keep it always in the cache and not cycled out? Also if per session, can I possibly make it per database wise?
    Thanks in advance!
    Acton

    1) Perhaps, perhaps not. There are too many variables that can influence execution time. Usually (not always), the parse phase consumes very little of the reponse time. However, I have seen this phase be the #1 contributor to poor response time. If you trace the query, execute it repeatedly, you will be able to see the differences in response time for each phase using tkprof.
    You can reuse an execution plan if there is an identical statement in the shared_pool (with certain exceptions if cursor_sharing is set or you are using stored outlines). If the statement does not exist in the shared_pool, it must be 'hard' parsed. Let's assume that neither cursor_sharing nor stored outlines are in use. There is NO way to get around parsing, you must parse to get an execution plan.
    Oracle has put a lot of work into making the parse phase efficient. One component of this is how they manage the shared pool. While a large shared pool sounds like you would be able to improve performance by caching all the execution plans, it is usually a bad idea. Let frequently used plans stay in the pool, let one-time or seldom used plans age out. Too many cached statements mean that the session has to search through a lot of 'similar' statements to finally say "Nope, not there, let's parse this statement".
    2) You can always keep something in the cache by pinning it. Again, this is not always a good idea (though there are exceptions). Statements and plans are always cached in the shared pool, which are available to all sessions.
    Justin - did you mean that the first execution runs slower because the data is NOT cached?
    Regards,
    Dan Fink

  • How to cache data from database

    Hi all,
    How can i cache the data from a database, so that i don't have to go to database again and again to get the same results.
    thanks in advance
    gcs

    Well, you can make a structure to match the record layout for your data and put each record in a collection. Search the collection each time before you go out to the database. You may want to overload the contains method or make your own method that checks according to just your key values though.

  • How to cache MANUALLY

    hello
    some o-r mapping tools can cache the objects that have been queried,then next time these objects are required,it don't need to access the database again,it can also monitor the database updating.
    i wonder how i can implement such "cache" function MANUALLY? because i DON'T want to use ANY o-r mapping tools. i only use the jdbc to query database,then generate the object.
    who can give me some clue?? or articles? or sample codes??
    note: i only want to know the BASIC idea of cache,and write a SIMPLE one,not the complex ones..
    thank you!!!!!

    TopLink's provides an integrated cache that has evolved into a specialized ORM cache that provides optimal scalable performance when backed by an underlying data store that ensure ultimate data 'truth' and concurrence protection.
    For what you are asking you would want to look at an independent caching product. Within Oracle's Application Server there is a Java Object Cache that may address your needs or alternatively there are several 3rd party products available on the market.
    Doug

Maybe you are looking for

  • Jsp menu update problem

    Hi All This is my problem. I have a jsp with 1 select menu and 2 text boxes I want it to look like this |Select Menu |\/| code. | Color. | When a name is selected in the select menu I want the code and color to change aswell All the values are in a v

  • How to Group Elements on Slide

    I cannot figure out how to select and group several elements on a slide in Captivate 3. I would swear that I could do this in Captive 2!! Anyone know? Thanks, Pat

  • Problems with transparency/opacity

    I made an opaque rectangular object transparent, at 40. After I later reopened the file, the transparency slider for that object is now at 100, although it is still the lightened/transparent shade. Is there a way to recover the original opaque color?

  • Problem with Advanced settings

    Hello! My Cisco Connect software suddenly stopped working. The router works correctly, however, I can see the router settings but can not change them. Specifically: when I call Router-settings/Advanced settings, it will open in the browser, mostly th

  • BCS / Cartesis / BPC (Outlooksoft)

    Hi all, at the moment there is much blabla about BO and BPC. Actually none can tell information with substance. A good friend of mine told me after an Outlooksoft-training it wouldn't be suitable for consolidation. In fact, the trainer told us that.