Several key pointing to the same value in the cache?

I would like to do something like
MyObject o = new MyObject();
cache.put("A", o);
cache.put("B", o);
cache.put("C", o);

cache.invoke("A", new RelfectionUpdater("setSomeValue", 1));
cache.invoke("B", new RelfectionUpdater("setSomeValue", 2));
cache.invoke("C", new RelfectionUpdater("setSomeValue", 3));

int x = cache.invoke("A", new ExtractorProcessor("getSomeValue")); 
//x=3
I want this type of behavior, even if I change to another caching strategy. Should I wait?

Thank you
Andrew

Hi Andrew

To answer this question, I think we need to take a step back and understand what is happening when we first put ().
During the option put, the object is serialized into a binary format associated with a key. The key/value then moves to an arbitrary location for storage. A way of thinking that it is that the value is copied from your Java to another memory space space memory local or remote.

Puts subsequent will be associated and copy 'o' to potentially different memory spaces. That the 'o' associated A is not equal to B 'o'.

There are ways to achieve what you want to do, but because of the indirection, it will be very slow. The model is to store the value in a put and use the key as a value in A, B and C.

Thank you
/ Charlie

Tags: Fusion Middleware

Similar Questions

  • Errors with several buttons pointing to the same frame on the timeline. Animate CC

    I have a project where I'm using a function text button to reach a specific image and stop to view, however, if I take a contour of the object and put it on a symbol, I can't have two different objects pointing to the same frame, it generates the error because the frame can be called only by a single button/symbol.

    My solution is to reproduce each of the frames and each have addressed as a new image with the same content.

    Is there a better way to do this?  I'm not fluent Actionscript 3.

    Thank you

    Rick

    You can't have double function names and using the same name/instance for different objects reference is problematic, but you pouvez have different objects "..." pointing at the same time.

    Btn1.addEventListener (MouseEvent.Click, F1);

    btn2.addEventListener (MouseEvent.Click, F1);

    btn3.addEventListener (MouseEvent.Click, F2);

    Function f1(e:MouseEvent):void {}

    this.gotoAndStop (32);

    }

    function f2(e:MouseEvent):void {}

    this.gotoAndStop (32);

    }

  • Several webgates pointing to the entrance of an access door in OAM

    Can we install webgates on several boxes and are pointing to the same OAM access door entry.
    Are there problems with this kind of Setup?
    No position taken?

    You can have different policies if you have different resources such as / Application1 and / Application2 like you mentioned.

    Yours is perfect scenario where an accessgate entry can be used for installations multiple webgate :)

    Hope this helps,
    Sagar

  • Point empty the Cache after submit press

    Hello

    I have 5 element on a page as
    P1_A,
    P1_B,
    P1_C,
    P1_D,
    P1_E.

    I want to here when I press the "submit" button value of P1_A, P1_B, P1_C, P1_D, P1_E must be inserted in table and clear Cache last item P1_C, P1_D, P1_E
    and the value of the point P1_A, P1_B do not have to clear the Cache.

    How can I clear the Cache of the selected item.

    Thank you
    Ed

    Max clear selected element on press the button submit

    Maury

    Create a Page State in Session process to clear items. Make sure that the process is running after your insert.

    Clear Cache items (POINT, POINT, POINT) by entering a list delimited by names of elements to erase. Use a comma (,) or a colon (:)) to separate the element names.

    Example (: P1_C,: P1_D,: P1_E)

    Jeff

  • Corresponding to several access points in Adobe Captivate 6

    Find the difference in the two images is the main issue here.

    A photo on the left and the other right. User has to hit a hotspot on each image to find identical items... like spoting the different parts of two photos...

    Every time right hotspot is clicked then he gets surrounded and if the user can click on the two hot spots, they get a 'correct' Message is displayed in a box or no matter how correct picture I want to show (could be lined up pointing to the two botspots)

    I looked for it everywhere on the web, but really can't find anythign for the last 7 days,

    Ok.  I see what you're trying to do.

    So I think the best idea is to build this interaction on a normal blade using interactive objects such as boxes to click for the hotspots and you also need to use some variables and some conditional shares advanced as well. Conditional Actions going forward will be quite similar and are triggered by clicking on one click boxing.

    You will need at least two areas of click.  One for each of the key points in the answer.  You will need to create a couple of user to follow or not each box click click variables is performed (for example, var_ClickBox1, var_ClickBox2).  These variables will have an initial value of 0 and a value of 1 is assigned (as mentioned below) If you click on the click box.

    Each Action of Advanced Conditiional will need an initial clause that defines the value of the variable that follows click box status. The first condition statement looks like this:

    IF var_ClickBox1 equals 0

    Assign the var_ClickBox1 with 1

    The following clause in the Action of Advanced conditional checks if the value of the other variable of the click box indicates that it has already been clicked so and if he finds the two variables set to 1 then it will execute statements to SHOW the hidden picture that points to inconsistencies in the identification. If only a click box variable is set to 1, this clause SHOW is never executed.

    IF var_ClickBox1 is equal to 1 AND var_ClickBox2 is equal to 1

    See THE correctAnswerImage (or whatever you call his name of the item)

    Other advanced conditional Action is more or less similar to this, but of course it's the first statement sets the variable var_ClickBox2 to 1.  The second statement is the same.  So once you have done one of these actions, you can just copy it, rename, and change the first statement to assign the other variable var_ClickBox.

    If you've never played with advanced Actions and variables or conditional stocks advanced, then this might be a little overkill for your abilities.  But believe me, it is advisable to learn this stuff!

  • Problem in creating several attributes XML with the same name of the attribute

    I am trying without success trying to create several attributes XML with the same name, as shown here in a Microsoft example configuration file:



      
         
         
         
      

    I'm calling the NewDocument GetRootElement functions and then "newelement" (appSetting), "newelement" (add)

    Then I call AddAttribute with add, key & Key0, then with add, value & 0.  This seems to work fine but when I try to add the second pair of key & Key1 and value attributes & 1 for item "Add" replaces ""and I find myself with"" only.

    I do something wrong or CVI is not able to create an XML of this type?

    Thank you

    Here's how you do it. I show not to keep things simple error checking.

    #include

    public static void CreateAddElement (mother of CVIXMLElement, const char * key, const char * value)
    {
    Add the CVIXMLElement;
    CVIXMLNewElement (parent, -1, 'Add', &add);)
    CVIXMLAddAttribute (add, "touch", key);
    CVIXMLAddAttribute (add, "value", value);
    CVIXMLDiscardElement (add);
    }

    void main (void)
    {
    CVIXMLElement root, and appSetting;
    Doc CVIXMLDocument.
     
    CVIXMLNewDocument ("configuration", &doc);)
    CVIXMLGetRootElement(doc, &root);)
    CVIXMLNewElement (root,-1, "appSetting", and appSetting);
    CreateAddElement (appSetting, "Key0", "0");
    CreateAddElement (appSetting, "Key1", "1");
    CreateAddElement (appSetting, "Key2", "2");
    CVIXMLDiscardElement (appSetting);
    CVIXMLDiscardElement (root);
    CVIXMLSaveDocument (doc, 1, "c:\\temp\\temp.xml");
    CVIXMLDiscardDocument (doc);
    }

  • same function brings a different number of points in the various calls?

    I use an automated test program, tests of mobile pistons. The test will extend the plunger and collect data of position through a few pots and the current data when moving. He will then go to the piston, and make the same data collection. Then, he makes other tests. The data are written in files and are then retrieved for after the treatment trials later.

    I use the same function for the extension and retraction, and I notice that the number of points of data collected during the measurement is always much less than the number of points collected during September.

    It's the 3rd version of function, I used to collect the data of the test apparatus, and this question has stuck with all 3 versions. I joined the service in this post. First level VI is large and contains several screws at a lower level, so I can't understand all of this. I use a USB-6008, LV8.5 Daqmx 8.5.

    Any ideas why this would be different each call?

    Explanation of the function:

    The shaded area VI with 'NOR' is a Subvi, which communicates with a controller for the tester. He sends the position to move the piston. In the loop, the daq assistant grabs data from the 6008 and examines the values of pot. If the values are close enough together, several times, it stops the loop and data collection (the piston has reached the end of its run). After the loop of data collection, the rest of the service is to write data to a file.

    NOTE that only the case 'true' inside the while loop questions here, because that is where the rub.

    PS. Sorry the front looks like crap, because it's a Subvi to its façade has ever seen.

    -SK-

    I think that the culprit is the DAQ Assistant.   I suspect that the first time you call the DAQ Assistant (this will always be in the course of an extension) it takes some amount of time to get the task configured and started.  As the piston is already running, you then have less time to take samples.   When you make the withdrawal, the task is already loaded into memory and can begin to collect samples immediately.  You should get your task daqmx Installer and started outside the while loop before starting to move the piston.

  • AF:inputListOfValues sets the value of the first item in the result set when using enter key or tab and component value autosubmit = true

    I use JDev 11.1.1.6 and when I type in a value in an af:inputListOfValues element and press enter or the tab key, it will replace the value I entered with the first element in the set of results LOV. If enter a value, simply click on the component af:inputListOfValues it works correctly. If I use the popup and find a value it works properly as well. I have a programmatic view object that contains a single transitional attribute (this is the view object that is used to create the list of the components of the value of) and then I have another object from view based on entities which defines one of its attributes in a list of the attribute value. I tried to use a base object view of entity to create the LOV to and everything works as expected, so I don't know if this is a bug when using programmatic view objects or if I need more code in the VOImpl. In addition, it seems after that first of the value being replaced by the first value in the result set that it will work correctly as well. Here are some excerpts of important code.

    Also, it seems that this does not work only if the text entered in the component af:inputListOfValues would have only a single game, returned in the result set. For example, given the result defined in code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy

    If we get into Cha, the component works as expected

    If we register A, the component works as expected

    If we get Jimmy, the component does not work as expected, and returns the first value of results IE. Brad

    If we get Fred, the component does not work as expected, and returns the first value of results IE. Brad

    I also checked that I get the same behavior in JDev 11.1.1.7

    UsersVOImpl (programmatic view with 1 transitional attribute object)

    import java.sql.ResultSet;
    
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    
    import oracle.adf.share.logging.ADFLogger;
    
    import oracle.jbo.JboException;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    
    // ---------------------------------------------------------------------
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Wed Sep 18 15:59:44 CDT 2013
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    // ---------------------------------------------------------------------
    
    public class UsersVOImpl extends ViewObjectImpl {
    
        private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
        private long hitCount = 0;
    
        /**
         * This is the default constructor (do not remove).
         */
        public UsersVOImpl () {
        }
    
        /**
         * executeQueryForCollection - overridden for custom java data source support.
         */
        protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {
    
             List<String> usersList = new ArrayList<String>();
             usersList.add("Brad");
             usersList.add("Adam");
             usersList.add("Aaron");
             usersList.add("Fred");
             usersList.add("Charles");
             usersList.add("Charlie");
             usersList.add("Jimmy");
    
             Iterator usersIterator = usersList.iterator();
             setUserDataForCollection(qc, usersIterator);
             hitCount = usersList.size();
             super.executeQueryForCollection(qc, params, noUserParams);
    
        } // end executeQueryForCollection
    
        /**
         * hasNextForCollection - overridden for custom java data source support.
         */
        protected boolean hasNextForCollection (Object qc) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             if (usersListIterator.hasNext()) {
         
                 return true;
    
             } else {
    
                 setFetchCompleteForCollection(qc, true);
                 return false;
    
             } // end if
    
        } // end hasNextForCollection
    
        /**
         * createRowFromResultSet - overridden for custom java data source support.
         */
        protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             String user = (String)usersListIterator.next();
             ViewRowImpl viewRowImpl = createNewRowForCollection(qc);
    
             try {
    
                 populateAttributeForRow(viewRowImpl, 0, user.toString());
    
             } catch (Exception e) {
    
                 LOGGER.severe("Error Initializing Data", e);
                 throw new JboException(e);
    
             } // end try/catch
    
             return viewRowImpl;
    
        } // end createRowFromResultSet
    
        /**
         * getQueryHitCount - overridden for custom java data source support.
         */
        public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
             return hitCount;
        } // end getQueryHitCount
    
        @Override
        protected void create () {
    
             getViewDef().setQuery(null);
             getViewDef().setSelectClause(null);
             setQuery(null);
    
        } // end create
    
        @Override
        protected void releaseUserDataForCollection (Object qc, Object rs) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             usersListIterator = null;
             super.releaseUserDataForCollection(qc, rs);
    
        } // end releaseUserDataForCollection
    
    } // end class
    
    

    <af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
                                                  label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
                                                  columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
                                                  searchDesc="#{bindings.UserName.hints.tooltip}"                                           
                                                  simple="true">
                              <f:validator binding="#{bindings.UserName.validator}"/>                       
    </af:inputListOfValues>
    
    
    
    

    I found a solution to this problem. It seems that, when using a view object programmatic that has a transient as its primary key attribute, you need to override the methods in the ViewObjectImpl so that he knows how to locate the line related to the primary key when the view object records are not in the cache. That's why it would work properly sometimes, but not always. Here are the additional methods that you must override. The logic you use in the retrieveByKey would be on a view view object database object and would be different if you had a primary key consisting of multiple attributes.

    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
        return retrieveByKey(viewRowSetImpl, null, key, i, false);
    }
    
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {
    
        RowSetIterator usersRowSetIterator = this.createRowSet(null);
        Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
        usersRowSetIterator.closeRowSetIterator();
        return userRows;
    
    }
    
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
        return retrieveByKey(viewRowSetImpl, null, key, i, b);
    }
    
  • Satellite P300-156 - and the button Return give the same values

    Hello

    I have a satellite P300-156, and it has a numeric keypad.
    I have problems because the Enter key and the Return key give the same values. I believe that it is incorrect.
    Can anyone help.

    Key on the numeric keypad should give an input it does.
    the Enter key on the main keyboard should give a carriage return value, but it gives an input value.

    Usually this does not cause a problem, but with software like photo shop that makes the distinction between a carriage return and a hard fall it does not work.

    Can someone help me please

    Thank you

    Hello

    To my eyes the entry and return keys are the same keys that provides the same functionality.
    I really put t know why you believe that there is something not right

    By the way; Check if you are using the latest version of the BIOS!

  • WiFi HP ENVY 4500 with several Access Points - same SSIS Configuration

    Hello

    We just got a HP ENVY 4500.  I have a main homenetwork with a wifi Modem/Router and an old router acting as an Access Point to the floor to extend coverage.

    Both have the same SSID and password and are set to different channels.

    My HP ENVY 4500 fails to connect when the Access Point is lit.

    It will connect with it.

    Once connected, I can turn on the PA and all is well.

    The two router an AP using WPA-PSK/WPA2-PSK encriptación

    The router (that it connects to) should have a better sgnal when both are on, so I do not understand why they need the AP to be turned off to connect.

    Any thoughts people?

    Eserim

    I think he has always had problems with several access points.  Try this, what ever AP is closest to the printer, set it to channel 1.  Then try channel 11.  Try now.

  • Satellite P100-188: type the question - forgotten key & pointer jump

    Hello

    Bought my p100-188 week last to replace my toshiba PIII 2.66. After a week I noticed that when typing unless I press really hard that it does not record the keys. Also
    the mouse pointer when it moves around the screen tends to move momentarily on a point, then jump past.

    All thought is appreciated.

    Hello

    I recommend you this announcement:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=14317

    Check it out. It describes a similar or the same question. It should help.
    In addition, you should compare the version of the BIOS on the laptop with the version of the BIOS on Toshiba page. If there is a newer version so you can update. But be sure you use the good BIOS and the right update procedure.

  • No idea: sudden failure of several keys on the wireless keyboard

    Hello, I use a wireless keyboard HP, M/N on the back said SK-2060, but this site does not recognize as a model number, so I'm not entirely sure what keyboard model number it is.

    The keyboard has been working well for months, more than a year by this question, I think. Just this morning several key of all isn't on me at the same time, and they are all in the same area. O, 9, f7, and f8 keys are not admissible. I have read some things and thought it might be a driver problem, I uninstalled the drivers for my keyboard and the keyboard no longer works, I re-plugged my wireless adapter and it re-installed the drivers and the keyboard is working again. All the broken keys still don't work.

    I don't think it's a hardware problem, none of the buttons seem as if something is stuck sub, or obstructed in any way. All of them worked very well last night, now they have suddenly stopped and they are all in the same general area of the keyboard.

    I was wondering if someone could help understand me what went wrong, or how I might be able to fix it.

    I have a new keyboard for the moment, but it is not as comfortable as the keyboard HP that I use, and I would be able to fix it if I could.

    Thanks for your time, read this

    Troaves

    Sorry, but HP does not have much info on your keyboard: http://support.hp.com/us-en/product/HP-Wireless-C7000-Desktop/5197687/model/5197688

    Here are a few troubleshooting steps you can try: HP PC - keyboard and wireless mouse troubleshooting | HP® customer support

    Good luck

  • Blank composition - several active triggers at the same time?

    I am trying to create a magazine layout Builder. In doing so, I have several PNG files in a blank publication.  I put it right now so that whenever you click on a trigger target Exchange with a different design element.  However, the point of my Configurator is to show how the different elements together, look what means that I have several active triggers at the same time in order to see how to watch them together.  Is there a way to do this?

    I don't think this is a feature that is available in the widget of blank publication provided by muse - there may be an external widget that can do the trick. However, if you want to try to work around him with the blank publication widget, I used this workaround solution myself:

    1. In one layer, make a widget of composition with the single trigger
    2. With layer a locked switch to two layer and do another composition directly on your first widget
    3. Be sure to check "hide target: with click" and "hide all initially" to the two widgets

    See the video provided:

    Dropbox - CompositionDemo.mov

    Hope this helps, or you find a widget on a third party site that allows you to complete your layout.

  • How to use several different sections of the same clip in the timeline?

    Hey, I used this tutorial as a reference for editing. I have my own equipment I want change, which includes several takes different. Is it possible to use several different sections of the same clip in the timeline? You know, like the good part of a certain record keeping. I appreciate any assistance. Thank you

    Post edited by: Kevin Monahan

    Reason: changed the title of best research opportunities

    I prefer to put the clip in the Source monitor Panel, then set the points and exit. From there you can simply drag the section of the element in the sequence.

    Or, you can make a subelement, the section will have a distinct element in the bins in the project Panel. You should always keep the original material, but now you can have real subitems to work if you prefer.

  • Question about several popular vm with the same kernel version

    So, I have been informed that ESX is smart enough for to run several virtual machines with the exact same kernel that it loads only one instance of the kernel in memory for all of them so that it saves space in RAM. This seems quite remarkable to me, and I'd like to see if VMWare has any white papers or other documents on this. I'd like to believe it's true, but it seems incredible to believe.

    Is this really how ESX functions? If I have 10 XP SP3 machines with the same level and exact same version of the kernel patch, VMWware won't really load only one instance of the core XP in RAM to separate the 10 machines? If he does that, how handles when 10 machines all want access to the same statement in kernel mode at the same time separate?

    Welcoem to the Forums - ESX will actually 10 instances of the core of the customer even if they are the same OS - but once loaded using Transparent Page Sharing the vmkernel (the o/s of the ESX Server) can recognize identical pages and store them a time-read only memory - if the virtual machine tries to write to that page a copy and writing is done - if this new page is another page in memory that one instance is maintained. This saves a TON of memory-

    If you find this or any other answer useful please consider awarding points marking the answer correct or useful

Maybe you are looking for