Uploaded image for project: 'Spymemcached Java Client'
  1. Spymemcached Java Client
  2. SPY-77

incr/decr can overflow the long return type


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.3
    • Fix Version/s: 2.8.2
    • Component/s: library
    • Security Level: Public
    • Labels:
    • Environment:


      I'm currently using the Couchbase Server 2.0 Developer Preview, but I think what I am seeing is the same as Membase Server.
      I'm using spymemcached in Java and I'd like to be able to increase a numeric key and return the new value. This works when the numbers are small as the result of the asyncIncr method fits into a Long, but when it doesn't Java overflows the Long and I end up with negative numbers. I can retrieve the correct (positive) value by doing a normal get as it returns the value as a String.
      Is it possible to retrieve the result of asyncIncr as a String as to prevent this problem?
      I'd also like to ask why negative numbers aren't supported and if there is a standard way to achieve this functionality by using an offset in my application code?


      No reviews matched the request. Check your Options in the drop-down menu of this sections header.


        mikew Mike Wiederhold created issue -
        mikew Mike Wiederhold made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Raghavan Srinivas [ rags ] Mike Wiederhold [ mikew ]
        Fix Version/s 2.8.2 [ 10348 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            mikew Mike Wiederhold
            mikew Mike Wiederhold
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created:

              Gerrit Reviews

              There are no open Gerrit changes