Class: Pacer::Neo4j::BlueprintsGraph
- Inherits:
-
Object
- Object
- Pacer::Neo4j::BlueprintsGraph
- Defined in:
- lib/pacer-neo4j/blueprints_graph.rb
Instance Attribute Summary collapse
-
#allow_auto_tx ⇒ Object
Returns the value of attribute allow_auto_tx.
Instance Method Summary collapse
- #autoStartTransaction ⇒ Object
-
#tx_depth ⇒ Object
Threadlocal tx_depth is set in Pacer’s graph_transaction_mixin.rb.
Instance Attribute Details
#allow_auto_tx ⇒ Object
Returns the value of attribute allow_auto_tx.
4 5 6 |
# File 'lib/pacer-neo4j/blueprints_graph.rb', line 4 def allow_auto_tx @allow_auto_tx end |
Instance Method Details
#autoStartTransaction ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/pacer-neo4j/blueprints_graph.rb', line 13 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 |
#tx_depth ⇒ Object
Threadlocal tx_depth is set in Pacer’s graph_transaction_mixin.rb
7 8 9 10 11 |
# File 'lib/pacer-neo4j/blueprints_graph.rb', line 7 def tx_depth graphs = Thread.current[:graphs] ||= {} tgi = graphs[object_id] ||= {} tgi[:tx_depth] || 0 end |