Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.2.3
    • 1.2.2
    • library
    • Security Level: Public
    • None

    Description

      The documentation says "If set to 0 it will use the default lock timeout on the server."

      http://pythonhosted.org/couchbase/api/couchbase.html#couchbase.connection.Connection.lock

      However when I use ttl=0 I get this error:

      Using PYCBC=1.2.2, LCB=('2.1.2', 131330)
      Setting
      6425942093814169600
      Locking with: lock = cb.lock("lock", ttl=0)
      Traceback (most recent call last):
      File "./lock.py", line 12, in <module>
      lock = cb.lock("lock", ttl=0)
      File "/Library/Python/2.7/site-packages/couchbase/connection.py", line 594, in lock
      return _Base.lock(self, key, ttl=ttl)
      couchbase.exceptions.ArgumentError: <Lock must have an expiry, C Source=(src/get.c,107)>

      Code example:

      #!/usr/bin/python
      import couchbase
      from couchbase import Couchbase, Connection

      print "Using PYCBC=

      {0}

      , LCB=

      {1}

      ".format(couchbase._version_, Connection.lcb_version())
      cb = Couchbase.connect(bucket='default', host='localhost')

      print "Setting"
      doc = cb.set("lock","test")
      print doc.cas
      print "Locking with: " + 'lock = cb.lock("lock", ttl=0)'
      lock = cb.lock("lock", ttl=0)
      print lock.cas

      Attachments

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

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            pvarley Patrick Varley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty