[ https://issues.apache.org/jira/browse/JENA-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369300#comment-15369300 ]
ASF GitHub Bot commented on JENA-1090: -------------------------------------- GitHub user afs opened a pull request: https://github.com/apache/jena/pull/153 JENA-1090: Txn - a java8-centric transaction API You can merge this pull request into a Git repository by running: $ git pull https://github.com/afs/jena txn Alternatively you can review and apply these changes as the patch at: https://github.com/apache/jena/pull/153.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #153 ---- commit 952aebd0ac8f2d5d590811f0ac97d3c17c9bea5a Author: Andy Seaborne <a...@apache.org> Date: 2016-07-09T21:40:03Z JENA-1090 : Txn - a java8-centric transaction API commit 52ff200c2756c9844b4346ffa1bff2a09081b649 Author: Andy Seaborne <a...@apache.org> Date: 2016-07-09T21:41:01Z Merge branch 'master' of https://github.com/apache/jena into txn ---- > Add transaction handling convenience code > ----------------------------------------- > > Key: JENA-1090 > URL: https://issues.apache.org/jira/browse/JENA-1090 > Project: Apache Jena > Issue Type: Improvement > Components: ARQ > Reporter: Andy Seaborne > > The code > [Txn|https://github.com/afs/jena-rdfconnection/blob/master/src/main/java/rdfconnection/Txn.java] > provides a convenient way to write common patterns of transaction usage > including > {noformat} > Txn.executeWrite(conn, () ->{ > ... write transaction code ... > }) ; > {noformat} > which provides the pattern: > {noformat} > txn.begin(ReadWrite.WRITE) ; > try { > ... write transaction code ... > txn.commit() ; > } > finally { txn.end() ; } > {noformat} > {{Txn}} also checks for being in a transaction already. > There are forms to return a value from the code inside the transaction block > as well. -- This message was sent by Atlassian JIRA (v6.3.4#6332)