Skip to content
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

dao.insertReturningPrimary fails with java.util.NoSuchElementException #149

Closed
marioc-bitheads opened this issue Apr 24, 2020 · 5 comments
Closed
Labels
Milestone

Comments

@marioc-bitheads
Copy link

Using MySQL w/ ClassicReactiveVertxGenerator

using

dao.insert(body.getPojo())
succeed

but
dao.insertReturningPrimary(body.getPojo())

fails and returns :
java.util.NoSuchElementException at java.base/java.util.ArrayList$Itr.next(ArrayList.java:999) at io.vertx.sqlclient.impl.RowSetImpl$1.next(RowSetImpl.java:74) at io.github.jklingsporn.vertx.jooq.classic.reactivepg.ReactiveClassicQueryExecutor.lambda$insertReturning$2(ReactiveClassicQueryExecutor.java:39) at io.vertx.core.Future.lambda$map$4(Future.java:405) at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) at io.vertx.core.impl.FutureImpl.handle(FutureImpl.java:176) at io.vertx.core.impl.FutureImpl.handle(FutureImpl.java:21) at io.vertx.sqlclient.impl.SqlResultHandler.complete(SqlResultHandler.java:97) at io.vertx.sqlclient.impl.SqlResultHandler.handle(SqlResultHandler.java:86) at io.vertx.sqlclient.impl.SqlResultHandler.handle(SqlResultHandler.java:33) at io.vertx.sqlclient.impl.PoolBase$1.lambda$onSuccess$0(PoolBase.java:102) at io.vertx.sqlclient.impl.SocketConnectionBase.handleMessage(SocketConnectionBase.java:210) at io.vertx.sqlclient.impl.SocketConnectionBase.lambda$init$0(SocketConnectionBase.java:81) at io.vertx.core.net.impl.NetSocketImpl.lambda$new$2(NetSocketImpl.java:101) at io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:237) at io.vertx.core.streams.impl.InboundBuffer.write(InboundBuffer.java:127) at io.vertx.core.net.impl.NetSocketImpl.handleMessage(NetSocketImpl.java:357) at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369) at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:43) at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:232) at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:173) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.vertx.mysqlclient.impl.codec.MySQLEncoder.lambda$write$0(MySQLEncoder.java:58) at io.vertx.mysqlclient.impl.codec.QueryCommandBaseCodec.handleAllResultsetDecodingCompleted(QueryCommandBaseCodec.java:178) at io.vertx.mysqlclient.impl.codec.QueryCommandBaseCodec.handleSingleResultsetDecodingCompleted(QueryCommandBaseCodec.java:141) at io.vertx.mysqlclient.impl.codec.ExtendedQueryCommandBaseCodec.handleInitPacket(ExtendedQueryCommandBaseCodec.java:26) at io.vertx.mysqlclient.impl.codec.QueryCommandBaseCodec.decodePayload(QueryCommandBaseCodec.java:58) at io.vertx.mysqlclient.impl.codec.ExtendedQueryCommandCodec.decodePayload(ExtendedQueryCommandCodec.java:100) at io.vertx.mysqlclient.impl.codec.MySQLDecoder.decodePayload(MySQLDecoder.java:62) at io.vertx.mysqlclient.impl.codec.MySQLDecoder.decode(MySQLDecoder.java:51) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:498) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:437) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:834)

@jklingsporn
Copy link
Owner

This is a bug indeed. I've managed to reproduce it and working on a fix now.

@jklingsporn
Copy link
Owner

This has been fixed in https://github.com/jklingsporn/vertx-jooq/tree/%23149. Apparently nobody used the reactive mysql client before 😄
Unfortunately there are issues with the transaction-handling though. The tests use the exact same methods as the postgres-client but for mysql, they fail. So I am more or less certain that transactions do not work properly with the reactive-mysql-client.

@marioc-bitheads
Copy link
Author

Thanks, Since I'm building something brand new, should I look into switching to Postgres instead, (I also had problems with json data type in MySQL)?

@jklingsporn
Copy link
Owner

It is a matter of taste, but I favor postgres over mysql. In terms of vertx-jooq I'd strongly advise for the postgres driver.

@marioc-bitheads
Copy link
Author

Awesome, thanks for your advise.

@jklingsporn jklingsporn added this to the 5.1.2 milestone Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants