Module: Pacer::Neo4j2::TxDepth
- Included in:
- BlueprintsGraph, BlueprintsHaGraph
- Defined in:
- lib/pacer-neo4j2/blueprints_graph.rb
Instance Attribute Summary collapse
-
#allow_auto_read_tx ⇒ Object
Returns the value of attribute allow_auto_read_tx.
-
#allow_auto_tx ⇒ Object
Returns the value of attribute allow_auto_tx.
Instance Method Summary collapse
-
#read_tx_depth ⇒ Object
Threadlocal read_tx_depth is set in Pacer’s graph_transaction_mixin.rb.
-
#tx_depth ⇒ Object
Threadlocal tx_depth is set in Pacer’s graph_transaction_mixin.rb.
Instance Attribute Details
#allow_auto_read_tx ⇒ Object
Returns the value of attribute allow_auto_read_tx.
7 8 9 |
# File 'lib/pacer-neo4j2/blueprints_graph.rb', line 7 def allow_auto_read_tx @allow_auto_read_tx end |
#allow_auto_tx ⇒ Object
Returns the value of attribute allow_auto_tx.
7 8 9 |
# File 'lib/pacer-neo4j2/blueprints_graph.rb', line 7 def allow_auto_tx @allow_auto_tx end |
Instance Method Details
#read_tx_depth ⇒ Object
Threadlocal read_tx_depth is set in Pacer’s graph_transaction_mixin.rb
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/pacer-neo4j2/blueprints_graph.rb', line 17 def read_tx_depth graphs = Thread.current[:graphs] ||= {} tgi = graphs[object_id] ||= {} depth = tgi[:read_tx_depth] || 0 if depth == 0 tgi[:tx_depth] || 0 # Reads are allowed in any type of tx. else depth end end |
#tx_depth ⇒ Object
Threadlocal tx_depth is set in Pacer’s graph_transaction_mixin.rb
10 11 12 13 14 |
# File 'lib/pacer-neo4j2/blueprints_graph.rb', line 10 def tx_depth graphs = Thread.current[:graphs] ||= {} tgi = graphs[object_id] ||= {} tgi[:tx_depth] || 0 end |