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

StreamQuery with transaction

Open arrowwood49 opened this issue 8 years ago • 5 comments

RxJava2 example here shows how to create stream query using connection. How do I create stream using PgTransaction class. I can't find method on io.reactiverse.reactivex.pgclient.PgTransaction class to get PgPreparedQuery or PgStream.

Thanks

arrowwood49 avatar Nov 02 '18 02:11 arrowwood49

we will add this method in the next version to prepare a query from a transaction

vietj avatar Nov 04 '18 21:11 vietj

in this API, you will only need to change pool.rxGetConnection() by pool.rxBegin() or call begin within a transaction. That being said now you can begin a transaction from a connection and get the prepared query on from the connection but it's less intuitive.

vietj avatar Nov 04 '18 21:11 vietj

In our implementation, we create the transaction and pass that to other classes and methods which then executes the sql using the same transaction object. So it is inconvenient to change all those implementation. As a workaround, we are not using the prepared sql and not using the streaming query when working with transaction.

arrowwood49 avatar Nov 05 '18 15:11 arrowwood49

we will add this method in the next version to prepare a query from a transaction

@vietj I see it is already fixed in 0.10.7. Thanks.

arrowwood49 avatar Nov 06 '18 21:11 arrowwood49

it has been released

vietj avatar Nov 07 '18 07:11 vietj