-
I tried to use the following insert statement to get the affected rows, I expected it is 2, but it always return 1 in the val sql = "insert into posts(title, content, status) values ($1, $2, $3)";
Mono
.from(template.withTransaction { status: ReactiveTransactionStatus<Connection> ->
val statement = status.connection.createStatement(sql)
statement
.bind(0, "test title")
.bind(1, "test content")
.bind(2, "DRAFT")
.add()
statement.bind(0, "test2 title")
.bind(1, "test2 content")
.bind(2, "DRAFT")
.add()
Flux.from(statement.execute()).flatMap { Flux.from(it.rowsUpdated) }
})
.`as` { StepVerifier.create(it) }
.consumeNextWith { it shouldBeEqualComparingTo 1 }
//.consumeNextWith { it shouldBeEqualComparingTo 1 }
.verifyComplete() In the R2dbc spec, it states in R2dbc batching statement, it could return one or many Here it only returns one |
Beta Was this translation helpful? Give feedback.
Answered by
hantsy
Dec 5, 2021
Replies: 1 comment 1 reply
-
Oh, it is my fault, should use Flux.from to create the flow. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mp911de
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, it is my fault, should use Flux.from to create the flow.