Sha256: a6574238716cdd563de104e578d8102e37584c9d3462ed55e197da804ff68bfe

Contents?: true

Size: 595 Bytes

Versions: 10

Compression:

Stored size: 595 Bytes

Contents

module Pacer
  module Neo4j
    class BlueprintsGraph < com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph
      attr_accessor :allow_auto_tx

      # Threadlocal tx_depth is set in Pacer's graph_transaction_mixin.rb
      def tx_depth
        graphs = Thread.current[:graphs] ||= {}
        tgi = graphs[object_id] ||= {}
        tgi[:tx_depth] || 0
      end

      def autoStartTransaction
        if allow_auto_tx or tx_depth != 0
          super
        else
          raise Pacer::TransactionError, "Can't mutate the graph outside a transaction block"
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pacer-neo4j-2.3.7-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.3.6-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.3.5-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.3.4-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.3.3-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.3.2-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.3.0.pre-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.2.0-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.1.5-java lib/pacer-neo4j/blueprints_graph.rb
pacer-neo4j-2.1.4-java lib/pacer-neo4j/blueprints_graph.rb