   setNodeMetadata: (id, metadata) ->
     node = @getNode id
     return unless node
+
+    @checkTransactionStart()
+
     node.metadata = {} unless node.metadata
 
     for item, val of metadata
       node.metadata[item] = val
 
     @emit 'changeNode', node
-
+    @checkTransactionEnd()
 
   # ## Connecting nodes
   #

  if definition.groups
    for group in definition.groups
      graph.addGroup group.name, group.nodes, group.metadata

  success graph



    @emit 'removeNode', node

    @checkTransactionEnd()

  # ## Getting a node
  #
  # Nodes objects can be retrieved from the graph by their ID:
