Rohit Bajaj
asked on
When complete not working in completion Stage
Hi,
I am using the following code..
But the string xyz is not getting printed in the console.
As per what i read whenComplete will get executed in both cases when the future completes
normally or exceptionally.
This is the update function in dao :
Thanks
I am using the following code..
dao.update(table, rblKycRequestDetailsJsonObject).whenComplete((__,_1)->{
System.out.println("xyz");
});
And executed it.But the string xyz is not getting printed in the console.
As per what i read whenComplete will get executed in both cases when the future completes
normally or exceptionally.
This is the update function in dao :
public CompletionStage<Integer> update(Table table, JsonObject jsonObject) {
logger.debug("Inserting data in generic dao")
.attr("table", table)
.attr("jsonObject", jsonObject)
.log();
return getPostgresInstruction(table, jsonObject)
.thenCompose(postgresInstruction -> update(postgresInstruction));
}
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.