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
Single query statements are closed right away (all methods except the ones that return Stream<DbRow>).
When operating on a Stream<DbRow> the underlying result set is closed on terminal operations, or if the underlying result set is drained.
Stream.close() can be used to manually close the underlying result set. This is not required, and if fact would reflect a mis-usage of the Stream API, E.g. a terminal operation wasn't called.
Transactions
In 3.x transactions were implemented by supplying a Function<DbTransaction, T>, changes made by the function were automatically committed at the end of the execution of the function, or automatically rolled-backed if an error occurred during the execution of the function.
In 4.x, inTransaction has been renamed to transaction. Transactions are not implemented with a user supplied function, instead the user is responsible for invoking commit() and rollback():
Problem Description
We need to update docs for 4.x
Guidelines
Make sure any fixes from MP 3.x are forward ported to 4.xMigration Impact
See #6991 for the initial notes and discussions on the API changes made in 4.x.
The notes below describe the bulk of the changes.
DbExecute
In 3.x the
DbExecute
interface was like this:In 4.x the
DbExecute
interface looks like this:The API was changed to be blocking instead of reactive:
Single<DbRow>
has been replaced withOptional<DbRow>
Multi<DbRow>
has been replaced withStream<DbRow>
Single<Long>
has been replaced withlong
In 4.x,
onComplete
is achieved by the next statement.onError
is achieved by a try-catch block:Closing of the underlying ResultSet
Single query statements are closed right away (all methods except the ones that return
Stream<DbRow>
).When operating on a
Stream<DbRow>
the underlying result set is closed on terminal operations, or if the underlying result set is drained.Stream.close()
can be used to manually close the underlying result set. This is not required, and if fact would reflect a mis-usage of the Stream API, E.g. a terminal operation wasn't called.Transactions
In 3.x transactions were implemented by supplying a
Function<DbTransaction, T>
, changes made by the function were automatically committed at the end of the execution of the function, or automatically rolled-backed if an error occurred during the execution of the function.E.g. A transaction In 3.x:
In 4.x,
inTransaction
has been renamed totransaction
. Transactions are not implemented with a user supplied function, instead the user is responsible for invokingcommit()
androllback()
:E.g. A transaction in 4.x:
Note that both the
commit()
androllback()
methods are new additions toDbTransaction
in 4.x:DbClientService
In 3.x
DbClientService
looked like this:Example of an implementation:
In 4.x
DbClientService
looks like this:Example of an implementation:
The text was updated successfully, but these errors were encountered: