private JtaTransactionManager createJtaTransactionManager() {
JtaTransactionManager jtaTm = new JtaTransactionManager();
final GraphDatabaseService gds = getGraphDatabaseService();
if (gds instanceof AbstractGraphDatabase) {
jtaTm.setTransactionManager(new SpringTransactionManager(gds));
jtaTm.setUserTransaction(new UserTransactionImpl(gds));
} else {
final NullTransactionManager tm = new NullTransactionManager();
jtaTm.setTransactionManager(tm);
jtaTm.setUserTransaction(new UserTransactionAdapter(tm));
}