1

I updated my sample application to Helidon SE 2.1 and there is a ping statement for DB health:

db:
 statement:
   ping: "select 1" 

And I am using Postgres for test purpose.

But it did not work now. I got the exception when I accessing the /health endpoint.

{"ErrorClass":"java.util.concurrent.CompletionException",
"ErrorMessage":"org.postgresql.util.PSQLException: A result was returned when none was expected."}
Hantsy
  • 8,006
  • 7
  • 64
  • 109

1 Answers1

4

Ping is expecting DML statement by default. Try

DbClientHealthCheck.builder(dbClient)
        .query()
        .statementName("ping")
        .build();

to initialize healthcheck.

Also, this is going to be changed in 2.3.0, see https://github.com/oracle/helidon/pull/2656

Tomas Kraus
  • 466
  • 2
  • 6
  • I Hope Helidon can stabilize APIs as possible, every updates I will get some broken changes. – Hantsy Feb 08 '21 at 06:34