[
https://issues.apache.org/jira/browse/JENA-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15373369#comment-15373369
]
ASF subversion and git services commented on JENA-1090:
-------------------------------------------------------
Commit e420905490cd6c8986b3276f89a372ea330f6448 in jena's branch
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=e420905 ]
JENA-1090 : Merge commit 'refs/pull/153/head' of github.com:apache/jena
This closes #153.
> 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)