*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
*Screen Resolution*: 1440 x 900
Customer feedback from Couchbase Community Slack. The question arose on SDK settings page - I'm pretty sure it would be fine to add a link to another page there, too, if it's more efficient to explain all those settings values in more detail on a single page that's not language specific.
The gist of it is this:
Not only does that doc not cover what's appropriate when using different environments, it also doesn't cover the order that you need to close/shutdown the environment and cluster or if it matters.
The longer sample of the chat is below, might help recreate some of the context.
In the docs for the Java SDK, I see a lot of warnings about re-using the cluster environment or bad things will happen. Here's an example from the docs:
```CouchbaseEnvironment env = DefaultCouchbaseEnvironment.create();
CouchbaseCluster cluster1 = CouchbaseCluster.create(env, "192.168.56.1");
CouchbaseCluster cluster2 = CouchbaseCluster.create(env, "192.168.57.10");```
Does that assume that all clusters will use the same settings? What if I want to connect to two clusters and use a different environment (settings) for each one? Will horrible things still happen if I create two `CouchbaseEnvironment`'s or is that a valid use case? (edited)
bdw429s [2:34 PM]
Also, does anyone know if there comprehensive docs on all the settings you can put in `CouchbaseEnvironment`? All the guides I can find just cover a few basic examples, and the javadocs are sparse. (edited)
And here's the links I'm looking at when I say that:
The default timeout for binary (key/value) operations, set to DefaultCouchbaseEnvironment.KV_TIMEOUT.```
Timeout in what? miliseconds? seconds? minutes? What is `KV_TIMEOUT`? The link seems to go nowhere. (edited)
protomike [3:55 PM]
I am just looking it up. KV_TIMEOUT is Key Value Time Out which can be set to how long you would like so you don't get an exception.
protomike [4:03 PM]
You should be able to set it like KV_TIMEOUT(1000) for a second and or as long as you like.
bdw429s [7:03 PM]
@protomike: Thanks for that, it was just an example though. I'm looking for a comprehensive doc that covers all the options.
I did find this, but it's for an older version and I can't seem to find a current version of the same doc for the latest SDK/Couchbase release
bdw429s [7:41 PM]
I think I finally found the current version: http://developer.couchbase.com/documentation/server/current/sdk/java/client-settings.html (edited)
My initial question still stands about re-using environments.
protomike [9:07 PM]
Has a piece talking about reusing environments http://developer.couchbase.com/documentation/server/current/sdk/java/managing-connections.html
Managing Connections using the Java SDK with Couchbase Server
This section describes how to connect the Java SDK to a Couchbase cluster and bucket. It contains best practices as well as information on SSL and other advanced connection options.
bdw429s [9:10 PM]
@protomike: Yes. that's the doc I was quoting with my above code sample. (edited)
Not only does that doc not cover what's appropriate when using different environments, it also doesn't cover the order that you need to close/shutdown the environment and cluster or if it matters. (edited)
protomike [9:24 PM]
Sorry, I am skimming through the docs along with you. Maybe this has some outlook https://forums.couchbase.com/t/will-couchbase-client-connection-become-stale/8332
Will Couchbase client connection become stale?
I have a long-running server using the couchbase client 2.2.3 to talk to a couchbase cluster. I wonder if the connection will become stale eventually or it can refresh itself automatically. Do I need to periodically disconnect the connection and manually create a new connection through CouchbaseCluster.create() periodically? Thanks.
|Field||Original Value||New Value|
|Assignee||Amarantha Kulkarni [ amarantha.kulkarni ]||Matt Ingenthron [ ingenthr ]|
|Component/s||server dev guide and SDKs [ 11814 ]|
|Assignee||Matt Ingenthron [ ingenthr ]||Michael Nitschinger [ daschl ]|
|Workflow||classic default workflow [ 63174 ]||DOC Workflow [ 74669 ]|
|Workflow||DOC Workflow [ 74669 ]||Original DOC Workflow [ 97062 ]|
|Assignee||Michael Nitschinger [ daschl ]||Richard Smedley [ richard smedley ]|
|Sprint||DOC-S17-Jun01 [ 492 ]|
|Sprint||DOC-S17-Jun01 [ 492 ]||DOC-S16-May18 [ 491 ]|
|Sprint||DOC-S16-May18 [ 491 ]||DOC-S21-Jul13 [ 583 ]|
|Priority||Test Blocker [ 6 ]|
|Sprint||DOC-S21-Jul20[Vulcan GA] [ 583 ]||DOC-S23-Aug17 [ 597 ]|
|Sprint||DOC-S23-Aug17 [ 597 ]|
|Component/s||sdk [ 14110 ]|
|Status||Open [ 1 ]||In Progress [ 3 ]|
|Status||In Progress [ 3 ]||In Review [ 10107 ]|
|Status||In Review [ 10107 ]||In Progress [ 3 ]|
|Resolution||Fixed [ 1 ]|
|Status||In Progress [ 3 ]||Resolved [ 5 ]|