Thanks to visit codestin.com
Credit goes to github.com

Skip to content

named binding is not supported by jasync driver #425

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

Open
juzweb opened this issue Sep 6, 2024 · 1 comment
Open

named binding is not supported by jasync driver #425

juzweb opened this issue Sep 6, 2024 · 1 comment

Comments

@juzweb
Copy link

juzweb commented Sep 6, 2024

Hi I am hitting the above error when my program execute to this:

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import reactor.core.publisher.Flux;

@Qualifier("dftConnectionFactory")
public interface DTFBillRepo extends R2dbcRepository<Bill, BillPk> {
    
    @Query("""
        select * from Bill where CAST(Bill_Time AS DATE) = CAST(:targetDate AS DATE)
        """)
    Flux<Bill> findByBillTimeOn(String targetDate);
    
    Flux<Bill> findBillByStoreNo(String storeNo);
    
}

The Error:

2024-09-06T20:34:14.479+08:00 ERROR 32780 --- [evois] [onPool-worker-1] a.w.r.e.AbstractErrorWebExceptionHandler : [eb4d9693-1]  500 Server Error for HTTP POST "/api/1.0/dtf/bill"

java.lang.UnsupportedOperationException: named binding is not supported by jasync driver P0_targetDate=2024-09-05T10:12:35.342
	at com.github.jasync.r2dbc.mysql.JasyncStatement.bind(JasyncStatement.kt:65) ~[jasync-r2dbc-mysql-2.2.4.jar:na]
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
	*__checkpoint ⇢ Handler com.efixion.evois.dtf.api.DtfController#billTransfer(BillTransferDto) [DispatcherHandler]
	*__checkpoint ⇢ HTTP POST "/api/1.0/dtf/bill" [ExceptionHandlingWebHandler]
Original Stack Trace:
		at com.github.jasync.r2dbc.mysql.JasyncStatement.bind(JasyncStatement.kt:65) ~[jasync-r2dbc-mysql-2.2.4.jar:na]
		at org.springframework.r2dbc.core.DefaultDatabaseClient$StatementWrapper.bind(DefaultDatabaseClient.java:581) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.r2dbc.core.binding.NamedBindMarkers$NamedBindMarker.bind(NamedBindMarkers.java:102) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.data.r2dbc.core.NamedParameterUtils$ExpandedQuery.bind(NamedParameterUtils.java:534) ~[spring-data-r2dbc-3.3.3.jar:3.3.3]
		at org.springframework.data.r2dbc.core.NamedParameterUtils$ExpandedQuery.bindTo(NamedParameterUtils.java:601) ~[spring-data-r2dbc-3.3.3.jar:3.3.3]
		at org.springframework.data.r2dbc.repository.query.StringBasedR2dbcQuery$ExpandedQuery.bindTo(StringBasedR2dbcQuery.java:219) ~[spring-data-r2dbc-3.3.3.jar:3.3.3]
		at org.springframework.r2dbc.core.DefaultDatabaseClient$DefaultGenericExecuteSpec.lambda$getResultFunction$9(DefaultDatabaseClient.java:394) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.r2dbc.core.ResultFunction.apply(ResultFunction.java:64) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.r2dbc.core.DefaultFetchSpec.lambda$all$1(DefaultFetchSpec.java:77) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.r2dbc.core.DelegateConnectionFunction.apply(DelegateConnectionFunction.java:48) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.r2dbc.core.DelegateConnectionFunction.apply(DelegateConnectionFunction.java:33) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at org.springframework.r2dbc.core.DefaultDatabaseClient.lambda$inConnectionMany$6(DefaultDatabaseClient.java:147) ~[spring-r2dbc-6.1.12.jar:6.1.12]
		at reactor.core.publisher.FluxUsingWhen.deriveFluxFromResource(FluxUsingWhen.java:122) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.FluxUsingWhen.access$000(FluxUsingWhen.java:53) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.FluxUsingWhen$ResourceSubscriber.onNext(FluxUsingWhen.java:195) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:121) ~[reactor-core-3.6.9.jar:3.6.9]
		at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:67) ~[reactor-core-3.6.9.jar:3.6.9]
		at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[na:na]
		at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) ~[na:na]
		at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
		at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[na:na]
		at com.github.jasync.sql.db.util.FutureUtilsKt.success(FutureUtils.kt:16) ~[jasync-pool-2.2.4.jar:na]
		at com.github.jasync.sql.db.mysql.MySQLConnection.onOk(MySQLConnection.kt:225) ~[jasync-mysql-2.2.4.jar:na]
		at com.github.jasync.sql.db.mysql.codec.MySQLConnectionHandler.channelRead0(MySQLConnectionHandler.kt:124) ~[jasync-mysql-2.2.4.jar:na]
		at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) ~[netty-common-4.1.112.Final.jar:4.1.112.Final]
		at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.112.Final.jar:4.1.112.Final]
		at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

I am using

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.3</version>
        <relativePath/> <!-- lookup parent from repository -->
 </parent>
 
<dependency>
      <groupId>com.mysql</groupId>
      <artifactId>mysql-connector-j</artifactId>
      <scope>runtime</scope>
  </dependency>
  <dependency>
      <groupId>com.github.jasync-sql</groupId>
      <artifactId>jasync-r2dbc-mysql</artifactId>
      <version>2.2.4</version>
  </dependency>
  

Does anyone know why the name binding is not working ?

TQIA

Copy link

github-actions bot commented Sep 6, 2024

Thank you for reporting an issue. See the wiki for documentation and gitter for questions.

@juzweb juzweb changed the title named binding is not supported by jasync drive named binding is not supported by jasync driver Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant