You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use @Transaction annotation (or other way) in my code because it is already supported by MongoDB and Spring Boot 3 (with Reactor and Kotlin Coroutine). I just got the below exception message.
Will there be a solution for it in the future?
I used: com.playtika.testcontainers:embedded-mongodb:3.0.0-RC3
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Command failed with error 20 (IllegalOperation): 'Transaction numbers are only allowed on a replica set member or mongos' on server localhost:52672. The full response is {"ok": 0.0, "errmsg": "Transaction numbers are only allowed on a replica set member or mongos", "code": 20, "codeName": "IllegalOperation"}
at app//org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:127)
at app//org.springframework.data.mongodb.core.ReactiveMongoTemplate.potentiallyConvertRuntimeException(ReactiveMongoTemplate.java:2574)
at app//org.springframework.data.mongodb.core.ReactiveMongoTemplate.lambda$translateException$93(ReactiveMongoTemplate.java:2557)
at app//reactor.core.publisher.Flux.lambda$onErrorMap$27(Flux.java:7099)
at app//reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94)
at app//reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onError(MonoFlatMapMany.java:255)
at app//reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.maybeOnError(FluxConcatMapNoPrefetch.java:326)
at app//reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onError(FluxConcatMapNoPrefetch.java:220)
at app//reactor.core.publisher.FluxCreate$BaseSink.error(FluxCreate.java:474)
at app//reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:802)
at app//reactor.core.publisher.FluxCreate$BufferAsyncSink.error(FluxCreate.java:747)
at app//reactor.core.publisher.FluxCreate$SerializedFluxSink.drainLoop(FluxCreate.java:237)
at app//reactor.core.publisher.FluxCreate$SerializedFluxSink.drain(FluxCreate.java:213)
at app//reactor.core.publisher.FluxCreate$SerializedFluxSink.error(FluxCreate.java:189)
at app//reactor.core.publisher.LambdaMonoSubscriber.doError(LambdaMonoSubscriber.java:155)
at app//reactor.core.publisher.LambdaMonoSubscriber.onError(LambdaMonoSubscriber.java:150)
at app//reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134)
at app//reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93)
at app//reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93)
at app//reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:241)
at app//reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:315)
at app//reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onError(MonoPeekTerminal.java:258)
at app//reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:201)
at app//com.mongodb.reactivestreams.client.internal.MongoOperationPublisher.lambda$sinkToCallback$31(MongoOperationPublisher.java:573)
at app//com.mongodb.reactivestreams.client.internal.OperationExecutorImpl.lambda$execute$2(OperationExecutorImpl.java:94)
at app//com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:46)
at app//com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:97)
at app//com.mongodb.internal.async.function.RetryingAsyncCallbackSupplier$RetryingCallback.onResult(RetryingAsyncCallbackSupplier.java:111)
at app//com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:46)
at app//com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:97)
at app//com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:46)
at app//com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:97)
at app//com.mongodb.internal.operation.FindOperation$1.onResult(FindOperation.java:373)
at app//com.mongodb.internal.operation.CommandOperationHelper.lambda$transformingReadCallback$10(CommandOperationHelper.java:323)
at app//com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:46)
at app//com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$1.onResult(DefaultServer.java:238)
at app//com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:46)
at app//com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:82)
at app//com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:683)
at app//com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:159)
at app//com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:46)
at app//com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:526)
at app//com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:501)
at app//com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:824)
at app//com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:788)
at app//com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:648)
at app//com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:645)
at app//com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:319)
at app//com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:266)
at app//com.mongodb.internal.connection.InternalStreamConnection.readAsync(InternalStreamConnection.java:645)
at app//com.mongodb.internal.connection.InternalStreamConnection.access$600(InternalStreamConnection.java:89)
at app//com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:778)
at app//com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:763)
at app//com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:648)
at app//com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:645)
at app//com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:319)
at app//com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:347)
at app//com.mongodb.connection.netty.NettyStream.access$1100(NettyStream.java:105)
at app//com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:421)
at app//com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:418)
at app//io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at app//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at app//io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at app//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at app//io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at app//io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at app//io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at app//io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at app//io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.run(Thread.java:833)
Caused by: com.mongodb.MongoQueryException: Command failed with error 20 (IllegalOperation): 'Transaction numbers are only allowed on a replica set member or mongos' on server localhost:52672. The full response is {"ok": 0.0, "errmsg": "Transaction numbers are only allowed on a replica set member or mongos", "code": 20, "codeName": "IllegalOperation"}
at app//com.mongodb.internal.operation.FindOperation$1.onResult(FindOperation.java:374)
... 44 more
The text was updated successfully, but these errors were encountered:
Numichi
changed the title
Support mongodb transaction
Support mongodb replica set for transaction and change stream
Mar 17, 2023
Hi,
I would like to use
@Transaction
annotation (or other way) in my code because it is already supported by MongoDB and Spring Boot 3 (with Reactor and Kotlin Coroutine). I just got the below exception message.Will there be a solution for it in the future?
I used: com.playtika.testcontainers:embedded-mongodb:3.0.0-RC3
The text was updated successfully, but these errors were encountered: