Hi,
I’m using java-client 2.4.3 and couchbase server 4.6.
I’m facing a strange behaviour in couchbase: running the following several times returns differents values:
SELECT T., Product., Account.* FROM MyBucket T
JOIN MyBucket Product ON KEYS T.product_ref
JOIN MyBucket Account ON KEYS T.account_ref
where T._type=‘Transaction’ and Product._type = ‘Product’ and Account._type=‘Account’
@zizou you are using the async API and missed two things:
you need to chain in a .timeout() operator on the client side (this is done for you on the sync api)
you are not consuming the errors right now of the result
Most likely the result is timing out and because you are not consuming the error you are flying blind. Adding a client side timeout similart to the server side timeout set (which has a default or you can customize it on the query params) allows you to better control timeout behavior.
The errors are emitted by the AsyncN1qlQueryResult.errors() observable. You need to handle those errors in some fashion and emit an exception so your subscriber’s onError() will be invoked. In some situations you may be satisfied with partial results and can do as you did and just map to the AsyncN1qlQueryResult.rows() observable.
I have used code like this to throw an exception for one of the emitted errors: