Couchbase SDK with Transaction

Hi All,

I am trying to create transaction with java SDK.

Java - 11
Couchbase SDK - 3.2.2
couchbase-transactions - 1.2.2

below is my code …

Cluster cluster = Cluster.connect("localhost", "Administrator", "123456");

Transactions transactions = Transactions.create(cluster, TransactionConfigBuilder.create().durabilityLevel(TransactionDurabilityLevel.PERSIST_TO_MAJORITY)
                .logOnFailure(true, Event.Severity.WARN)
                .build());

Bucket bucket = cluster.bucket("config_test");
Scope scope = bucket.scope("repo");

Getting below error,

Transaction did not reach commit point
com.couchbase.transactions.error.TransactionFailed: Transaction has failed with cause 'com.couchbase.client.core.error.DurabilityImpossibleException: With the current cluster configuration, the requested durability guarantees are impossible {"clientContext":{"txn.op":"atrPending"},"completed":true,"coreId":"0x537683d700000001","idempotent":false,"lastChannelId":"537683D700000001/000000004331CFE2","lastDispatchedFrom":"127.0.0.1:55645","lastDispatchedTo":"localhost:11210","requestId":20,"requestType":"SubdocMutateRequest","retried":0,"service":{"bucket":"config_test","collection":"_default","documentId":"_txn:atr-462-#12f","opaque":"0x25","scope":"_default","syncDurability":"PERSIST_TO_MAJORITY","type":"kv"},"status":"DURABILITY_IMPOSSIBLE","timeoutMs":10000,"timings":{"dispatchMicros":12506,"encodingMicros":29557,"totalDispatchMicros":12506,"totalServerMicros":2,"totalMicros":91943,"serverMicros":2}}'

I am getting below continues warning,

onnect attempt 1 failed because of : Connection refused: no further information: localhost/127.0.0.1:8095 - Check server ports and cluster encryption setting. {"circuitBreaker":"DISABLED","coreId":"0xa3acfba900000001","remote":"localhost:8095","type":"ANALYTICS"}

com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: localhost/127.0.0.1:8095 - Check server ports and cluster encryption setting.

What exact reason behind this…

Thanks

Hi @bphalak1
By any chance are you testing this on a single node cluster? If so then please see the note at the top of the Java transactions docs about that.