Skip to content

Small API updates #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2017
Merged

Small API updates #328

merged 2 commits into from
Mar 8, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Mar 8, 2017

No description provided.

lutovich added 2 commits March 8, 2017 00:44
Added dedicated functional interface `TransactionWork` to be used in
`Session#readTransaction()` and `Session#writeTransaction()` methods.
It does not change how code looks for Java 8 lambdas but looks better with
Java 7 where users do not need to implement `Function<T,U>` where first
generic type parameter is always `Transaction`.
This commit makes `Session#readTransaction()` and `Session#writeTransaction()`
automatically commit when transaction was not marked as failure and no
exception was thrown. This effectively removes the need to call `tx.success()`
as the last statement in a transaction.
@zhenlineo
Copy link
Contributor

LG

@technige technige merged commit 41dc339 into 1.2 Mar 8, 2017
@technige technige deleted the 1.2-small-api-updates branch March 8, 2017 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants