Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-125830

CounterLocalServiceUtil.increment only persist values in memory

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: No Longer Reproducible
    • Affects Version/s: 7.3.X, Master
    • Fix Version/s: Master
    • Component/s: Core Infrastructure
    • Labels:

      Description

      Steps to reproduce it:

      1. Startup the server
      2. Execute the following query in the database:
        SELECT currentId FROM master.Counter where name = 'com.liferay.counter.kernel.model.Counter';
        
      3. Execute the following groovy script using a much higher value than the currentId, for example 50000 in this case:
        import com.liferay.counter.kernel.service.CounterLocalServiceUtil;
        import com.liferay.counter.kernel.model.Counter;
        
        out.println(CounterLocalServiceUtil.increment(Counter.class.getName(), 50000))
        
      4. Execute the query again

      Results:
      The output of the script is higher than the value in the database. This means that we have increment the excepted size in memory but not in the database so next time we restart the server we can generate duplicates.

      Expected results:
      The value for currentId is higher (100) than the output of the script.
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Summer Zhang
              Engineering Assignee:
              Alberto Chaparro
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                13 weeks, 3 days ago

                  Packages

                  Version Package
                  Master