You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a preparedBatch() [insert] and is it possible for the auto-commit to fail after the code enters the async response (ar). If so, under what conditions?
repository.preparedBatch(this.cteSQL, batch, ar -> {
if (ar.succeeded()) {
res = getResult(ar.result());
emitter.onSuccess(res);
} else {
/*** Some other code ****/
});
I am having a situation where I am making calls to two repositories (one is Cassandra and other PostGres) using Flowable.fromArray(repos) and will return to the caller when I get the first successful result or the last error (using firstOrError()). When the Cassandra comes faster, under some condition, I see PostGres successful logging (after successful preparedBatch insert, aka after ar.succeeded()) but on querying the DBMS, I dont see the record in PostGres.
It is only happening at high volume. I am using PostGres CTE in my insert SQL statement. I am unable to recreate this in a standalone mode (once I recreate using a sample code, I will send them). I created a dummy class (Cassandra's equivalent) and when I return the dummy class, say in 10 ms, even before the PostGres call starts (before the execution of the preparedBatch statement), I can see the PostGres call getting abandoned. This is not an issue, as as long as I get a successful response from one of them, I am OK.
What is concerning is that I see logs that looks like PostGres returned successfully but something caused the rollback to happen after ar.succeeded() was executed. Is it possible?
Any help here will be a great support.
The text was updated successfully, but these errors were encountered:
Julien Viet, would like to hear your response. What we need to understand is the following "We need to understand the timing of the auto-commit in relation to the result-set return and the rollback when disconnect occurs".
I am using a preparedBatch() [insert] and is it possible for the auto-commit to fail after the code enters the async response (ar). If so, under what conditions?
repository.preparedBatch(this.cteSQL, batch, ar -> {
if (ar.succeeded()) {
res = getResult(ar.result());
emitter.onSuccess(res);
} else {
/*** Some other code ****/
});
I am having a situation where I am making calls to two repositories (one is Cassandra and other PostGres) using Flowable.fromArray(repos) and will return to the caller when I get the first successful result or the last error (using firstOrError()). When the Cassandra comes faster, under some condition, I see PostGres successful logging (after successful preparedBatch insert, aka after ar.succeeded()) but on querying the DBMS, I dont see the record in PostGres.
It is only happening at high volume. I am using PostGres CTE in my insert SQL statement. I am unable to recreate this in a standalone mode (once I recreate using a sample code, I will send them). I created a dummy class (Cassandra's equivalent) and when I return the dummy class, say in 10 ms, even before the PostGres call starts (before the execution of the preparedBatch statement), I can see the PostGres call getting abandoned. This is not an issue, as as long as I get a successful response from one of them, I am OK.
What is concerning is that I see logs that looks like PostGres returned successfully but something caused the rollback to happen after ar.succeeded() was executed. Is it possible?
Any help here will be a great support.
The text was updated successfully, but these errors were encountered: