Class: Neo4j::Embedded::EmbeddedTransaction

Inherits:
Transaction::Base show all
Defined in:
lib/neo4j-embedded/embedded_transaction.rb

Instance Attribute Summary collapse

Attributes inherited from Transaction::Base

#root, #session

Instance Method Summary collapse

Methods inherited from Transaction::Base

#autoclosed!, #close, #closed?, #expired?, #failed?, #inspect, #mark_expired, #mark_failed, #root?

Constructor Details

#initialize(session) ⇒ EmbeddedTransaction

Returns a new instance of EmbeddedTransaction.



6
7
8
9
# File 'lib/neo4j-embedded/embedded_transaction.rb', line 6

def initialize(session)
  super
  @root_tx = @session.begin_tx
end

Instance Attribute Details

#root_txObject (readonly)

Returns the value of attribute root_tx.



4
5
6
# File 'lib/neo4j-embedded/embedded_transaction.rb', line 4

def root_tx
  @root_tx
end

Instance Method Details

#acquire_read_lock(entity) ⇒ Object



11
12
13
# File 'lib/neo4j-embedded/embedded_transaction.rb', line 11

def acquire_read_lock(entity)
  @root_tx.acquire_read_lock(entity)
end

#acquire_write_lock(entity) ⇒ Object



15
16
17
# File 'lib/neo4j-embedded/embedded_transaction.rb', line 15

def acquire_write_lock(entity)
  @root_tx.acquire_write_lock(entity)
end

#commitObject



24
25
26
27
# File 'lib/neo4j-embedded/embedded_transaction.rb', line 24

def commit
  @root_tx.success
  @root_tx.close
end

#deleteObject



19
20
21
22
# File 'lib/neo4j-embedded/embedded_transaction.rb', line 19

def delete
  @root_tx.failure
  @root_tx.close
end