4 Replies Latest reply on Feb 24, 2006 1:32 AM by jaikiran

    Getting data from the cache.

    srivathsak

      I am facing a peculiar problem.

      I am putting data into the cache using the method put(Fqn,key,value). Now when i am trying to retrieve the same objects(value) from the cache using get(Fqn,key) , i am getting only the last added object(value) for any of the key.

      Why is this happening?

        • 1. Re: Getting data from the cache.
          brian.stansberry

          So you're saying if you do this:

          cache.put("/X", "A", "A");
          cache.put("/X", "B", "B");
          Object result = cache.get("/X", "A");
          


          You're getting "B" for result?

          • 2. Re: Getting data from the cache.
            srivathsak

            Thanks 4 understanding my problem...
            Yes...exactly what u said is happening....
            How can i overcome this problem....do reply me fast.....

            • 3. Re: Getting data from the cache.
              brian.stansberry

              What JBossCache version?

              The problem you describe is so fundamental that it's hard for me to even imagine what it might be. If you can create a simple test case that demonstrates this and attach it to a new JIRA, I'll take a look. Please make the test case entirely self-contained; I don't want to have to set up a test environment to look at it.

              • 4. Re: Getting data from the cache.
                jaikiran

                Are your keys, that you use in cache, of type String or of some other type. Was just wondering if this has got something to do with the equals method of your key.

                Also,

                cache.put("/X", "yourKey", "A");
                Object previousValue = cache.put("/X", "someOtherKey", "B");


                What does previousValue hold in this case? Is it "A"?