title: When I try to call my plugin, neo4j says that I need to wrap my call in a transaction
body: <p>I'm trying to write a plugin for neo4j 3.0.0. To test the water, I wrote this really simple method to expose the outgoing degree.</p>
  
  <pre><code>public class Utils extends ServerPlugin {
      @PluginTarget(value = Node.class)
      public int outgoingDegree(@Source Node node) {
          return node.getDegree(Direction.OUTGOING);
      }
  }
  </code></pre>
  
  <p>Registering the plugin worked flawlessly:</p>
  
  <p><code>curl -v http://localhost:7474/db/data/ext/</code></p>
  
  <pre><code>{
    "Utils" : "http://localhost:7474/db/data/ext/Utils"
  }
  </code></pre>
  
  <p>My little method is there:</p>
  
  <p><code>curl -v http://localhost:7474/db/data/ext/Utils</code></p>
  
  <pre><code>{
    "node" : {
      "outgoingDegree" : {
        "extends" : "node",
        "name" : "outgoingDegree",
        "description" : "",
        "parameters" : [ ]
      }
    }
  }
  </code></pre>
  
  <p>Amazing. Now when I try to call this method, everything goes downhill:</p>
  
  <p><code>url -XPOST -v http://localhost:7474/db/data/ext/Utils/node/20/outgoingDegree -H "Accept: application/json" -H "Content-type: application/json" -d "{  }"</code></p>
  
  <pre><code>{
    "message" : "The requested operation cannot be performed, because it has to be performed in a transaction. Ensure you are wrapping your operation in the appropriate transaction boilerplate and try again.",
    "exception" : "BridgeNotInTransactionException",
    "fullname" : "org.neo4j.kernel.impl.core.ThreadToStatementContextBridge$BridgeNotInTransactionException",
    "stackTrace" : [ "org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.assertInUnterminatedTransaction(ThreadToStatementContextBridge.java:72)", "org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.getTopLevelTransactionBoundToThisThread(ThreadToStatementContextBridge.java:105)", "org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.getKernelTransactionBoundToThisThread(ThreadToStatementContextBridge.java:113)", "org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.get(ThreadToStatementContextBridge.java:65)", "org.neo4j.kernel.impl.factory.ClassicCoreSPI.currentStatement(ClassicCoreSPI.java:205)", "org.neo4j.kernel.impl.factory.GraphDatabaseFacade$$Lambda$76/46581122.get(Unknown Source)", "org.neo4j.kernel.impl.coreapi.StandardNodeActions.statement(StandardNodeActions.java:56)", "org.neo4j.kernel.impl.core.NodeProxy.getDegree(NodeProxy.java:702)", "com.github.denizco.datascience.neo4jplugin.Utils.outgoingDegree(Utils.java:12)", "java.lang.reflect.Method.invoke(Method.java:483)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:61)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:158)", "org.neo4j.server.rest.web.ExtensionService.invokeNodeExtension(ExtensionService.java:325)", "org.neo4j.server.rest.web.ExtensionService.invokeNodeExtension(ExtensionService.java:184)", "java.lang.reflect.Method.invoke(Method.java:483)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:144)", "org.neo4j.server.rest.dbms.AuthorizationFilter.doFilter(AuthorizationFilter.java:121)", "org.neo4j.server.rest.web.CollectUserAgentFilter.doFilter(CollectUserAgentFilter.java:69)", "java.lang.Thread.run(Thread.java:745)" ],
    "errors" : [ {
      "code" : "Neo.ClientError.Request.TransactionRequired",
      "message" : "The requested operation cannot be performed, because it has to be performed in a transaction. Ensure you are wrapping your operation in the appropriate transaction boilerplate and try again."
    } ]
  }
  </code></pre>
  
  <p>What's going on here? Why do I need to wrap my call in a transaction and how do I do it? Is there a way around this?</p>