How to get Pivotal Cloud Cache idle timeout to reset on access





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















We are trying to set up cache expiration in Pivotal Cloud Cache, using Gemfire. We have set up our region in PCF:



Cluster-0 gfsh>describe region --name=/CartTest
Type | Name | Value
------ | ----------------------- | ---------
Region | data-policy | PARTITION
| entry-idle-time.timeout | 60
| size | 0
| statistics-enabled | true
| entry-idle-time.action | DESTROY


When we create our Cart object, it is written to the cache (we can
see it in the size entry above).



If we access our object from our code, it does not seem to be updating the access time for the entry. For instance:

@11:00:00 - create entry

@11:00:30 - access entry

@11:01:00 - entry is gone



I would have expected the entry to still exist until 11:01:30 (I'm using ridiculously short timeouts just for testing). The idle time almost seems to be acting just like Time-To-Live. When we look at the lastAccessTime for the region using gfsh, it is not being updated.



Any idea what I'm doing wrong here?










share|improve this question































    0















    We are trying to set up cache expiration in Pivotal Cloud Cache, using Gemfire. We have set up our region in PCF:



    Cluster-0 gfsh>describe region --name=/CartTest
    Type | Name | Value
    ------ | ----------------------- | ---------
    Region | data-policy | PARTITION
    | entry-idle-time.timeout | 60
    | size | 0
    | statistics-enabled | true
    | entry-idle-time.action | DESTROY


    When we create our Cart object, it is written to the cache (we can
    see it in the size entry above).



    If we access our object from our code, it does not seem to be updating the access time for the entry. For instance:

    @11:00:00 - create entry

    @11:00:30 - access entry

    @11:01:00 - entry is gone



    I would have expected the entry to still exist until 11:01:30 (I'm using ridiculously short timeouts just for testing). The idle time almost seems to be acting just like Time-To-Live. When we look at the lastAccessTime for the region using gfsh, it is not being updated.



    Any idea what I'm doing wrong here?










    share|improve this question



























      0












      0








      0


      1






      We are trying to set up cache expiration in Pivotal Cloud Cache, using Gemfire. We have set up our region in PCF:



      Cluster-0 gfsh>describe region --name=/CartTest
      Type | Name | Value
      ------ | ----------------------- | ---------
      Region | data-policy | PARTITION
      | entry-idle-time.timeout | 60
      | size | 0
      | statistics-enabled | true
      | entry-idle-time.action | DESTROY


      When we create our Cart object, it is written to the cache (we can
      see it in the size entry above).



      If we access our object from our code, it does not seem to be updating the access time for the entry. For instance:

      @11:00:00 - create entry

      @11:00:30 - access entry

      @11:01:00 - entry is gone



      I would have expected the entry to still exist until 11:01:30 (I'm using ridiculously short timeouts just for testing). The idle time almost seems to be acting just like Time-To-Live. When we look at the lastAccessTime for the region using gfsh, it is not being updated.



      Any idea what I'm doing wrong here?










      share|improve this question
















      We are trying to set up cache expiration in Pivotal Cloud Cache, using Gemfire. We have set up our region in PCF:



      Cluster-0 gfsh>describe region --name=/CartTest
      Type | Name | Value
      ------ | ----------------------- | ---------
      Region | data-policy | PARTITION
      | entry-idle-time.timeout | 60
      | size | 0
      | statistics-enabled | true
      | entry-idle-time.action | DESTROY


      When we create our Cart object, it is written to the cache (we can
      see it in the size entry above).



      If we access our object from our code, it does not seem to be updating the access time for the entry. For instance:

      @11:00:00 - create entry

      @11:00:30 - access entry

      @11:01:00 - entry is gone



      I would have expected the entry to still exist until 11:01:30 (I'm using ridiculously short timeouts just for testing). The idle time almost seems to be acting just like Time-To-Live. When we look at the lastAccessTime for the region using gfsh, it is not being updated.



      Any idea what I'm doing wrong here?







      caching pivotal-cloud-foundry gemfire






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 4 at 16:56







      Westy

















      asked Jan 4 at 15:47









      WestyWesty

      63




      63
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Few things to verify.




          • Can you please share code showing how you store data in PCC regions ?

          • Is the region name correct ? Since you are using region CarTest in gfsh your @Region annotation (assuming you are using spring-data-gemfire on the client side) should also be using CarTest region name.


          Easy way to put data using SDG (spring-data-gemfire) is via Spring Data Repository abstraction.



          Please refer sample application here. Specifically domain class can be created like here and repository can be created like here






          share|improve this answer
























          • Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

            – Westy
            Jan 4 at 20:07



















          0














          CORRECTION: The reason the lastAccessedTime was not being updated was because we were not getting the entry via the ID field, we were searching on two other fields in the object. When we took those two fields and created a composite key, and made it the @Id field, then the time was updated when we retrieved the object.



          With partitioned Gemfire regions, any access to a secondary partition does not update the lastAccessedTime of the primary. So this won't do what we want, we'll need to add some code.






          share|improve this answer


























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042141%2fhow-to-get-pivotal-cloud-cache-idle-timeout-to-reset-on-access%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Few things to verify.




            • Can you please share code showing how you store data in PCC regions ?

            • Is the region name correct ? Since you are using region CarTest in gfsh your @Region annotation (assuming you are using spring-data-gemfire on the client side) should also be using CarTest region name.


            Easy way to put data using SDG (spring-data-gemfire) is via Spring Data Repository abstraction.



            Please refer sample application here. Specifically domain class can be created like here and repository can be created like here






            share|improve this answer
























            • Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

              – Westy
              Jan 4 at 20:07
















            0














            Few things to verify.




            • Can you please share code showing how you store data in PCC regions ?

            • Is the region name correct ? Since you are using region CarTest in gfsh your @Region annotation (assuming you are using spring-data-gemfire on the client side) should also be using CarTest region name.


            Easy way to put data using SDG (spring-data-gemfire) is via Spring Data Repository abstraction.



            Please refer sample application here. Specifically domain class can be created like here and repository can be created like here






            share|improve this answer
























            • Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

              – Westy
              Jan 4 at 20:07














            0












            0








            0







            Few things to verify.




            • Can you please share code showing how you store data in PCC regions ?

            • Is the region name correct ? Since you are using region CarTest in gfsh your @Region annotation (assuming you are using spring-data-gemfire on the client side) should also be using CarTest region name.


            Easy way to put data using SDG (spring-data-gemfire) is via Spring Data Repository abstraction.



            Please refer sample application here. Specifically domain class can be created like here and repository can be created like here






            share|improve this answer













            Few things to verify.




            • Can you please share code showing how you store data in PCC regions ?

            • Is the region name correct ? Since you are using region CarTest in gfsh your @Region annotation (assuming you are using spring-data-gemfire on the client side) should also be using CarTest region name.


            Easy way to put data using SDG (spring-data-gemfire) is via Spring Data Repository abstraction.



            Please refer sample application here. Specifically domain class can be created like here and repository can be created like here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 4 at 19:59









            srikanthsrikanth

            6071610




            6071610













            • Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

              – Westy
              Jan 4 at 20:07



















            • Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

              – Westy
              Jan 4 at 20:07

















            Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

            – Westy
            Jan 4 at 20:07





            Thanks. I created a Gist here: gist.github.com/dlwester-0510862/…

            – Westy
            Jan 4 at 20:07













            0














            CORRECTION: The reason the lastAccessedTime was not being updated was because we were not getting the entry via the ID field, we were searching on two other fields in the object. When we took those two fields and created a composite key, and made it the @Id field, then the time was updated when we retrieved the object.



            With partitioned Gemfire regions, any access to a secondary partition does not update the lastAccessedTime of the primary. So this won't do what we want, we'll need to add some code.






            share|improve this answer






























              0














              CORRECTION: The reason the lastAccessedTime was not being updated was because we were not getting the entry via the ID field, we were searching on two other fields in the object. When we took those two fields and created a composite key, and made it the @Id field, then the time was updated when we retrieved the object.



              With partitioned Gemfire regions, any access to a secondary partition does not update the lastAccessedTime of the primary. So this won't do what we want, we'll need to add some code.






              share|improve this answer




























                0












                0








                0







                CORRECTION: The reason the lastAccessedTime was not being updated was because we were not getting the entry via the ID field, we were searching on two other fields in the object. When we took those two fields and created a composite key, and made it the @Id field, then the time was updated when we retrieved the object.



                With partitioned Gemfire regions, any access to a secondary partition does not update the lastAccessedTime of the primary. So this won't do what we want, we'll need to add some code.






                share|improve this answer















                CORRECTION: The reason the lastAccessedTime was not being updated was because we were not getting the entry via the ID field, we were searching on two other fields in the object. When we took those two fields and created a composite key, and made it the @Id field, then the time was updated when we retrieved the object.



                With partitioned Gemfire regions, any access to a secondary partition does not update the lastAccessedTime of the primary. So this won't do what we want, we'll need to add some code.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 10 at 16:50

























                answered Jan 4 at 21:59









                WestyWesty

                63




                63






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042141%2fhow-to-get-pivotal-cloud-cache-idle-timeout-to-reset-on-access%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas