package com.gentics.mesh.graphdb;

import com.gentics.mesh.graphdb.ferma.DelegatingFramedOrientGraph;
import com.gentics.mesh.graphdb.spi.Database;
import com.syncleus.ferma.FramedGraph;
import com.syncleus.ferma.typeresolvers.TypeResolver;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx;

public class OrientDBNoTx extends AbstractNoTx<FramedGraph> {

	OrientGraphNoTx noTx = null;

	public OrientDBNoTx(OrientGraphFactory factory, TypeResolver resolver) {
		if(Database.threadLocalGraph.get()!=null) {
			throw new RuntimeException("Warning - nested noTx detected!");
		}
		this.noTx = factory.getNoTx();
		FramedGraph graph = new DelegatingFramedOrientGraph(noTx, resolver);
		init(graph);
	}

	@Override
	public void close() {
		if (!noTx.isClosed()) {
			noTx.shutdown();
			Database.setThreadLocalGraph(getOldGraph());
		}
	}
}

@@ -526,24 +526,26 @@
 resolver) %7B%0A
+//
 %09%09if(Databas
@@ -578,16 +578,18 @@
 null) %7B%0A
+//
 %09%09%09throw
@@ -646,16 +646,18 @@
 ted!%22);%0A
+//
 %09%09%7D%0A%09%09th

Disable noTx check