Skip to content

Commit

Permalink
uses hold code a transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Jun 25, 2019
1 parent 2a68e4f commit d00a672
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -38,6 +38,7 @@ class TransactionalInterceptor {
@AroundInvoke
public Object manageTransaction(InvocationContext context) throws Exception {
Transaction transaction = graph.get().tx();
GraphTransactionUtil.lock(transaction);
if (!transaction.isOpen()) {
transaction.open();
}
Expand All @@ -48,6 +49,8 @@ public Object manageTransaction(InvocationContext context) throws Exception {
} catch (Exception exception) {
transaction.rollback();
throw exception;
}finally {
GraphTransactionUtil.unlock();
}

}
Expand Down

0 comments on commit d00a672

Please sign in to comment.