severe impact on performance and stability warnings

I am seeing these warnings in my logs for each context that gets loaded.

19-May-2017 11:15:03.225 WARNING [Thread-9] com.couchbase.client.core.env.DefaultCoreEnvironment. More than 1 Couchbase Environments found (2), this can have severe impact on performance and stability. Reuse environments!
….
19-May-2017 11:15:03.225 WARNING [Thread-13] com.couchbase.client.core.env.DefaultCoreEnvironment. More than 1 Couchbase Environments found (3), this can have severe impact on performance and stability. Reuse environments!
….
19-May-2017 11:15:03.225 WARNING [Thread-27] com.couchbase.client.core.env.DefaultCoreEnvironment. More than 1 Couchbase Environments found (4), this can have severe impact on performance and stability. Reuse environments!

I get a set of warnings for every application that creates clients. Not sure what I am doing wrong. Each of my applications creates 3 couchbase client. One for each bucket. like so:

<cfset APPLICATION.cbluceestore = new cfcouchbase.CouchbaseClient({
servers = VARIABLES.clustermembers,
bucketName = ‘cbluceestore’,
password = VARIABLES.bucketpassword,
EnableConfigHeartBeat = true
}) />

<cfsetAPPLICATION.cbprofiles = new cfcouchbase.CouchbaseClient({
servers = VARIABLES.clustermembers,
bucketName = ‘profiles’,
password = VARIABLES.bucketpassword,
EnableConfigHeartBeat = true
}) />

<cfset APPLICATION.CBrole_matching = new cfcouchbase.CouchbaseClient({
servers = VARIABLES.clustermembers,
bucketName = ‘role_matching’,
password = VARIABLES.bucketpassword,
EnableConfigHeartBeat = true
}) />

Since i have 4 applications then I should have 12 clients

Version Lucee 5.2.1.9
Version Name Velvet
Release date May 5, 2017
ColdFusion® compatibility version 2016.0.03.300357

Configuration File C:\Sites\lucee\tomcat\lucee-server\context\lucee-server.xml
OS Windows Server 2012 R2 (6.3) 64bit
Remote IP 192.168.254.162
Host Name 09dev.nonfatmedia.net
Servlet Container Apache Tomcat/8.5.11
Java 1.8.0_121 (Oracle Corporation) 64bit
Architecture 64bit

Installed version 3.0.0.00024
Type Full Version
Category Database & Cache
Release Date Jan 25, 2017
Id 14B0C2A7-5CFC-4606-9167C93959A8B82C
Provider Production Ortus Solutions Lucee Provider (lucee.ortussolutions.com)
Required Bundles (Jars) - ortus.extension.cache.couchbase (3.0.0.00024)

I would like to add that I am also using the the SDK as well as the extension.

Hi Marc, I don’t believe you’re doing anything wrong. That warning comes from inside the Couchbase SDK itself and appears to be an attempt to prevent people from re-creating their Couchbase connection every time they go to use it. With our extension, each connection has different settings, so there’s obviously no way to re-use them. We’re only creating a single one per cache, so it’s not like there’s a new one created for every page request, which is the scenario I’m pretty sure the warnings are warning you about.

Makes sense. Let me ask though. The only real reason I currently use the SDK is to do n1sql queries.

Can I get rid of the sdk and use the extension to do the same? does the extension not have all the same methods as the sdk. I would be great if I could just declare my cache in admin once and use those instead of creating lots of clients that I need to opened and close programmatically.

marc

The extension just focuses on caching. If you want to use the JSON capabilities of Couchbase, that’s what the CFCouchbase SDK is for. The extension does make the underlying Java classes available to you with

couchbaseGetCluster( ‘cacheName’ )

couchbaseGetBucket( ‘cacheName’ )

couchbaseGetProvider( ‘cacheName’ )

Maybe as a future enhancement to our SDK, we can add the option to have it just connect to an existing cache connection. To be honest, we always create separate buckets in Couchbase for our caching and general data store so this would never work for us since we need a separate connection anyway for each.