tinkerpop/gremlin — Issue #277: Add Transaction Wrapper Helper
Author: espeed
Created: 2012-01-12 08:55:56+00:00
State: open

This would simply a lot of Gremlin extension code...

```groovy
def transaction = { final Closure closure ->
g.setMaxBufferSize(0)
g.startTransaction()
try {
returnVar = closure()
g.stopTransaction(TransactionalGraph.Conclusion.SUCCESS)
return returnVar
} catch (e) {
g.stopTransaction(TransactionalGraph.Conclusion.FAILURE)
return e
}
}
```

Example usage...

```groovy
def updateIndexedVertex = {}
return transaction(updateIndexedVertex);
```