Insert or overwrite a
Document with the default key/value timeout.
If the given
Document (identified by its unique ID) already exists, it will be overridden by the current
one. The returned
Document contains original properties, but has the refreshed CAS value set.
Please note that this method will not use the
Document#cas() for optimistic concurrency checks. If
this behavior is needed, the
#replace(Document) method needs to be used.
This operation will return successfully if the
Document has been acknowledged in the managed cache layer
on the master server node. If increased data durability is a concern,
#upsert(Document,PersistTo,ReplicateTo) should be used instead.
This method throws under the following conditions:
- The operation takes longer than the specified timeout:
TimeoutException wrapped in a
RuntimeException- The producer outpaces the SDK:
BackpressureException- The request content is too big:
RequestTooBigException- The operation had to be cancelled while on the wire or the retry strategy cancelled it instead of
RequestCancelledException- The server is currently not able to process the request, retrying may help:
TemporaryFailureException- The server is out of memory:
CouchbaseOutOfMemoryException- Unexpected errors are caught and contained in a generic