vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

Rework cursor/stream documentation Pt 2

Open marcocamacho opened this issue 7 years ago • 3 comments

  • Currently the documentation does not show/mention how/that the connection should be closed. Rework the documentation so that we mention that and how a connection needs to be closed. What happened to me was that I grabbed the example from the documentation and eventually spend a lot of time figuring out why the query didn't work after running OK a few times (matching the connection pool size). That might save users some minutes/hours of debugging time.

  • Also, the PgStream has a close() method, should be also called explicitly. If so, add it to the documentation and specify where should it be closed (at the endHandler()?)

At the end, this is what I did:

stream.handler(row -> {
                       ...
                    }).endHandler(v -> {
                        tx.commit();
                        stream.close();
                        connection.close();
                    }).exceptionHandler(err -> {
                        stream.close();
                        connection.close();
                    });

marcocamacho avatar Jan 11 '19 17:01 marcocamacho

do you mind contributing this to the doc ?

vietj avatar Jan 11 '19 17:01 vietj

Sure, I assume PgStream needs to be closed then, right?

marcocamacho avatar Jan 11 '19 18:01 marcocamacho

yes, however please read this too and let me know what you think of it https://github.com/reactiverse/reactive-pg-client/issues/134 as a comment on the issue

vietj avatar Jan 11 '19 18:01 vietj