How to build cache mechanism

Hello all
i have application that basically loading very big object that contains sub objects and
doing dynamic lookup by name of the object and the method i like to invoke and then invoke it
everything done ofcorce with reflection .
now this application will be called handeret times per minute .
some questions .
first of all do i need caching mechanism? for saving the subobject that had bean called in some kind of vector in memory for example or if i use reflection , i dont need caching mechanism .
second question is do i need threads here ? if i do , how i buid some kind of locks to this threads ?
thanks

I'd use the Flyweight pattern here. It sounds like you're retrieving a lot of data that's related to other data through some kind of index. A Data Transfer Object (DTO) is a Flyweight class that could hold all of the information required to retrieve the "sub-objects" as you call them, but not until they're needed. It's a little more detailed to make sure that the objects are available when you need them, but obviously the network bandwidth/latency issues are causing a severe performance impact. I'm using EJBs in this example, but it will apply to anything where large amounts of related data are used in the application.
// EJB Entity bean
public abstract class EJBEntity extends EJBObject {
    public abstract Integer getId();
    public abstract String getStringData();
    public abstract Collection getChildObjects(); // "heavyweight" data
// Data Transfer Object
public class EJBEntityDTO {
   private int id;
   private String stringData;
   private int[] childIds;
// some application code
id = ...
EJBEntityDTO dto = transferEJBData(id);
EJBEntityDTO childDTO = transferEJBData(dto.childIds[0]);
...It's definitely more work to do it this way, but it's the only way to avoid fetching the entire collection when you only need one child object.
Brian

Similar Messages

  • 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

  • What is the caching mechanism firefox 3.6 uses compared to what IE 6/7 and 8/9 use?

    I just need to know how firefox handles/takes care of/and does its work with cookies and cache, basically its caching mechanism. Also comparing it to IE versions 6/7 and 8/9 would help, for the sake of web development with respect to the two browsers (Detailed technical answer would help). Since web apps may sometimes work on firefox and sometimes not while it works in IE just fine.

    Hi Kellymarr,
    You can take a look at the release notes for each version to see what has been added or fixed:
    http://www.mozilla.org/en-US/firefox/4.0/releasenotes/
    Just change the version number in the url to see each major release.
    Hopefully this helps!

  • I want to know the caching mechanism of Firefox

    Hi everyone,
    i want to know how exactly caching mechanism works in firefox? I know for the cached objects we have two info
    Expire date or Max-age, how we use them while deciding if the object should be served from cache or not

    You neither described the problem you actually had nor the version you had. There may be other solutions such as described in the following answer which also tells you how to go back to to any version
    https://support.mozilla.com/questions/840344
    You can make Firefox 4.0.1 and '''Firefox 5.0''' look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • JNDI as a caching mechanism

    Hi,
    We are building an application using stateless session beans to access some
    back end systems. The backend transaction is rather expensive with regards
    to execute time. To optimize response times we are looking at a caching
    strategy, we have identfied the following implementation alternatives :
    1. Create object cache implementations as statefull session beans, storing a
    reference to them in JNDI.
    2. Create object cache implementations as regular java objects and storing
    the entire object in JNDI.
    Which one of these alternatives we choose will rely on the performance of
    the WL JNDI, we are using the 5.1 server. If WL JNDI is capable of handling
    reasonable amounts of data there should be no reason to use the expensive
    statefull session beans.
    Q1 : Are there any method to calculate the amount and troughput of data that
    would be possible using alternative 2 ?
    Q2 : Are there any other mechanism we should consider ?
    Any help would be greatly appreciated
    Regards,
    Anders Mathisen

