Facing issue with rowUpdated() Method

18 views
Skip to first unread message

sid sahu

unread,
May 9, 2024, 4:41:36 AM5/9/24
to r2dbc
Hi Team,

I hope this message finds you well.

I'm currently facing an issue with the rowUpdated method in my codebase. Specifically, I'm encountering inconsistencies in the row count it returns for delete and update queries. This inconsistency is causing some unexpected behavior in my application.

I've thoroughly reviewed the documentation for rowUpdated but haven't been able to pinpoint the root cause of this issue. I've ensured that my delete and update queries are correctly structured and are being executed as expected.

Could you please provide some guidance or suggestions on how to resolve this issue? Any help would be greatly appreciated.

I've included a snippet of the code where I'm experiencing this problem:

return r2dbcEntityTemplate.getDatabaseClient().sql(sqlQuery)
.fetch()
.rowsUpdated()
.flux()
.map(result ->{
if(dmlType.name().equalsIgnoreCase("update")) {
return Map.of("response_message",(Object) dmlType.getUpdatedRowMessage());
}
else if(dmlType.name().equalsIgnoreCase("delete")) {
return Map.of("response_message", (Object) dmlType.getUpdatedRowMessage());
}
return Map.of("response_message", (Object) dmlType.getModifiedRowCountMessage(result));
})

Thank you in advance for your assistance.

Best regards,
Siddharth Sahu
Reply all
Reply to author
Forward
0 new messages