mirromutth / r2dbc-mysql

R2DBC MySQL Implementation
Apache License 2.0
656 stars 98 forks source link

There has been no response to queries using R2DBC #240

Closed zchengz closed 2 years ago

zchengz commented 2 years ago

public Mono<ServerResponse> queryValue(ServerRequest serverRequest) { return serverRequest.bodyToMono(QueryValueDTO.class) .flatMap( dto -> Mono.from(r2dbcEntityTemplate.getDatabaseClient().getConnectionFactory().create()) .flatMap(connection -> Mono.from(connection.createStatement(dto.getT()).execute())) .flatMap(x->{ return Mono.from(x.map((row,rowMetadata)->{ Object o = row.get(0); System.out.println(o); return o; })); }) .flatMap(this::ok)) .contextWrite(context -> context.put(DynamicDataSourceConstant.DATA_SOURCE_KEY, DynamicDataSourceConstant.DATA_SOURCE_KEY + context.get(TenantConstant.TENANT_ID))); }

After execute, there is no response. But executing the same SQL using other tools takes less than a second. Just an SQL for (left join + count) ---->(SELECT count(*) from ces_25 left join ces_5555 on ces_25.qq = ces_5555.sd).

I hope you can reply to me as soon as possible. Thank you in advance as soon as possible

zchengz commented 2 years ago

R2DBC Version is 0.8.3.BUILD-SNAPSHOT Mysql Version is 5.7

zchengz commented 2 years ago

The reason is that I made a mistake in the data source and I'm sorry