    Read-Only entity beans are the entity beans which never call ejbStore() and
    ejbLoad() is only called when timeout is expired (or never).
    If you want to cache data for the session only you can use HttpSession - in
    the cluster all requests are pinned to the server which originated the session
    until this server fails. To minimize replication overhead you can use transient
    fields or use the fact that replication happens only when session attribute is
    set() - you can associate a cache object with the session and lazy populate it
    later.
    Anders Mathisen <[email protected]> wrote:
    hi,
    thanks for the response, what do you mean by read-only entity beans ?
    Beans that are loaded with data manually (from eg. a stateless session
    bean), and just used as a dataholder ?
    I forgot to mention in the previous article that the caching mechanism here
    needs only be local to a single users session. That is a session will never
    use cached data from another session.
    Althoug even if we have the requirement above, some caching mechanism
    allowing for sharing of data could be handy here, this is not an absolute
    requirement.
    Anders M.
    Rob Woollen <[email protected]> skrev i
    meldingsnyheter:[email protected]...
    Stateful session beans should not normally be used as a cache. A
    stateful session bean instance is associated with a single user.
    I wouldn't use JNDI as a caching mechanism either.
    My suggestion would be Read-Only entity beans.
    -- Rob
    Anders Mathisen wrote:
    Hi,
    We are building an application using stateless session beans to access
    some
    back end systems. The backend transaction is rather expensive withregards
    to execute time. To optimize response times we are looking at a caching
    strategy, we have identfied the following implementation alternatives :
    1. Create object cache implementations as statefull session beans,storing a
    reference to them in JNDI.
    2. Create object cache implementations as regular java objects andstoring
    the entire object in JNDI.
    Which one of these alternatives we choose will rely on the performanceof
    the WL JNDI, we are using the 5.1 server. If WL JNDI is capable ofhandling
    reasonable amounts of data there should be no reason to use theexpensive
    statefull session beans.
    Q1 : Are there any method to calculate the amount and troughput of datathat
    would be possible using alternative 2 ?
    Q2 : Are there any other mechanism we should consider ?
    Any help would be greatly appreciated
    Regards,
    Anders Mathisen--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com
    Dimitri

  • Caching mechanism in OBPM

    HI ,
    Does OBPM have any caching mechanism(build in API) to store data .I have some data to be used in one of the process.I can't not connect to the external DB because my OBPM don't have a direct connection to external DB.Only way is queue.Every Time I can't post request in queue to get this data.
    Please help me
    Thanks
    Sailendra

    Hi Sailendra,
    In this case you can make use of BPM object if I understood your question correctly.
    In the component Cataloge make a BPM object and under that create attribute/attributes/array. Then the value you want to save/store keep it in a bpm object attribue and pass the bpm object from one process layer to another/as per your requirement. ex: bpmobject.attribute1Name = "Bibhu";
    You can acccess those values in another process/activities by bpmobject.attributeName
    bpmobject is the object that you created and the instance variable is of type created bpmobject.
    attributeName is the attribute where you stored the value.
    Regards
    Bibhu

  • E52 Contacts search - Building cache

    I've recently upgraded my E52 to the latest firmware 031.012 and now the Contacts search function no longer works, every time I press a key to search the address book I get the message "Building cache. Search will be available in a moment", which it never is!
    Any ideas how to resolve this?

    Can't see contacts on phone memory,but when somebody from contact list call me,his name shows on the screen.. Contact search don't work.When i look Phone memory it shows contacts memory 245kb,but where are they???? How can i save them from loosing..Synchronizing them with PC don't work too..Before few days i just synchronize emails with phone,maybe that is a bug in Nokia E52???
    i save new contact in phone memory, it seams ok, but when I try to find them there's nothing..
    Phone popup:
    Building cache. search will be able in moment,
    and then i just can see contacts from sim card..Nothing from phone memory..
    I just updated softver,and i have same problem.. "Building cache" and then no contacs.... i also did a reset of phone..nothing help..
    Thank You for Your fast answering..
    sincerely,

  • How to import cache from Chrome into Mozilla FireFox?

    How to import cache from Chrome into Mozilla FireFox?

    Not something that anyone usually attempts. If you use Firefox it builds up its own cache. I am not even sure Chrome uses the sametypeof cache files. Are there particular problems you are trying to solve ?

  • Adaptive Processing Server : how to manage caching ?

    Dear all,
    The Adapative Processing Server has a caching mechanism for for example Multi Dimensional Analysis Service (MDAS) and Analysis Application Service (Design Studio).
    How does this mechanism work ? Is there a way to preload this cache ? How long is a record set kept in cache ? Can you manage that duration ?
    Is increasing the heap size a good way to optimize caching ?
    Many thanks for sharing your ideas,
    Hans

    Hi Hans,
    Please look at these ASUG slides, starting at slide 17
    http://events.asug.com/2012BOUC/0807_Analysis_Edition_for_OLAP_Deep_Dive.pdf
    Since you are an SAP employee you could also reach out to SAP's Ian McAlpine, who wrote these slides.
    Tammy

  • Decument about buffer cache mechanism

    hi gurus
    I want some documentations about the buffer cache internal mechanism,for example the internal structure of the buffer cache,how does the buffer cache works and the LRU mechanism.The more detailed the better.
    I have searched on Oracle Documentation Linrary with buffer head or buffer descriptor as keywords.I did not get what i want.
    many thanks in advance.

    Hi Kevin,
    I believe information which you are looking is not published by Oracle and is avaialable only to Oracle Support and other employees. You can refer to Note:62172.1 for buffer cache mechanism. It mentioned about a note with "@" in beginning meaning the remark was supposed to be unpublished.
    "@ See Note 104937.1 for a description "
    May be the above note has got some description. Anyways I will suggest you to go through the Note:62172.1 and get basic understanding which should be sufficient for dba's.
    Cheers
    Amit

  • How to build a Oracle style Web site

    Dear All,
    (Not sure whether this question should be this sub-site or not.)
    My question is how to build a Oracle style Web site, what technology should be use.
    Example Site: [http://www.orapub.net/ebs/index.htm|http://www.orapub.net/ebs/index.htm]
    This web site style is like Oracle Enterprise Manager.
    Thanks a lot
    Pan

    You can use Oracle Webcenter or just Oracle ADF to build a Oracle Enterprise Manager kind of Website.
    See details here -
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm
    http://www.youtube.com/watch?v=iE2zTNhlvy8

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

  • I have just started to use Muse for our design agency and learning how to build ourselves a new site, I have manged to create a basic lightbox which contains sliding images, what I need to do now is have a pop up window which goes into detail about the pr

    I have just started to use Muse for our design agency and learning how to build ourselves a new site, I have managed to create a basic lightbox which contains sliding images, what I need to do now is have a pop up window which goes into detail about the projects, what I would like is a piece of text  or icon that when you roll over it and then click a separate window pops up with additional information in, once finished reading the info you can then click to close the box, any advice on how to do this?

    The best way to do what you're asking is with the Composition widget. Start with the Tooltip preset, which, by default shows the info on rollover. You can change the option to show on click, which is what you're after. You can also add the close button or have the info disappear on rollout.
    David

  • How to build the  FM data I_header and I_orgdata

    hi all,
    I’m working on the conversion program for AVL using the following function modules
    BBP_PD_AVL_GETLIST
    BBP_PD_AVL_CREATE
    BBP_PD_AVL_UPDATE
    BBP_PD_AVL_SAVE
    In the function module BBP_PD_AVL_CREATE , how to build the FM data  I_HEADER and I_ORGDATA.
    I'm giving 3 input in Export parameter in BBP_PD_AVL_GETLIST  and E_pdlist should contain data .
    but e_pdlist is not getting data...any suggestion..
    after execution it was showing  "Buffer table is not up to date"
    with regards,
    P.lokesh

    Hi Lokesh,
    We are also encountering same problem.
    How did you solve your problem?
    Would really appreciate your help.
    Thanks,
    Kezia

  • How to build a search engine in the database?

    Hi there,
    say I have 3 tables:
    1. Table_empl: idEmpl, fname, lname, dob...
    2. table_department: idDpartment, idEmpl, departmentName, section...
    3. table_fligths: idFlight, idEmapl, departure date, destination, carrier...I would like to provide the end-user a text box (in my GUI) where he can write whatever he would like to get info about. If, for example, he'll write: british-airways, I expect the system to search everything in the db that matches this input.
    Question: How can I design such a search engine that retrieve information from every possible table in the db with reference to every column.
    thanks for any pointers

    thanks darted for your reply. so what do you recommend? should i give the end user all names of tables and columns and ask him to choose from the list and than build a query based on that?
    this is optional but i'd rather have one exec button and to return all possible results from the db. if (in the example i provided) it found 'british airways' in the carrier - than that a result. if it founds 'british' in the lname of table_emple - that's another result. so the output should be something like:
    found 2 matches:
    1. british airways, 10/10/2006, LHR
    2. British, John, 12/01/63,
    any idea how to build that?

Maybe you are looking for

  • How do you get a jump drive to work on MacBook pro?

    I have a new MacBook pro and I am trying to access work from a jump drive and my computer is not recognizing the drive. Can someone tell me if I'm doing something wrong or how to fix it? Thanks!

  • How to change the text mail of Workflow Notification?

    Hi all, I would like to change the text mail of workflow notification. I took a look at the Help Sap and saw how to customize the text mail notification. Unfortunately, I could not found the text for workflow Notification at “notificationTexts_<langu

  • RE: (forte-users) Optimal number of records to fetch fromForte Cursor

    Guys, The behavior (1 fetch of 20000 vs 2 fetches of 10000 each) may also be DBMS related. There is potentially high overhead in opening a cursor and initially fetching the result table. I know this covers a great deal DBMS technology territory here

  • Image Processor : error 325

    Hello, I am trying to make an image processor but a dialog box appears with the following error code 325 What is it and what can I do to make my image processor. Thank you in advance

  • Syncing-Changed Email on itunes account

    I changed the email account on my itunes. But my iphone still has the old email address as my sign in to itunes. So now I am rejected every time I try to sign in to itunes on my iphone. How can the itunes id on my iphone?