-
Notifications
You must be signed in to change notification settings - Fork 1
Redesign connect function #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
idea: create separate CBenvironment, with parameters; return id, to be used by creation connection. CouchbaseEnvironment env = DefaultCouchbaseEnvironment
.builder()
.sslEnabled(true)
.computationPoolSize(5)
.build();
Cluster cluster = CouchbaseCluster.create(env, "localhost"); couchbase:create-environment($params as map()) as xs:string with new couchbase:connect($connection as xs:string, $environment as xs:string) as xs:string |
@dizzzz keep in mind that if you want to make it right and you are passing in an environment you also need to shut it down manually (since we dont know where you are using it too). See http://docs.couchbase.com/developer/java-2.1/managing-connections.html |
Would it be sufficient to use a VM shutdown hook to do the cleanup? (as last resort) http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread) |
well, it doesn't hurt since all of the threads are daemonized, the main reason is actually to make sure all in flights requests get a chance to be properly handled. Maybe a shutdown hook works, actually I've never seen it used in practice. Also I'm unsure if it is included or not in "Shutdown hooks should also finish their work quickly. When a program invokes exit the expectation is that the virtual machine will promptly shut down and exit. When the virtual machine is terminated due to user logoff or system shutdown the underlying operating system may only allow a fixed amount of time in which to shut down and exit. It is therefore inadvisable to attempt any user interaction or to perform a long-running computation in a shutdown hook." |
Another issue that should come in here is that the timeout settings for the java sdk is short, and over slow networks, this blocks a connection. The timeout should be configurable. |
Bump org.exist-db:exist-core and org.exist-db:exist-testkit
suppor the following or aliket:
The text was updated successfully, but these errors were encountered: