diff --git a/artemis/artemis-graph/src/main/java/org/jnosql/artemis/graph/TransactionalInterceptor.java b/artemis/artemis-graph/src/main/java/org/jnosql/artemis/graph/TransactionalInterceptor.java index eabd2e208..4bf2eb86b 100644 --- a/artemis/artemis-graph/src/main/java/org/jnosql/artemis/graph/TransactionalInterceptor.java +++ b/artemis/artemis-graph/src/main/java/org/jnosql/artemis/graph/TransactionalInterceptor.java @@ -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(); } @@ -48,6 +49,8 @@ public Object manageTransaction(InvocationContext context) throws Exception { } catch (Exception exception) { transaction.rollback(); throw exception; + }finally { + GraphTransactionUtil.unlock(); } }